diff --git a/azurerm/internal/azuresdkhacks/network_interface.go b/azurerm/internal/azuresdkhacks/network_interface.go index f5d295a6b4d6..907950a20be7 100644 --- a/azurerm/internal/azuresdkhacks/network_interface.go +++ b/azurerm/internal/azuresdkhacks/network_interface.go @@ -7,7 +7,7 @@ import ( "io" "net/http" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/Azure/go-autorest/autorest" ) diff --git a/azurerm/internal/services/compute/network_interface.go b/azurerm/internal/services/compute/network_interface.go index 2ed09d2e6dc8..5579a601ebbd 100644 --- a/azurerm/internal/services/compute/network_interface.go +++ b/azurerm/internal/services/compute/network_interface.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-12-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" ) diff --git a/azurerm/internal/services/compute/virtual_machine_resource.go b/azurerm/internal/services/compute/virtual_machine_resource.go index 8a3fa87bfb2c..14e4eddc3dff 100644 --- a/azurerm/internal/services/compute/virtual_machine_resource.go +++ b/azurerm/internal/services/compute/virtual_machine_resource.go @@ -10,7 +10,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-12-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/containers/container_group_resource.go b/azurerm/internal/services/containers/container_group_resource.go index 78ea051e0447..8c33b967b8c8 100644 --- a/azurerm/internal/services/containers/container_group_resource.go +++ b/azurerm/internal/services/containers/container_group_resource.go @@ -9,7 +9,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2019-12-01/containerinstance" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/firewall/client/client.go b/azurerm/internal/services/firewall/client/client.go index 894d10aee9b8..463ffae081ae 100644 --- a/azurerm/internal/services/firewall/client/client.go +++ b/azurerm/internal/services/firewall/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/firewall/firewall_application_rule_collection_resource.go b/azurerm/internal/services/firewall/firewall_application_rule_collection_resource.go index d770c5f43d43..03955f338379 100644 --- a/azurerm/internal/services/firewall/firewall_application_rule_collection_resource.go +++ b/azurerm/internal/services/firewall/firewall_application_rule_collection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/firewall/firewall_application_rule_collection_resource_test.go b/azurerm/internal/services/firewall/firewall_application_rule_collection_resource_test.go index 633af45539fe..4c6dc2642bba 100644 --- a/azurerm/internal/services/firewall/firewall_application_rule_collection_resource_test.go +++ b/azurerm/internal/services/firewall/firewall_application_rule_collection_resource_test.go @@ -6,7 +6,7 @@ import ( "regexp" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/firewall/firewall_data_source.go b/azurerm/internal/services/firewall/firewall_data_source.go index 759026d849c2..4e156f068fc0 100644 --- a/azurerm/internal/services/firewall/firewall_data_source.go +++ b/azurerm/internal/services/firewall/firewall_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/firewall/validate" diff --git a/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource.go b/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource.go index ff651e978a47..34d1390390f2 100644 --- a/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource.go +++ b/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -62,8 +62,8 @@ func resourceFirewallNatRuleCollection() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dnat), - string(network.Snat), + string(network.AzureFirewallNatRCActionTypeDnat), + string(network.AzureFirewallNatRCActionTypeSnat), }, false), }, @@ -120,10 +120,10 @@ func resourceFirewallNatRuleCollection() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.Any), - string(network.ICMP), - string(network.TCP), - string(network.UDP), + string(network.AzureFirewallNetworkRuleProtocolAny), + string(network.AzureFirewallNetworkRuleProtocolICMP), + string(network.AzureFirewallNetworkRuleProtocolTCP), + string(network.AzureFirewallNetworkRuleProtocolUDP), }, false), }, Set: pluginsdk.HashString, diff --git a/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource_test.go b/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource_test.go index 670665a3f5cc..50d650f2f385 100644 --- a/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource_test.go +++ b/azurerm/internal/services/firewall/firewall_nat_rule_collection_resource_test.go @@ -6,7 +6,7 @@ import ( "regexp" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/firewall/firewall_network_rule_collection_resource.go b/azurerm/internal/services/firewall/firewall_network_rule_collection_resource.go index 0b035623d9d4..3a5b60aac7d3 100644 --- a/azurerm/internal/services/firewall/firewall_network_rule_collection_resource.go +++ b/azurerm/internal/services/firewall/firewall_network_rule_collection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -124,10 +124,10 @@ func resourceFirewallNetworkRuleCollection() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.Any), - string(network.ICMP), - string(network.TCP), - string(network.UDP), + string(network.AzureFirewallNetworkRuleProtocolAny), + string(network.AzureFirewallNetworkRuleProtocolICMP), + string(network.AzureFirewallNetworkRuleProtocolTCP), + string(network.AzureFirewallNetworkRuleProtocolUDP), }, false), }, Set: pluginsdk.HashString, diff --git a/azurerm/internal/services/firewall/firewall_network_rule_collection_resource_test.go b/azurerm/internal/services/firewall/firewall_network_rule_collection_resource_test.go index d8179e0bd521..c2d3e4fc643d 100644 --- a/azurerm/internal/services/firewall/firewall_network_rule_collection_resource_test.go +++ b/azurerm/internal/services/firewall/firewall_network_rule_collection_resource_test.go @@ -6,7 +6,7 @@ import ( "regexp" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/firewall/firewall_policy_data_source_test.go b/azurerm/internal/services/firewall/firewall_policy_data_source_test.go index 0ea16c84d1a5..9dbea4aa6a9c 100644 --- a/azurerm/internal/services/firewall/firewall_policy_data_source_test.go +++ b/azurerm/internal/services/firewall/firewall_policy_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/location" diff --git a/azurerm/internal/services/firewall/firewall_policy_resource.go b/azurerm/internal/services/firewall/firewall_policy_resource.go index dffe71b354b9..a7547b37da26 100644 --- a/azurerm/internal/services/firewall/firewall_policy_resource.go +++ b/azurerm/internal/services/firewall/firewall_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/firewall/firewall_policy_rule_collection_group_resource.go b/azurerm/internal/services/firewall/firewall_policy_rule_collection_group_resource.go index fc24a612fbdb..f5f3cb7df728 100644 --- a/azurerm/internal/services/firewall/firewall_policy_rule_collection_group_resource.go +++ b/azurerm/internal/services/firewall/firewall_policy_rule_collection_group_resource.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" azValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" @@ -520,7 +520,7 @@ func expandFirewallPolicyRuleCollectionNat(input []interface{}) []network.BasicF for _, e := range input { rule := e.(map[string]interface{}) output := &network.FirewallPolicyNatRuleCollection{ - RuleCollectionType: network.RuleCollectionTypeFirewallPolicyNatRuleCollection, + RuleCollectionType: network.RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection, Name: utils.String(rule["name"].(string)), Priority: utils.Int32(int32(rule["priority"].(int))), Action: &network.FirewallPolicyNatRuleCollectionAction{ @@ -543,7 +543,7 @@ func expandFirewallPolicyFilterRuleCollection(input []interface{}, f func(input }, Name: utils.String(rule["name"].(string)), Priority: utils.Int32(int32(rule["priority"].(int))), - RuleCollectionType: network.RuleCollectionTypeFirewallPolicyFilterRuleCollection, + RuleCollectionType: network.RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection, Rules: f(rule["rule"].(*pluginsdk.Set).List()), } result = append(result, output) @@ -565,7 +565,7 @@ func expandFirewallPolicyRuleApplication(input []interface{}) *[]network.BasicFi } output := &network.ApplicationRule{ Name: utils.String(condition["name"].(string)), - RuleType: network.RuleTypeApplicationRule, + RuleType: network.RuleTypeRuleTypeApplicationRule, Protocols: &protocols, SourceAddresses: utils.ExpandStringSlice(condition["source_addresses"].(*pluginsdk.Set).List()), SourceIPGroups: utils.ExpandStringSlice(condition["source_ip_groups"].(*pluginsdk.Set).List()), @@ -587,7 +587,7 @@ func expandFirewallPolicyRuleNetwork(input []interface{}) *[]network.BasicFirewa } output := &network.Rule{ Name: utils.String(condition["name"].(string)), - RuleType: network.RuleTypeNetworkRule, + RuleType: network.RuleTypeRuleTypeNetworkRule, IPProtocols: &protocols, SourceAddresses: utils.ExpandStringSlice(condition["source_addresses"].(*pluginsdk.Set).List()), SourceIPGroups: utils.ExpandStringSlice(condition["source_ip_groups"].(*pluginsdk.Set).List()), @@ -612,7 +612,7 @@ func expandFirewallPolicyRuleNat(input []interface{}) *[]network.BasicFirewallPo destinationAddresses := []string{condition["destination_address"].(string)} output := &network.NatRule{ Name: utils.String(condition["name"].(string)), - RuleType: network.RuleTypeNatRule, + RuleType: network.RuleTypeRuleTypeNatRule, IPProtocols: &protocols, SourceAddresses: utils.ExpandStringSlice(condition["source_addresses"].(*pluginsdk.Set).List()), SourceIPGroups: utils.ExpandStringSlice(condition["source_ip_groups"].(*pluginsdk.Set).List()), diff --git a/azurerm/internal/services/firewall/firewall_resource.go b/azurerm/internal/services/firewall/firewall_resource.go index 991f6a64cb44..8e2e368c951e 100644 --- a/azurerm/internal/services/firewall/firewall_resource.go +++ b/azurerm/internal/services/firewall/firewall_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -58,8 +58,8 @@ func resourceFirewall() *pluginsdk.Resource { Computed: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.AZFWHub), - string(network.AZFWVNet), + string(network.AzureFirewallSkuNameAZFWHub), + string(network.AzureFirewallSkuNameAZFWVNet), }, false), }, @@ -70,8 +70,8 @@ func resourceFirewall() *pluginsdk.Resource { Computed: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Premium), - string(network.Standard), + string(network.AzureFirewallSkuTierPremium), + string(network.AzureFirewallSkuTierStandard), }, false), }, diff --git a/azurerm/internal/services/firewall/subresource.go b/azurerm/internal/services/firewall/subresource.go index fcfb8983ae10..0ddc32aab8de 100644 --- a/azurerm/internal/services/firewall/subresource.go +++ b/azurerm/internal/services/firewall/subresource.go @@ -1,7 +1,7 @@ package firewall import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" ) func flattenNetworkSubResourceID(input *[]network.SubResource) []interface{} { diff --git a/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource.go b/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource.go index 944e588335c6..7512dc0516c4 100644 --- a/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource.go +++ b/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/sdk" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loadbalancer/parse" diff --git a/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource_test.go b/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource_test.go index 8ab3921aeea5..1a106363f874 100644 --- a/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource_test.go +++ b/azurerm/internal/services/loadbalancer/backend_address_pool_address_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/types" diff --git a/azurerm/internal/services/loadbalancer/backend_address_pool_data_source.go b/azurerm/internal/services/loadbalancer/backend_address_pool_data_source.go index 6d99701abe37..186863582810 100644 --- a/azurerm/internal/services/loadbalancer/backend_address_pool_data_source.go +++ b/azurerm/internal/services/loadbalancer/backend_address_pool_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loadbalancer/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loadbalancer/validate" diff --git a/azurerm/internal/services/loadbalancer/backend_address_pool_resource.go b/azurerm/internal/services/loadbalancer/backend_address_pool_resource.go index 42853a0fa4a6..981a75dbe7aa 100644 --- a/azurerm/internal/services/loadbalancer/backend_address_pool_resource.go +++ b/azurerm/internal/services/loadbalancer/backend_address_pool_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/backend_address_pool_resource_test.go b/azurerm/internal/services/loadbalancer/backend_address_pool_resource_test.go index 59ae81c5f9ab..20cfaf57b40f 100644 --- a/azurerm/internal/services/loadbalancer/backend_address_pool_resource_test.go +++ b/azurerm/internal/services/loadbalancer/backend_address_pool_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/client/client.go b/azurerm/internal/services/loadbalancer/client/client.go index 33c4928ed899..46f620460aee 100644 --- a/azurerm/internal/services/loadbalancer/client/client.go +++ b/azurerm/internal/services/loadbalancer/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/loadbalancer/loadbalancer.go b/azurerm/internal/services/loadbalancer/loadbalancer.go index ce452229f594..861f1779e2a1 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer.go @@ -3,7 +3,7 @@ package loadbalancer import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loadbalancer/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_data_source.go b/azurerm/internal/services/loadbalancer/loadbalancer_data_source.go index c6a3227703ce..c494fdbba072 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_data_source.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_nat_pool_resource_test.go b/azurerm/internal/services/loadbalancer/loadbalancer_nat_pool_resource_test.go index 3fd18a6850ff..22b1df336e17 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_nat_pool_resource_test.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_nat_pool_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_nat_rule_resource_test.go b/azurerm/internal/services/loadbalancer/loadbalancer_nat_rule_resource_test.go index bba6581662c0..b4dbb01726ce 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_nat_rule_resource_test.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_nat_rule_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go b/azurerm/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go index 9f961410ea6f..bb477ccbeece 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_probe_resource_test.go b/azurerm/internal/services/loadbalancer/loadbalancer_probe_resource_test.go index bee315e7020d..05bd9bf12239 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_probe_resource_test.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_probe_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_resource.go b/azurerm/internal/services/loadbalancer/loadbalancer_resource.go index 2f9e76cc7919..c14d37c64435 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_resource.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -93,10 +93,10 @@ func resourceArmLoadBalancer() *pluginsdk.Resource { "private_ip_address_version": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.IPv4), + Default: string(network.IPVersionIPv4), ValidateFunc: validation.StringInSlice([]string{ - string(network.IPv4), - string(network.IPv6), + string(network.IPVersionIPv4), + string(network.IPVersionIPv6), }, false), }, @@ -119,8 +119,8 @@ func resourceArmLoadBalancer() *pluginsdk.Resource { Optional: true, Computed: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dynamic), - string(network.Static), + string(network.IPAllocationMethodDynamic), + string(network.IPAllocationMethodStatic), }, true), StateFunc: state.IgnoreCase, DiffSuppressFunc: suppress.CaseDifference, diff --git a/azurerm/internal/services/loadbalancer/loadbalancer_rule_resource_test.go b/azurerm/internal/services/loadbalancer/loadbalancer_rule_resource_test.go index 3e355c55cd05..aeff8614b025 100644 --- a/azurerm/internal/services/loadbalancer/loadbalancer_rule_resource_test.go +++ b/azurerm/internal/services/loadbalancer/loadbalancer_rule_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/nat_pool_resource.go b/azurerm/internal/services/loadbalancer/nat_pool_resource.go index 776e9ee44f80..0eb3798b34e7 100644 --- a/azurerm/internal/services/loadbalancer/nat_pool_resource.go +++ b/azurerm/internal/services/loadbalancer/nat_pool_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/loadbalancer/nat_rule_resource.go b/azurerm/internal/services/loadbalancer/nat_rule_resource.go index d6bf6ef51b58..9c76194738d5 100644 --- a/azurerm/internal/services/loadbalancer/nat_rule_resource.go +++ b/azurerm/internal/services/loadbalancer/nat_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/loadbalancer/outbound_rule_resource.go b/azurerm/internal/services/loadbalancer/outbound_rule_resource.go index 31c13a5480bd..213ec6a636e7 100644 --- a/azurerm/internal/services/loadbalancer/outbound_rule_resource.go +++ b/azurerm/internal/services/loadbalancer/outbound_rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/loadbalancer/probe_resource.go b/azurerm/internal/services/loadbalancer/probe_resource.go index ba3be1d92a0d..94dcb2895b9d 100644 --- a/azurerm/internal/services/loadbalancer/probe_resource.go +++ b/azurerm/internal/services/loadbalancer/probe_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/loadbalancer/rule_resource.go b/azurerm/internal/services/loadbalancer/rule_resource.go index 6c57ac373677..ead5946604fd 100644 --- a/azurerm/internal/services/loadbalancer/rule_resource.go +++ b/azurerm/internal/services/loadbalancer/rule_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/logic/integration_service_environment.go b/azurerm/internal/services/logic/integration_service_environment.go index 165c32f9ecc3..6a05b7bc74c6 100644 --- a/azurerm/internal/services/logic/integration_service_environment.go +++ b/azurerm/internal/services/logic/integration_service_environment.go @@ -9,7 +9,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/application_gateway_data_source.go b/azurerm/internal/services/network/application_gateway_data_source.go index ab57c40463a9..8ca0631adcbb 100644 --- a/azurerm/internal/services/network/application_gateway_data_source.go +++ b/azurerm/internal/services/network/application_gateway_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/identity" diff --git a/azurerm/internal/services/network/application_gateway_resource.go b/azurerm/internal/services/network/application_gateway_resource.go index b2d94ab0a6c5..6d703a9f3f0c 100644 --- a/azurerm/internal/services/network/application_gateway_resource.go +++ b/azurerm/internal/services/network/application_gateway_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" @@ -169,8 +169,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTTP), - string(network.HTTPS), + string(network.ProtocolHTTP), + string(network.ProtocolHTTPS), }, true), }, @@ -179,8 +179,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.Enabled), - string(network.Disabled), + string(network.ApplicationGatewayCookieBasedAffinityEnabled), + string(network.ApplicationGatewayCookieBasedAffinityDisabled), }, true), }, @@ -307,8 +307,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Computed: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dynamic), - string(network.Static), + string(network.IPAllocationMethodDynamic), + string(network.IPAllocationMethodStatic), }, true), }, @@ -394,8 +394,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTTP), - string(network.HTTPS), + string(network.ProtocolHTTP), + string(network.ProtocolHTTPS), }, true), }, @@ -451,8 +451,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTTPStatus403), - string(network.HTTPStatus502), + string(network.ApplicationGatewayCustomErrorStatusCodeHTTPStatus403), + string(network.ApplicationGatewayCustomErrorStatusCodeHTTPStatus502), }, false), }, @@ -493,8 +493,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Basic), - string(network.PathBasedRouting), + string(network.ApplicationGatewayRequestRoutingRuleTypeBasic), + string(network.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), }, false), }, @@ -583,10 +583,10 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Permanent), - string(network.Temporary), - string(network.Found), - string(network.SeeOther), + string(network.ApplicationGatewayRedirectTypePermanent), + string(network.ApplicationGatewayRedirectTypeTemporary), + string(network.ApplicationGatewayRedirectTypeFound), + string(network.ApplicationGatewayRedirectTypeSeeOther), }, false), }, @@ -656,13 +656,13 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.StandardSmall), - string(network.StandardMedium), - string(network.StandardLarge), - string(network.StandardV2), - string(network.WAFLarge), - string(network.WAFMedium), - string(network.WAFV2), + string(network.ApplicationGatewaySkuNameStandardSmall), + string(network.ApplicationGatewaySkuNameStandardMedium), + string(network.ApplicationGatewaySkuNameStandardLarge), + string(network.ApplicationGatewaySkuNameStandardV2), + string(network.ApplicationGatewaySkuNameWAFLarge), + string(network.ApplicationGatewaySkuNameWAFMedium), + string(network.ApplicationGatewaySkuNameWAFV2), }, true), }, @@ -759,9 +759,9 @@ func resourceApplicationGateway() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.TLSv10), - string(network.TLSv11), - string(network.TLSv12), + string(network.ApplicationGatewaySslProtocolTLSv10), + string(network.ApplicationGatewaySslProtocolTLSv11), + string(network.ApplicationGatewaySslProtocolTLSv12), }, false), }, }, @@ -770,8 +770,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Custom), - string(network.Predefined), + string(network.ApplicationGatewaySslPolicyTypeCustom), + string(network.ApplicationGatewaySslPolicyTypePredefined), }, false), }, @@ -793,9 +793,9 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.TLSv10), - string(network.TLSv11), - string(network.TLSv12), + string(network.ApplicationGatewaySslProtocolTLSv10), + string(network.ApplicationGatewaySslProtocolTLSv11), + string(network.ApplicationGatewaySslProtocolTLSv12), }, false), }, }, @@ -822,8 +822,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTTP), - string(network.HTTPS), + string(network.ProtocolHTTP), + string(network.ProtocolHTTPS), }, true), }, @@ -1218,8 +1218,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.Detection), - string(network.Prevention), + string(network.ApplicationGatewayFirewallModeDetection), + string(network.ApplicationGatewayFirewallModePrevention), }, true), }, @@ -1283,9 +1283,9 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.RequestArgNames), - string(network.RequestCookieNames), - string(network.RequestHeaderNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestCookieNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), }, false), }, @@ -1327,8 +1327,8 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTTPStatus403), - string(network.HTTPStatus502), + string(network.ApplicationGatewayCustomErrorStatusCodeHTTPStatus403), + string(network.ApplicationGatewayCustomErrorStatusCodeHTTPStatus502), }, false), }, @@ -1482,8 +1482,8 @@ func resourceApplicationGatewayCreateUpdate(d *pluginsdk.ResourceData, meta inte appGWSkuTier := d.Get("sku.0.tier").(string) wafFileUploadLimit := d.Get("waf_configuration.0.file_upload_limit_mb").(int) - if appGWSkuTier != string(network.WAFV2) && wafFileUploadLimit > 500 { - return fmt.Errorf("Only SKU `%s` allows `file_upload_limit_mb` to exceed 500MB", network.WAFV2) + if appGWSkuTier != string(network.ApplicationGatewayTierWAFV2) && wafFileUploadLimit > 500 { + return fmt.Errorf("Only SKU `%s` allows `file_upload_limit_mb` to exceed 500MB", network.ApplicationGatewayTierWAFV2) } if v, ok := d.GetOk("firewall_policy_id"); ok { @@ -2185,13 +2185,13 @@ func expandApplicationGatewaySslPolicy(d *pluginsdk.ResourceData) *network.Appli disabledSSLPolicies = append(disabledSSLPolicies, network.ApplicationGatewaySslProtocol(policy.(string))) } - if policyType == network.Predefined { + if policyType == network.ApplicationGatewaySslPolicyTypePredefined { policyName := network.ApplicationGatewaySslPolicyName(v["policy_name"].(string)) policy = network.ApplicationGatewaySslPolicy{ PolicyType: policyType, PolicyName: policyName, } - } else if policyType == network.Custom { + } else if policyType == network.ApplicationGatewaySslPolicyTypeCustom { minProtocolVersion := network.ApplicationGatewaySslProtocol(v["min_protocol_version"].(string)) cipherSuites := make([]network.ApplicationGatewaySslCipherSuite, 0) diff --git a/azurerm/internal/services/network/application_gateway_resource_test.go b/azurerm/internal/services/network/application_gateway_resource_test.go index 0804894c44c2..2126d536ebe7 100644 --- a/azurerm/internal/services/network/application_gateway_resource_test.go +++ b/azurerm/internal/services/network/application_gateway_resource_test.go @@ -9,7 +9,7 @@ import ( "regexp" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/application_security_group_resource.go b/azurerm/internal/services/network/application_security_group_resource.go index cc289bcebae2..3f84fd8c67d0 100644 --- a/azurerm/internal/services/network/application_security_group_resource.go +++ b/azurerm/internal/services/network/application_security_group_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/bastion_host_resource.go b/azurerm/internal/services/network/bastion_host_resource.go index d782392a196e..481cba9b2da4 100644 --- a/azurerm/internal/services/network/bastion_host_resource.go +++ b/azurerm/internal/services/network/bastion_host_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/client/client.go b/azurerm/internal/services/network/client/client.go index 9cef897bbac0..bd992ad716f4 100644 --- a/azurerm/internal/services/network/client/client.go +++ b/azurerm/internal/services/network/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/network/express_route_circuit_authorization_resource.go b/azurerm/internal/services/network/express_route_circuit_authorization_resource.go index 133284a9bf0a..58d4ef2d6110 100644 --- a/azurerm/internal/services/network/express_route_circuit_authorization_resource.go +++ b/azurerm/internal/services/network/express_route_circuit_authorization_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/express_route_circuit_data_source.go b/azurerm/internal/services/network/express_route_circuit_data_source.go index a3a952d159b6..dd1507e77eb8 100644 --- a/azurerm/internal/services/network/express_route_circuit_data_source.go +++ b/azurerm/internal/services/network/express_route_circuit_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" diff --git a/azurerm/internal/services/network/express_route_circuit_peering_resource.go b/azurerm/internal/services/network/express_route_circuit_peering_resource.go index 5c7083c55698..b361a549ac2f 100644 --- a/azurerm/internal/services/network/express_route_circuit_peering_resource.go +++ b/azurerm/internal/services/network/express_route_circuit_peering_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -41,9 +41,9 @@ func resourceExpressRouteCircuitPeering() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.AzurePrivatePeering), - string(network.AzurePublicPeering), - string(network.MicrosoftPeering), + string(network.ExpressRoutePeeringTypeAzurePrivatePeering), + string(network.ExpressRoutePeeringTypeAzurePublicPeering), + string(network.ExpressRoutePeeringTypeMicrosoftPeering), }, false), }, @@ -238,7 +238,7 @@ func resourceExpressRouteCircuitPeeringCreateUpdate(d *pluginsdk.ResourceData, m }, } - if strings.EqualFold(peeringType, string(network.MicrosoftPeering)) { + if strings.EqualFold(peeringType, string(network.ExpressRoutePeeringTypeMicrosoftPeering)) { peerings := d.Get("microsoft_peering_config").([]interface{}) if len(peerings) == 0 { return fmt.Errorf("`microsoft_peering_config` must be specified when `peering_type` is set to `MicrosoftPeering`") diff --git a/azurerm/internal/services/network/express_route_circuit_resource.go b/azurerm/internal/services/network/express_route_circuit_resource.go index a1a191125fac..33c5a97951c5 100644 --- a/azurerm/internal/services/network/express_route_circuit_resource.go +++ b/azurerm/internal/services/network/express_route_circuit_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -96,8 +96,8 @@ func resourceExpressRouteCircuit() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.MeteredData), - string(network.UnlimitedData), + string(network.ExpressRouteCircuitSkuFamilyMeteredData), + string(network.ExpressRouteCircuitSkuFamilyUnlimitedData), }, true), DiffSuppressFunc: suppress.CaseDifference, }, diff --git a/azurerm/internal/services/network/express_route_gateway_resource.go b/azurerm/internal/services/network/express_route_gateway_resource.go index 563ef9fb74a7..faa0e317b943 100644 --- a/azurerm/internal/services/network/express_route_gateway_resource.go +++ b/azurerm/internal/services/network/express_route_gateway_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/express_route_port_resource.go b/azurerm/internal/services/network/express_route_port_resource.go index 6a668e75b3a8..01a42ba6b1db 100644 --- a/azurerm/internal/services/network/express_route_port_resource.go +++ b/azurerm/internal/services/network/express_route_port_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -143,8 +143,8 @@ func resourceArmExpressRoutePort() *pluginsdk.Resource { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dot1Q), - string(network.QinQ), + string(network.ExpressRoutePortsEncapsulationDot1Q), + string(network.ExpressRoutePortsEncapsulationQinQ), }, false), }, diff --git a/azurerm/internal/services/network/ip_group_resource.go b/azurerm/internal/services/network/ip_group_resource.go index 5a2053bd7f63..c0dba1a3426c 100644 --- a/azurerm/internal/services/network/ip_group_resource.go +++ b/azurerm/internal/services/network/ip_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/local_network_gateway_resource.go b/azurerm/internal/services/network/local_network_gateway_resource.go index aeb2cc6ecb2c..1bd3f6533738 100644 --- a/azurerm/internal/services/network/local_network_gateway_resource.go +++ b/azurerm/internal/services/network/local_network_gateway_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/nat_gateway_public_ip_association_resource.go b/azurerm/internal/services/network/nat_gateway_public_ip_association_resource.go index 806432bf13c1..9349e633e42f 100644 --- a/azurerm/internal/services/network/nat_gateway_public_ip_association_resource.go +++ b/azurerm/internal/services/network/nat_gateway_public_ip_association_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" diff --git a/azurerm/internal/services/network/nat_gateway_public_ip_association_resource_test.go b/azurerm/internal/services/network/nat_gateway_public_ip_association_resource_test.go index cd2143590705..223c47effd31 100644 --- a/azurerm/internal/services/network/nat_gateway_public_ip_association_resource_test.go +++ b/azurerm/internal/services/network/nat_gateway_public_ip_association_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/nat_gateway_resource.go b/azurerm/internal/services/network/nat_gateway_resource.go index 9c4fbe42a1a2..0ed8d0122884 100644 --- a/azurerm/internal/services/network/nat_gateway_resource.go +++ b/azurerm/internal/services/network/nat_gateway_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -82,9 +82,9 @@ func resourceNatGateway() *pluginsdk.Resource { "sku_name": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.Standard), + Default: string(network.NatGatewaySkuNameStandard), ValidateFunc: validation.StringInSlice([]string{ - string(network.Standard), + string(network.NatGatewaySkuNameStandard), }, false), }, diff --git a/azurerm/internal/services/network/network_connection_monitor_resource.go b/azurerm/internal/services/network/network_connection_monitor_resource.go index 0b9cbb894511..a32fd3a78dd3 100644 --- a/azurerm/internal/services/network/network_connection_monitor_resource.go +++ b/azurerm/internal/services/network/network_connection_monitor_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -162,12 +162,12 @@ func resourceNetworkConnectionMonitor() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.AboveAverage), - string(network.Average), - string(network.BelowAverage), - string(network.Default), - string(network.Full), - string(network.Low), + string(network.CoverageLevelAboveAverage), + string(network.CoverageLevelAverage), + string(network.CoverageLevelBelowAverage), + string(network.CoverageLevelDefault), + string(network.CoverageLevelFull), + string(network.CoverageLevelLow), }, false), }, @@ -204,9 +204,9 @@ func resourceNetworkConnectionMonitor() *pluginsdk.Resource { "type": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.AgentAddress), + Default: string(network.ConnectionMonitorEndpointFilterItemTypeAgentAddress), ValidateFunc: validation.StringInSlice([]string{ - string(network.AgentAddress), + string(network.ConnectionMonitorEndpointFilterItemTypeAgentAddress), }, false), }, }, @@ -216,9 +216,9 @@ func resourceNetworkConnectionMonitor() *pluginsdk.Resource { "type": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.Include), + Default: string(network.ConnectionMonitorEndpointFilterTypeInclude), ValidateFunc: validation.StringInSlice([]string{ - string(network.Include), + string(network.ConnectionMonitorEndpointFilterTypeInclude), }, false), }, }, @@ -254,12 +254,12 @@ func resourceNetworkConnectionMonitor() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.AzureSubnet), - string(network.AzureVM), - string(network.AzureVNet), - string(network.ExternalAddress), - string(network.MMAWorkspaceMachine), - string(network.MMAWorkspaceNetwork), + string(network.EndpointTypeAzureSubnet), + string(network.EndpointTypeAzureVM), + string(network.EndpointTypeAzureVNet), + string(network.EndpointTypeExternalAddress), + string(network.EndpointTypeMMAWorkspaceMachine), + string(network.EndpointTypeMMAWorkspaceNetwork), }, false), }, @@ -304,10 +304,10 @@ func resourceNetworkConnectionMonitor() *pluginsdk.Resource { "method": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.Get), + Default: string(network.HTTPConfigurationMethodGet), ValidateFunc: validation.StringInSlice([]string{ - string(network.Get), - string(network.Post), + string(network.HTTPConfigurationMethodGet), + string(network.HTTPConfigurationMethodPost), }, false), }, @@ -595,7 +595,7 @@ func resourceNetworkConnectionMonitorRead(d *pluginsdk.ResourceData, meta interf return fmt.Errorf("Error reading Connection Monitor %q (Watcher %q / Resource Group %q) %+v", id.Name, id.NetworkWatcherName, id.ResourceGroup, err) } - if resp.ConnectionMonitorType == network.SingleSourceDestination { + if resp.ConnectionMonitorType == network.ConnectionMonitorTypeSingleSourceDestination { return fmt.Errorf("the resource created via API version 2019-06-01 or before (a.k.a v1) isn't compatible to this version of provider. Please migrate to v2 pluginsdk.") } @@ -898,7 +898,7 @@ func expandNetworkConnectionMonitorOutput(input []interface{}) *[]network.Connec for _, item := range input { result := network.ConnectionMonitorOutput{ - Type: network.Workspace, + Type: network.OutputTypeWorkspace, WorkspaceSettings: &network.ConnectionMonitorWorkspaceSettings{ WorkspaceResourceID: utils.String(item.(string)), }, diff --git a/azurerm/internal/services/network/network_ddos_protection_plan_resource.go b/azurerm/internal/services/network/network_ddos_protection_plan_resource.go index 18fcc8f76273..091d74193bfa 100644 --- a/azurerm/internal/services/network/network_ddos_protection_plan_resource.go +++ b/azurerm/internal/services/network/network_ddos_protection_plan_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_interface.go b/azurerm/internal/services/network/network_interface.go index e2366f2d6b4d..0316f2c368ce 100644 --- a/azurerm/internal/services/network/network_interface.go +++ b/azurerm/internal/services/network/network_interface.go @@ -1,7 +1,7 @@ package network import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -120,7 +120,7 @@ func mapFieldsToNetworkInterface(input *[]network.InterfaceIPConfiguration, info continue } - if config.InterfaceIPConfigurationPropertiesFormat.PrivateIPAddressVersion != network.IPv4 { + if config.InterfaceIPConfigurationPropertiesFormat.PrivateIPAddressVersion != network.IPVersionIPv4 { continue } diff --git a/azurerm/internal/services/network/network_interface_application_gateway_association_resource.go b/azurerm/internal/services/network/network_interface_application_gateway_association_resource.go index 999869de9aea..5b31071f1d5a 100644 --- a/azurerm/internal/services/network/network_interface_application_gateway_association_resource.go +++ b/azurerm/internal/services/network/network_interface_application_gateway_association_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_interface_application_gateway_association_resource_test.go b/azurerm/internal/services/network/network_interface_application_gateway_association_resource_test.go index 90b31f7a42b5..3b9e72f8d669 100644 --- a/azurerm/internal/services/network/network_interface_application_gateway_association_resource_test.go +++ b/azurerm/internal/services/network/network_interface_application_gateway_association_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/network/network_interface_application_security_group_association_resource_test.go b/azurerm/internal/services/network/network_interface_application_security_group_association_resource_test.go index 35a47a710ca3..0f13bad3056c 100644 --- a/azurerm/internal/services/network/network_interface_application_security_group_association_resource_test.go +++ b/azurerm/internal/services/network/network_interface_application_security_group_association_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go b/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go index 452566d654b4..d00b5535bc5d 100644 --- a/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go +++ b/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource_test.go b/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource_test.go index 6b3877eb834e..09a5db556f62 100644 --- a/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource_test.go +++ b/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/network/network_interface_helpers.go b/azurerm/internal/services/network/network_interface_helpers.go index c6a288a70c06..cfca268fb0b9 100644 --- a/azurerm/internal/services/network/network_interface_helpers.go +++ b/azurerm/internal/services/network/network_interface_helpers.go @@ -1,6 +1,6 @@ package network -import "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" +import "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" func FindNetworkInterfaceIPConfiguration(input *[]network.InterfaceIPConfiguration, name string) *network.InterfaceIPConfiguration { if input == nil { diff --git a/azurerm/internal/services/network/network_interface_locking.go b/azurerm/internal/services/network/network_interface_locking.go index b90f5d66405d..312ad99cf3bc 100644 --- a/azurerm/internal/services/network/network_interface_locking.go +++ b/azurerm/internal/services/network/network_interface_locking.go @@ -1,7 +1,7 @@ package network import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" diff --git a/azurerm/internal/services/network/network_interface_nat_rule_association_resource.go b/azurerm/internal/services/network/network_interface_nat_rule_association_resource.go index bb08c6fb8a6a..940b826f927a 100644 --- a/azurerm/internal/services/network/network_interface_nat_rule_association_resource.go +++ b/azurerm/internal/services/network/network_interface_nat_rule_association_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_interface_nat_rule_association_resource_test.go b/azurerm/internal/services/network/network_interface_nat_rule_association_resource_test.go index 555c62bc2ea9..69370f3ab7e0 100644 --- a/azurerm/internal/services/network/network_interface_nat_rule_association_resource_test.go +++ b/azurerm/internal/services/network/network_interface_nat_rule_association_resource_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" diff --git a/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go b/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go index 7a90a0e5082f..5ddc4a2c9637 100644 --- a/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go +++ b/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/azuresdkhacks" diff --git a/azurerm/internal/services/network/network_interface_resource.go b/azurerm/internal/services/network/network_interface_resource.go index 718c2356189d..8002becccd75 100644 --- a/azurerm/internal/services/network/network_interface_resource.go +++ b/azurerm/internal/services/network/network_interface_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -79,10 +79,10 @@ func resourceNetworkInterface() *pluginsdk.Resource { "private_ip_address_version": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.IPv4), + Default: string(network.IPVersionIPv4), ValidateFunc: validation.StringInSlice([]string{ - string(network.IPv4), - string(network.IPv6), + string(network.IPVersionIPv4), + string(network.IPVersionIPv6), }, false), }, @@ -90,8 +90,8 @@ func resourceNetworkInterface() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dynamic), - string(network.Static), + string(network.IPAllocationMethodDynamic), + string(network.IPAllocationMethodStatic), }, true), StateFunc: state.IgnoreCase, DiffSuppressFunc: suppress.CaseDifference, @@ -531,7 +531,7 @@ func expandNetworkInterfaceIPConfigurations(input []interface{}) (*[]network.Int PrivateIPAddressVersion: privateIpAddressVersion, } - if privateIpAddressVersion == network.IPv4 && subnetId == "" { + if privateIpAddressVersion == network.IPVersionIPv4 && subnetId == "" { return nil, fmt.Errorf("A Subnet ID must be specified for an IPv4 Network Interface.") } diff --git a/azurerm/internal/services/network/network_packet_capture_resource.go b/azurerm/internal/services/network/network_packet_capture_resource.go index 8965c2208276..63be815a1313 100644 --- a/azurerm/internal/services/network/network_packet_capture_resource.go +++ b/azurerm/internal/services/network/network_packet_capture_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/network_profile_resource.go b/azurerm/internal/services/network/network_profile_resource.go index a0e60e50a7c3..88ef3e36f2a5 100644 --- a/azurerm/internal/services/network/network_profile_resource.go +++ b/azurerm/internal/services/network/network_profile_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_security_group_resource.go b/azurerm/internal/services/network/network_security_group_resource.go index 45795ef40f2a..31012c3595c0 100644 --- a/azurerm/internal/services/network/network_security_group_resource.go +++ b/azurerm/internal/services/network/network_security_group_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" multierror "github.com/hashicorp/go-multierror" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/network_security_rule_resource.go b/azurerm/internal/services/network/network_security_rule_resource.go index afc31f94258f..d4d483faaeab 100644 --- a/azurerm/internal/services/network/network_security_rule_resource.go +++ b/azurerm/internal/services/network/network_security_rule_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_subresource.go b/azurerm/internal/services/network/network_subresource.go index 053a29fd9f71..e7ff1d5429a2 100644 --- a/azurerm/internal/services/network/network_subresource.go +++ b/azurerm/internal/services/network/network_subresource.go @@ -1,7 +1,7 @@ package network import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) diff --git a/azurerm/internal/services/network/network_watcher_flow_log_resource.go b/azurerm/internal/services/network/network_watcher_flow_log_resource.go index d3e4b624cb52..5a2a955559df 100644 --- a/azurerm/internal/services/network/network_watcher_flow_log_resource.go +++ b/azurerm/internal/services/network/network_watcher_flow_log_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_watcher_flow_log_resource_test.go b/azurerm/internal/services/network/network_watcher_flow_log_resource_test.go index 33c38ec6d025..6a931ff8b31a 100644 --- a/azurerm/internal/services/network/network_watcher_flow_log_resource_test.go +++ b/azurerm/internal/services/network/network_watcher_flow_log_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/network_watcher_resource.go b/azurerm/internal/services/network/network_watcher_resource.go index 810477440f33..0b2a8141302d 100644 --- a/azurerm/internal/services/network/network_watcher_resource.go +++ b/azurerm/internal/services/network/network_watcher_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/packet_capture_resource.go b/azurerm/internal/services/network/packet_capture_resource.go index 8602400192ab..6c01ddd3a4c0 100644 --- a/azurerm/internal/services/network/packet_capture_resource.go +++ b/azurerm/internal/services/network/packet_capture_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go b/azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go index 2d69d4308b89..87dfa4b318cc 100644 --- a/azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go +++ b/azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" diff --git a/azurerm/internal/services/network/private_endpoint_connection_data_source.go b/azurerm/internal/services/network/private_endpoint_connection_data_source.go index ed12630e4be2..1a7b4dc1436f 100644 --- a/azurerm/internal/services/network/private_endpoint_connection_data_source.go +++ b/azurerm/internal/services/network/private_endpoint_connection_data_source.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/validate" diff --git a/azurerm/internal/services/network/private_endpoint_resource.go b/azurerm/internal/services/network/private_endpoint_resource.go index 651d1b661ebf..8272d37fa664 100644 --- a/azurerm/internal/services/network/private_endpoint_resource.go +++ b/azurerm/internal/services/network/private_endpoint_resource.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/private_link_service_data_source.go b/azurerm/internal/services/network/private_link_service_data_source.go index 4e8e69f78ba7..179a94e2f21e 100644 --- a/azurerm/internal/services/network/private_link_service_data_source.go +++ b/azurerm/internal/services/network/private_link_service_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/validate" diff --git a/azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go b/azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go index f0ddf4a933cc..ab844cf6c741 100644 --- a/azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go +++ b/azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" diff --git a/azurerm/internal/services/network/private_link_service_resource.go b/azurerm/internal/services/network/private_link_service_resource.go index e3d9ecd437bf..6276afbaad2b 100644 --- a/azurerm/internal/services/network/private_link_service_resource.go +++ b/azurerm/internal/services/network/private_link_service_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -100,9 +100,9 @@ func resourcePrivateLinkService() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.IPv4), + string(network.IPVersionIPv4), }, false), - Default: string(network.IPv4), + Default: string(network.IPVersionIPv4), }, "subnet_id": { Type: pluginsdk.TypeString, @@ -348,9 +348,9 @@ func expandPrivateLinkServiceIPConfiguration(input []interface{}) *[]network.Pri } if privateIpAddress != "" { - result.PrivateLinkServiceIPConfigurationProperties.PrivateIPAllocationMethod = network.Static + result.PrivateLinkServiceIPConfigurationProperties.PrivateIPAllocationMethod = network.IPAllocationMethodStatic } else { - result.PrivateLinkServiceIPConfigurationProperties.PrivateIPAllocationMethod = network.Dynamic + result.PrivateLinkServiceIPConfigurationProperties.PrivateIPAllocationMethod = network.IPAllocationMethodDynamic } results = append(results, result) diff --git a/azurerm/internal/services/network/public_ip_prefix_resource.go b/azurerm/internal/services/network/public_ip_prefix_resource.go index 867778e459b8..9662b37e4909 100644 --- a/azurerm/internal/services/network/public_ip_prefix_resource.go +++ b/azurerm/internal/services/network/public_ip_prefix_resource.go @@ -5,10 +5,11 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/location" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" @@ -45,13 +46,31 @@ func resourcePublicIpPrefix() *pluginsdk.Resource { "resource_group_name": azure.SchemaResourceGroupName(), + "availability_zone": { + Type: pluginsdk.TypeString, + Optional: true, + //Default: "Zone-Redundant", + Computed: true, + ForceNew: true, + ConflictsWith: []string{ + "zones", + }, + ValidateFunc: validation.StringInSlice([]string{ + "No-Zone", + "1", + "2", + "3", + "Zone-Redundant", + }, false), + }, + "sku": { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - Default: string(network.Standard), + Default: string(network.PublicIPPrefixSkuNameStandard), ValidateFunc: validation.StringInSlice([]string{ - string(network.Standard), + string(network.PublicIPPrefixSkuNameStandard), }, false), }, @@ -68,7 +87,22 @@ func resourcePublicIpPrefix() *pluginsdk.Resource { Computed: true, }, - "zones": azure.SchemaSingleZone(), + // TODO - 3.0 make Computed only + "zones": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{ + "availability_zone", + }, + Deprecated: "This property has been deprecated in favour of `availability_zone` due to a breaking behavioural change in Azure: https://azure.microsoft.com/en-us/updates/zone-behavior-change/", + MaxItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, "tags": tags.Schema(), }, @@ -99,9 +133,28 @@ func resourcePublicIpPrefixCreateUpdate(d *pluginsdk.ResourceData, meta interfac location := azure.NormalizeLocation(d.Get("location").(string)) sku := d.Get("sku").(string) - prefix_length := d.Get("prefix_length").(int) + prefixLength := d.Get("prefix_length").(int) t := d.Get("tags").(map[string]interface{}) - zones := azure.ExpandZones(d.Get("zones").([]interface{})) + + zones := &[]string{"1", "2", "3"} + // TODO - Remove in 3.0 + if deprecatedZonesRaw, ok := d.GetOk("zones"); ok { + deprecatedZones := azure.ExpandZones(deprecatedZonesRaw.([]interface{})) + if deprecatedZones != nil { + zones = deprecatedZones + } + } + + if availabilityZones, ok := d.GetOk("availability_zone"); ok { + switch availabilityZones.(string) { + case "1", "2", "3": + zones = &[]string{availabilityZones.(string)} + case "Zone-Redundant": + zones = &[]string{"1", "2", "3"} + case "No-Zone": + zones = &[]string{} + } + } publicIpPrefix := network.PublicIPPrefix{ Location: &location, @@ -109,7 +162,7 @@ func resourcePublicIpPrefixCreateUpdate(d *pluginsdk.ResourceData, meta interfac Name: network.PublicIPPrefixSkuName(sku), }, PublicIPPrefixPropertiesFormat: &network.PublicIPPrefixPropertiesFormat{ - PrefixLength: utils.Int32(int32(prefix_length)), + PrefixLength: utils.Int32(int32(prefixLength)), }, Tags: tags.Expand(t), Zones: zones, @@ -151,11 +204,24 @@ func resourcePublicIpPrefixRead(d *pluginsdk.ResourceData, meta interface{}) err d.Set("name", id.PublicIPPrefixeName) d.Set("resource_group_name", id.ResourceGroup) - d.Set("zones", resp.Zones) - if location := resp.Location; location != nil { - d.Set("location", azure.NormalizeLocation(*location)) + + availabilityZones := "No-Zone" + zonesDeprecated := make([]string, 0) + if resp.Zones != nil { + if len(*resp.Zones) > 1 { + availabilityZones = "Zone-Redundant" + } + if len(*resp.Zones) == 1 { + zones := *resp.Zones + availabilityZones = zones[0] + zonesDeprecated = zones + } } + d.Set("availability_zone", availabilityZones) + d.Set("zones", zonesDeprecated) + d.Set("location", location.NormalizeNilable(resp.Location)) + if sku := resp.Sku; sku != nil { d.Set("sku", string(sku.Name)) } diff --git a/azurerm/internal/services/network/public_ip_prefix_resource_test.go b/azurerm/internal/services/network/public_ip_prefix_resource_test.go index af2ebc62e0e2..7cc6fa8a8edd 100644 --- a/azurerm/internal/services/network/public_ip_prefix_resource_test.go +++ b/azurerm/internal/services/network/public_ip_prefix_resource_test.go @@ -153,6 +153,39 @@ func TestAccPublicIpPrefix_disappears(t *testing.T) { }) } +func TestAccPublicIpPrefix_availabilityZoneRedundant(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") + r := PublicIPPrefixResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withAvailabilityZone(data, "Zone-Redundant"), + }, + }) +} + +func TestAccPublicIpPrefix_availabilityZoneSingle(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") + r := PublicIPPrefixResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withAvailabilityZone(data, "1"), + }, + }) +} + +func TestAccPublicIpPrefix_availabilityZoneSNoZone(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") + r := PublicIPPrefixResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withAvailabilityZone(data, "No-Zone"), + }, + }) +} + func (PublicIPPrefixResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -272,3 +305,23 @@ resource "azurerm_public_ip_prefix" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } + +func (PublicIPPrefixResource) withAvailabilityZone(data acceptance.TestData, availabilityZone string) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_public_ip_prefix" "test" { + name = "acctestpublicipprefix-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + availability_zone = "%s" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, availabilityZone) +} diff --git a/azurerm/internal/services/network/public_ip_resource.go b/azurerm/internal/services/network/public_ip_resource.go index fc347e7b918c..3e34365cdcd9 100644 --- a/azurerm/internal/services/network/public_ip_resource.go +++ b/azurerm/internal/services/network/public_ip_resource.go @@ -6,10 +6,11 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/location" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" @@ -55,20 +56,38 @@ func resourcePublicIp() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Static), - string(network.Dynamic), + string(network.IPAllocationMethodStatic), + string(network.IPAllocationMethodDynamic), + }, false), + }, + + "availability_zone": { + Type: pluginsdk.TypeString, + Optional: true, + //Default: "Zone-Redundant", + Computed: true, + ForceNew: true, + ConflictsWith: []string{ + "zones", + }, + ValidateFunc: validation.StringInSlice([]string{ + "No-Zone", + "1", + "2", + "3", + "Zone-Redundant", }, false), }, "ip_version": { Type: pluginsdk.TypeString, Optional: true, - Default: string(network.IPv4), + Default: string(network.IPVersionIPv4), ForceNew: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.IPv4), - string(network.IPv6), + string(network.IPVersionIPv4), + string(network.IPVersionIPv6), }, true), }, @@ -128,7 +147,22 @@ func resourcePublicIp() *pluginsdk.Resource { }, }, - "zones": azure.SchemaSingleZone(), + // TODO - 3.0 make Computed only + "zones": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{ + "availability_zone", + }, + Deprecated: "This property has been deprecated in favour of `availability_zone` due to a breaking behavioural change in Azure: https://azure.microsoft.com/en-us/updates/zone-behavior-change/", + MaxItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, "tags": tags.Schema(), }, @@ -143,26 +177,6 @@ func resourcePublicIpCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) e log.Printf("[INFO] preparing arguments for AzureRM Public IP creation.") - location := azure.NormalizeLocation(d.Get("location").(string)) - sku := d.Get("sku").(string) - t := d.Get("tags").(map[string]interface{}) - zones := azure.ExpandZones(d.Get("zones").([]interface{})) - idleTimeout := d.Get("idle_timeout_in_minutes").(int) - ipVersion := network.IPVersion(d.Get("ip_version").(string)) - ipAllocationMethod := d.Get("allocation_method").(string) - - if strings.EqualFold(sku, "basic") { - if zones != nil { - return fmt.Errorf("Basic SKU does not support Availability Zone scenarios. You need to use Standard SKU public IP for Availability Zone scenarios.") - } - } - - if strings.EqualFold(sku, "standard") { - if !strings.EqualFold(ipAllocationMethod, "static") { - return fmt.Errorf("Static IP allocation must be used when creating Standard SKU public IP addresses.") - } - } - id := parse.NewPublicIpAddressID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) if d.IsNewResource() { existing, err := client.Get(ctx, id.ResourceGroup, id.Name, "") @@ -177,6 +191,50 @@ func resourcePublicIpCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) e } } + location := azure.NormalizeLocation(d.Get("location").(string)) + sku := d.Get("sku").(string) + t := d.Get("tags").(map[string]interface{}) + // Default to Zone-Redundant - Legacy behaviour TODO - Switch to `No-Zone` in 3.0 to match service? + zones := &[]string{"1", "2", "3"} + zonesSet := false + // TODO - Remove in 3.0 + if deprecatedZonesRaw, ok := d.GetOk("zones"); ok { + zonesSet = true + deprecatedZones := azure.ExpandZones(deprecatedZonesRaw.([]interface{})) + if deprecatedZones != nil { + zones = deprecatedZones + } + } + + if availabilityZones, ok := d.GetOk("availability_zone"); ok { + zonesSet = true + switch availabilityZones.(string) { + case "1", "2", "3": + zones = &[]string{availabilityZones.(string)} + case "Zone-Redundant": + zones = &[]string{"1", "2", "3"} + case "No-Zone": + zones = &[]string{} + } + } + + if strings.EqualFold(sku, "Basic") { + if zonesSet && len(*zones) > 0 { + return fmt.Errorf("Availability Zones are not available on the `Basic` SKU") + } + zones = &[]string{} + } + + idleTimeout := d.Get("idle_timeout_in_minutes").(int) + ipVersion := network.IPVersion(d.Get("ip_version").(string)) + ipAllocationMethod := d.Get("allocation_method").(string) + + if strings.EqualFold(sku, "standard") { + if !strings.EqualFold(ipAllocationMethod, "static") { + return fmt.Errorf("Static IP allocation must be used when creating Standard SKU public IP addresses.") + } + } + publicIp := network.PublicIPAddress{ Name: utils.String(id.Name), Location: &location, @@ -267,11 +325,24 @@ func resourcePublicIpRead(d *pluginsdk.ResourceData, meta interface{}) error { d.Set("name", id.Name) d.Set("resource_group_name", id.ResourceGroup) - d.Set("zones", resp.Zones) - if location := resp.Location; location != nil { - d.Set("location", azure.NormalizeLocation(*location)) + + availabilityZones := "No-Zone" + zonesDeprecated := make([]string, 0) + if resp.Zones != nil { + if len(*resp.Zones) > 1 { + availabilityZones = "Zone-Redundant" + } + if len(*resp.Zones) == 1 { + zones := *resp.Zones + availabilityZones = zones[0] + zonesDeprecated = zones + } } + d.Set("availability_zone", availabilityZones) + d.Set("zones", zonesDeprecated) + d.Set("location", location.NormalizeNilable(resp.Location)) + if sku := resp.Sku; sku != nil { d.Set("sku", string(sku.Name)) } diff --git a/azurerm/internal/services/network/public_ip_resource_test.go b/azurerm/internal/services/network/public_ip_resource_test.go index 0b7c3b54ef3a..861293983e98 100644 --- a/azurerm/internal/services/network/public_ip_resource_test.go +++ b/azurerm/internal/services/network/public_ip_resource_test.go @@ -63,13 +63,52 @@ func TestAccPublicIpStatic_zones(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.withZone(data), + Config: r.withZone(data, "1"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("ip_address").Exists(), check.That(data.ResourceName).Key("allocation_method").HasValue("Static"), - check.That(data.ResourceName).Key("zones.#").HasValue("1"), - check.That(data.ResourceName).Key("zones.0").HasValue("1"), + check.That(data.ResourceName).Key("zones.#").HasValue("1"), // Deprecated - TODO remove in 3.0 + check.That(data.ResourceName).Key("zones.0").HasValue("1"), // Deprecated - TODO remove in 3.0 + check.That(data.ResourceName).Key("availability_zone").HasValue("1"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccPublicIpStatic_zonesNoZone(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_public_ip", "test") + r := PublicIPResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withZone(data, "No-Zone"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("ip_address").Exists(), + check.That(data.ResourceName).Key("allocation_method").HasValue("Static"), + check.That(data.ResourceName).Key("zones.#").HasValue("0"), // Deprecated - TODO remove in 3.0 + check.That(data.ResourceName).Key("availability_zone").HasValue("No-Zone"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccPublicIpStatic_zonesZoneRedundant(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_public_ip", "test") + r := PublicIPResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withZone(data, "Zone-Redundant"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("ip_address").Exists(), + check.That(data.ResourceName).Key("allocation_method").HasValue("Static"), + check.That(data.ResourceName).Key("zones.#").HasValue("0"), // Deprecated Note: Zero here due to legacy behaviour - TODO remove in 3.0 + check.That(data.ResourceName).Key("availability_zone").HasValue("Zone-Redundant"), ), }, data.ImportStep(), @@ -421,7 +460,7 @@ resource "azurerm_public_ip" "import" { `, r.static_basic(data)) } -func (PublicIPResource) withZone(data acceptance.TestData) string { +func (PublicIPResource) withZone(data acceptance.TestData, availabilityZone string) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -438,9 +477,9 @@ resource "azurerm_public_ip" "test" { resource_group_name = azurerm_resource_group.test.name allocation_method = "Static" sku = "Standard" - zones = ["1"] + availability_zone = "%s" } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, availabilityZone) } func (PublicIPResource) basic_withDNSLabel(data acceptance.TestData, dnsNameLabel string) string { @@ -771,9 +810,9 @@ resource "azurerm_public_ip" "test" { resource_group_name = azurerm_resource_group.test.name allocation_method = "Static" - domain_name_label = "k2345678-1-2345678-2-2345678-3-2345678-4-2345678-5-2345678-6-23" + domain_name_label = "%s" } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomStringOfLength(63)) } func (PublicIPResource) standard_IpTags(data acceptance.TestData) string { diff --git a/azurerm/internal/services/network/public_ips_data_source.go b/azurerm/internal/services/network/public_ips_data_source.go index 3a50d57f65f0..00942c8e1f51 100644 --- a/azurerm/internal/services/network/public_ips_data_source.go +++ b/azurerm/internal/services/network/public_ips_data_source.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" @@ -39,8 +39,8 @@ func dataSourcePublicIPs() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dynamic), - string(network.Static), + string(network.IPAllocationMethodDynamic), + string(network.IPAllocationMethodStatic), }, false), }, diff --git a/azurerm/internal/services/network/route_filter_data_source.go b/azurerm/internal/services/network/route_filter_data_source.go index 90d415d16d9b..a50bf1d9446d 100644 --- a/azurerm/internal/services/network/route_filter_data_source.go +++ b/azurerm/internal/services/network/route_filter_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/network/route_filter_resource.go b/azurerm/internal/services/network/route_filter_resource.go index 700a3a6d5e98..9108ed9ed398 100644 --- a/azurerm/internal/services/network/route_filter_resource.go +++ b/azurerm/internal/services/network/route_filter_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -66,7 +66,7 @@ func resourceRouteFilter() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Allow), + string(network.AccessAllow), }, false), }, diff --git a/azurerm/internal/services/network/route_resource.go b/azurerm/internal/services/network/route_resource.go index 1de28288d2df..e4f157095fe1 100644 --- a/azurerm/internal/services/network/route_resource.go +++ b/azurerm/internal/services/network/route_resource.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/route_table_data_source.go b/azurerm/internal/services/network/route_table_data_source.go index e7542a5e9dfe..d79a29bc2942 100644 --- a/azurerm/internal/services/network/route_table_data_source.go +++ b/azurerm/internal/services/network/route_table_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/network/route_table_resource.go b/azurerm/internal/services/network/route_table_resource.go index 77b96de73bb5..969fc0b0d39b 100644 --- a/azurerm/internal/services/network/route_table_resource.go +++ b/azurerm/internal/services/network/route_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/subnet_data_source.go b/azurerm/internal/services/network/subnet_data_source.go index 76b1bcffe9a7..10e90bd1c468 100644 --- a/azurerm/internal/services/network/subnet_data_source.go +++ b/azurerm/internal/services/network/subnet_data_source.go @@ -110,8 +110,8 @@ func dataSourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { d.Set("address_prefixes", utils.FlattenStringSlice(props.AddressPrefixes)) } - d.Set("enforce_private_link_endpoint_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateEndpointNetworkPolicies)) - d.Set("enforce_private_link_service_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateLinkServiceNetworkPolicies)) + d.Set("enforce_private_link_endpoint_network_policies", flattenSubnetPrivateLinkNetworkPolicy(string(props.PrivateEndpointNetworkPolicies))) + d.Set("enforce_private_link_service_network_policies", flattenSubnetPrivateLinkNetworkPolicy(string(props.PrivateLinkServiceNetworkPolicies))) networkSecurityGroupId := "" if props.NetworkSecurityGroup != nil && props.NetworkSecurityGroup.ID != nil { diff --git a/azurerm/internal/services/network/subnet_nat_gateway_association_resource.go b/azurerm/internal/services/network/subnet_nat_gateway_association_resource.go index b18e4c9e893d..3a83442a923d 100644 --- a/azurerm/internal/services/network/subnet_nat_gateway_association_resource.go +++ b/azurerm/internal/services/network/subnet_nat_gateway_association_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/subnet_network_security_group_association_resource.go b/azurerm/internal/services/network/subnet_network_security_group_association_resource.go index ed7d9dff4f14..337e54703b3d 100644 --- a/azurerm/internal/services/network/subnet_network_security_group_association_resource.go +++ b/azurerm/internal/services/network/subnet_network_security_group_association_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/subnet_resource.go b/azurerm/internal/services/network/subnet_resource.go index ef293b77f89a..5a2c68414af8 100644 --- a/azurerm/internal/services/network/subnet_resource.go +++ b/azurerm/internal/services/network/subnet_resource.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -221,8 +221,8 @@ func resourceSubnetCreate(d *pluginsdk.ResourceData, meta interface{}) error { // Network policies like network security groups are not supported by private endpoints. privateEndpointNetworkPolicies := d.Get("enforce_private_link_endpoint_network_policies").(bool) privateLinkServiceNetworkPolicies := d.Get("enforce_private_link_service_network_policies").(bool) - properties.PrivateEndpointNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(privateEndpointNetworkPolicies) - properties.PrivateLinkServiceNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(privateLinkServiceNetworkPolicies) + properties.PrivateEndpointNetworkPolicies = network.VirtualNetworkPrivateEndpointNetworkPolicies(expandSubnetPrivateLinkNetworkPolicy(privateEndpointNetworkPolicies)) + properties.PrivateLinkServiceNetworkPolicies = network.VirtualNetworkPrivateLinkServiceNetworkPolicies(expandSubnetPrivateLinkNetworkPolicy(privateLinkServiceNetworkPolicies)) serviceEndpointsRaw := d.Get("service_endpoints").([]interface{}) properties.ServiceEndpoints = expandSubnetServiceEndpoints(serviceEndpointsRaw) @@ -302,12 +302,12 @@ func resourceSubnetUpdate(d *pluginsdk.ResourceData, meta interface{}) error { if d.HasChange("enforce_private_link_endpoint_network_policies") { v := d.Get("enforce_private_link_endpoint_network_policies").(bool) - props.PrivateEndpointNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(v) + props.PrivateEndpointNetworkPolicies = network.VirtualNetworkPrivateEndpointNetworkPolicies(expandSubnetPrivateLinkNetworkPolicy(v)) } if d.HasChange("enforce_private_link_service_network_policies") { v := d.Get("enforce_private_link_service_network_policies").(bool) - props.PrivateLinkServiceNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(v) + props.PrivateLinkServiceNetworkPolicies = network.VirtualNetworkPrivateLinkServiceNetworkPolicies(expandSubnetPrivateLinkNetworkPolicy(v)) } if d.HasChange("service_endpoints") { @@ -377,8 +377,8 @@ func resourceSubnetRead(d *pluginsdk.ResourceData, meta interface{}) error { return fmt.Errorf("Error flattening `delegation`: %+v", err) } - d.Set("enforce_private_link_endpoint_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateEndpointNetworkPolicies)) - d.Set("enforce_private_link_service_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateLinkServiceNetworkPolicies)) + d.Set("enforce_private_link_endpoint_network_policies", flattenSubnetPrivateLinkNetworkPolicy(string(props.PrivateEndpointNetworkPolicies))) + d.Set("enforce_private_link_service_network_policies", flattenSubnetPrivateLinkNetworkPolicy(string(props.PrivateLinkServiceNetworkPolicies))) serviceEndpoints := flattenSubnetServiceEndpoints(props.ServiceEndpoints) if err := d.Set("service_endpoints", serviceEndpoints); err != nil { @@ -521,26 +521,22 @@ func flattenSubnetDelegation(delegations *[]network.Delegation) []interface{} { // TODO: confirm this logic below -func expandSubnetPrivateLinkNetworkPolicy(enabled bool) *string { +func expandSubnetPrivateLinkNetworkPolicy(enabled bool) string { // This is strange logic, but to get the schema to make sense for the end user // I exposed it with the same name that the Azure CLI does to be consistent // between the tool sets, which means true == Disabled. if enabled { - return utils.String("Disabled") + return "Disabled" } - return utils.String("Enabled") + return "Enabled" } -func flattenSubnetPrivateLinkNetworkPolicy(input *string) bool { +func flattenSubnetPrivateLinkNetworkPolicy(input string) bool { // This is strange logic, but to get the schema to make sense for the end user // I exposed it with the same name that the Azure CLI does to be consistent // between the tool sets, which means true == Disabled. - if input == nil { - return false - } - - return strings.EqualFold(*input, "Disabled") + return strings.EqualFold(input, "Disabled") } func expandSubnetServiceEndpointPolicies(input []interface{}) *[]network.ServiceEndpointPolicy { diff --git a/azurerm/internal/services/network/subnet_route_table_association_resource.go b/azurerm/internal/services/network/subnet_route_table_association_resource.go index cfae806f8cee..ee9f3bb2f297 100644 --- a/azurerm/internal/services/network/subnet_route_table_association_resource.go +++ b/azurerm/internal/services/network/subnet_route_table_association_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/subnet_service_endpoint_storage_policy_resource.go b/azurerm/internal/services/network/subnet_service_endpoint_storage_policy_resource.go index e3779cef97b9..927ea5bde6db 100644 --- a/azurerm/internal/services/network/subnet_service_endpoint_storage_policy_resource.go +++ b/azurerm/internal/services/network/subnet_service_endpoint_storage_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/virtual_hub_bgp_connection_resource.go b/azurerm/internal/services/network/virtual_hub_bgp_connection_resource.go index da7114d30e1b..70252e1e1b28 100644 --- a/azurerm/internal/services/network/virtual_hub_bgp_connection_resource.go +++ b/azurerm/internal/services/network/virtual_hub_bgp_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" diff --git a/azurerm/internal/services/network/virtual_hub_connection_resource.go b/azurerm/internal/services/network/virtual_hub_connection_resource.go index a42826ffe59a..1e8126fc7e28 100644 --- a/azurerm/internal/services/network/virtual_hub_connection_resource.go +++ b/azurerm/internal/services/network/virtual_hub_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" diff --git a/azurerm/internal/services/network/virtual_hub_ip_resource.go b/azurerm/internal/services/network/virtual_hub_ip_resource.go index d1c76ccb0626..792904ec8049 100644 --- a/azurerm/internal/services/network/virtual_hub_ip_resource.go +++ b/azurerm/internal/services/network/virtual_hub_ip_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" @@ -67,10 +67,10 @@ func resourceVirtualHubIP() *pluginsdk.Resource { "private_ip_allocation_method": { Type: pluginsdk.TypeString, Optional: true, - Default: network.Dynamic, + Default: network.IPAllocationMethodDynamic, ValidateFunc: validation.StringInSlice([]string{ - string(network.Dynamic), - string(network.Static), + string(network.IPAllocationMethodDynamic), + string(network.IPAllocationMethodStatic), }, false), }, diff --git a/azurerm/internal/services/network/virtual_hub_resource.go b/azurerm/internal/services/network/virtual_hub_resource.go index ee5505cff8b2..d03b7a740a06 100644 --- a/azurerm/internal/services/network/virtual_hub_resource.go +++ b/azurerm/internal/services/network/virtual_hub_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/virtual_hub_route_table_resource.go b/azurerm/internal/services/network/virtual_hub_route_table_resource.go index 119776026898..7c7b19da20f2 100644 --- a/azurerm/internal/services/network/virtual_hub_route_table_resource.go +++ b/azurerm/internal/services/network/virtual_hub_route_table_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/virtual_hub_security_partner_provider_resource.go b/azurerm/internal/services/network/virtual_hub_security_partner_provider_resource.go index ae44de4230d0..20de4a6e8761 100644 --- a/azurerm/internal/services/network/virtual_hub_security_partner_provider_resource.go +++ b/azurerm/internal/services/network/virtual_hub_security_partner_provider_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -54,9 +54,9 @@ func resourceVirtualHubSecurityPartnerProvider() *pluginsdk.Resource { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.ZScaler), - string(network.IBoss), - string(network.Checkpoint), + string(network.SecurityProviderNameZScaler), + string(network.SecurityProviderNameIBoss), + string(network.SecurityProviderNameCheckpoint), }, false), }, diff --git a/azurerm/internal/services/network/virtual_network_data_source.go b/azurerm/internal/services/network/virtual_network_data_source.go index 6414dbd7d5c8..6ad2b1a78aed 100644 --- a/azurerm/internal/services/network/virtual_network_data_source.go +++ b/azurerm/internal/services/network/virtual_network_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" diff --git a/azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go b/azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go index d5ce74b63a95..8c440f403bcc 100644 --- a/azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go +++ b/azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/network/virtual_network_gateway_connection_data_source_test.go b/azurerm/internal/services/network/virtual_network_gateway_connection_data_source_test.go index bebec1b646d8..f88bb7726fc4 100644 --- a/azurerm/internal/services/network/virtual_network_gateway_connection_data_source_test.go +++ b/azurerm/internal/services/network/virtual_network_gateway_connection_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" ) @@ -22,7 +22,7 @@ func TestAccDataSourceVirtualNetworkGatewayConnection_sitetosite(t *testing.T) { Config: r.sitetosite(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).Key("shared_key").HasValue(sharedKey), - check.That(data.ResourceName).Key("type").HasValue(string(network.IPsec)), + check.That(data.ResourceName).Key("type").HasValue(string(network.VirtualNetworkGatewayConnectionTypeIPsec)), ), }, }) @@ -41,8 +41,8 @@ func TestAccDataSourceVirtualNetworkGatewayConnection_vnettovnet(t *testing.T) { Check: acceptance.ComposeTestCheckFunc( acceptance.TestCheckResourceAttr(data1.ResourceName, "shared_key", sharedKey), acceptance.TestCheckResourceAttr(data2.ResourceName, "shared_key", sharedKey), - acceptance.TestCheckResourceAttr(data1.ResourceName, "type", string(network.Vnet2Vnet)), - acceptance.TestCheckResourceAttr(data2.ResourceName, "type", string(network.Vnet2Vnet)), + acceptance.TestCheckResourceAttr(data1.ResourceName, "type", string(network.VirtualNetworkGatewayConnectionTypeVnet2Vnet)), + acceptance.TestCheckResourceAttr(data2.ResourceName, "type", string(network.VirtualNetworkGatewayConnectionTypeVnet2Vnet)), ), }, }) @@ -58,10 +58,10 @@ func TestAccDataSourceVirtualNetworkGatewayConnection_ipsecpolicy(t *testing.T) Config: r.ipsecpolicy(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).Key("shared_key").HasValue(sharedKey), - check.That(data.ResourceName).Key("type").HasValue(string(network.IPsec)), + check.That(data.ResourceName).Key("type").HasValue(string(network.VirtualNetworkGatewayConnectionTypeIPsec)), check.That(data.ResourceName).Key("routing_weight").HasValue("20"), check.That(data.ResourceName).Key("ipsec_policy.0.dh_group").HasValue(string(network.DhGroupDHGroup14)), - check.That(data.ResourceName).Key("ipsec_policy.0.ike_encryption").HasValue(string(network.AES256)), + check.That(data.ResourceName).Key("ipsec_policy.0.ike_encryption").HasValue(string(network.IkeEncryptionAES256)), check.That(data.ResourceName).Key("ipsec_policy.0.ike_integrity").HasValue(string(network.IkeIntegritySHA256)), check.That(data.ResourceName).Key("ipsec_policy.0.ipsec_encryption").HasValue(string(network.IpsecEncryptionAES256)), check.That(data.ResourceName).Key("ipsec_policy.0.ipsec_integrity").HasValue(string(network.IpsecIntegritySHA256)), diff --git a/azurerm/internal/services/network/virtual_network_gateway_connection_resource.go b/azurerm/internal/services/network/virtual_network_gateway_connection_resource.go index 19eaeb13173d..9209308b3eee 100644 --- a/azurerm/internal/services/network/virtual_network_gateway_connection_resource.go +++ b/azurerm/internal/services/network/virtual_network_gateway_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -52,9 +52,9 @@ func resourceVirtualNetworkGatewayConnection() *pluginsdk.Resource { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.ExpressRoute), - string(network.IPsec), - string(network.Vnet2Vnet), + string(network.VirtualNetworkGatewayConnectionTypeExpressRoute), + string(network.VirtualNetworkGatewayConnectionTypeIPsec), + string(network.VirtualNetworkGatewayConnectionTypeVnet2Vnet), }, true), DiffSuppressFunc: suppress.CaseDifference, }, @@ -142,8 +142,8 @@ func resourceVirtualNetworkGatewayConnection() *pluginsdk.Resource { Computed: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.IKEv1), - string(network.IKEv2), + string(network.VirtualNetworkGatewayConnectionProtocolIKEv1), + string(network.VirtualNetworkGatewayConnectionProtocolIKEv2), }, false), }, @@ -198,13 +198,13 @@ func resourceVirtualNetworkGatewayConnection() *pluginsdk.Resource { Required: true, DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.AES128), - string(network.AES192), - string(network.AES256), - string(network.DES), - string(network.DES3), - string(network.GCMAES128), - string(network.GCMAES256), + string(network.IkeEncryptionAES128), + string(network.IkeEncryptionAES192), + string(network.IkeEncryptionAES256), + string(network.IkeEncryptionDES), + string(network.IkeEncryptionDES3), + string(network.IkeEncryptionGCMAES128), + string(network.IkeEncryptionGCMAES256), }, true), }, @@ -582,19 +582,19 @@ func getVirtualNetworkGatewayConnectionProperties(d *pluginsdk.ResourceData) (*n props.IpsecPolicies = expandVirtualNetworkGatewayConnectionIpsecPolicies(v.([]interface{})) } - if props.ConnectionType == network.ExpressRoute { + if props.ConnectionType == network.VirtualNetworkGatewayConnectionTypeExpressRoute { if props.Peer == nil || props.Peer.ID == nil { return nil, fmt.Errorf("`express_route_circuit_id` must be specified when `type` is set to `ExpressRoute`") } } - if props.ConnectionType == network.IPsec { + if props.ConnectionType == network.VirtualNetworkGatewayConnectionTypeIPsec { if props.LocalNetworkGateway2 == nil || props.LocalNetworkGateway2.ID == nil { return nil, fmt.Errorf("`local_network_gateway_id` must be specified when `type` is set to `IPsec`") } } - if props.ConnectionType == network.Vnet2Vnet { + if props.ConnectionType == network.VirtualNetworkGatewayConnectionTypeVnet2Vnet { if props.VirtualNetworkGateway2 == nil || props.VirtualNetworkGateway2.ID == nil { return nil, fmt.Errorf("`peer_virtual_network_gateway_id` must be specified when `type` is set to `Vnet2Vnet`") } diff --git a/azurerm/internal/services/network/virtual_network_gateway_data_source.go b/azurerm/internal/services/network/virtual_network_gateway_data_source.go index 019acb26c09f..9b6a369edae4 100644 --- a/azurerm/internal/services/network/virtual_network_gateway_data_source.go +++ b/azurerm/internal/services/network/virtual_network_gateway_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/network/virtual_network_gateway_resource.go b/azurerm/internal/services/network/virtual_network_gateway_resource.go index 2c9c98d4c218..cdabdf65742b 100644 --- a/azurerm/internal/services/network/virtual_network_gateway_resource.go +++ b/azurerm/internal/services/network/virtual_network_gateway_resource.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -66,11 +66,11 @@ func resourceVirtualNetworkGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - Default: string(network.RouteBased), + Default: string(network.VpnTypeRouteBased), DiffSuppressFunc: suppress.CaseDifference, ValidateFunc: validation.StringInSlice([]string{ - string(network.RouteBased), - string(network.PolicyBased), + string(network.VpnTypeRouteBased), + string(network.VpnTypePolicyBased), }, true), }, @@ -139,10 +139,10 @@ func resourceVirtualNetworkGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Static), - string(network.Dynamic), + string(network.IPAllocationMethodStatic), + string(network.IPAllocationMethodDynamic), }, false), - Default: string(network.Dynamic), + Default: string(network.IPAllocationMethodDynamic), }, "subnet_id": { @@ -289,9 +289,9 @@ func resourceVirtualNetworkGateway() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.IkeV2), - string(network.OpenVPN), - string(network.SSTP), + string(network.VpnClientProtocolIkeV2), + string(network.VpnClientProtocolOpenVPN), + string(network.VpnClientProtocolSSTP), }, true), }, }, @@ -596,21 +596,21 @@ func getVirtualNetworkGatewayProperties(id parse.VirtualNetworkGatewayId, d *plu } // Sku validation for policy-based VPN gateways - if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.PolicyBased { + if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.VpnTypePolicyBased { if ok, err := evaluateSchemaValidateFunc(string(props.Sku.Name), "sku", validateVirtualNetworkGatewayPolicyBasedVpnSku()); !ok { return nil, err } } // Sku validation for route-based VPN gateways of first geneneration - if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.RouteBased && props.VpnGatewayGeneration == network.VpnGatewayGenerationGeneration1 { + if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.VpnTypeRouteBased && props.VpnGatewayGeneration == network.VpnGatewayGenerationGeneration1 { if ok, err := evaluateSchemaValidateFunc(string(props.Sku.Name), "sku", validateVirtualNetworkGatewayRouteBasedVpnSkuGeneration1()); !ok { return nil, err } } // Sku validation for route-based VPN gateways of second geneneration - if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.RouteBased && props.VpnGatewayGeneration == network.VpnGatewayGenerationGeneration2 { + if props.GatewayType == network.VirtualNetworkGatewayTypeVpn && props.VpnType == network.VpnTypeRouteBased && props.VpnGatewayGeneration == network.VpnGatewayGenerationGeneration2 { if ok, err := evaluateSchemaValidateFunc(string(props.Sku.Name), "sku", validateVirtualNetworkGatewayRouteBasedVpnSkuGeneration2()); !ok { return nil, err } diff --git a/azurerm/internal/services/network/virtual_network_peering_resource.go b/azurerm/internal/services/network/virtual_network_peering_resource.go index b7a1083269ff..c96ef2f401d3 100644 --- a/azurerm/internal/services/network/virtual_network_peering_resource.go +++ b/azurerm/internal/services/network/virtual_network_peering_resource.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/virtual_network_resource.go b/azurerm/internal/services/network/virtual_network_resource.go index 1264e6c4c38a..dcfcf00a9de8 100644 --- a/azurerm/internal/services/network/virtual_network_resource.go +++ b/azurerm/internal/services/network/virtual_network_resource.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" diff --git a/azurerm/internal/services/network/virtual_wan_data_source.go b/azurerm/internal/services/network/virtual_wan_data_source.go index 21d57b25c835..401f45e93193 100644 --- a/azurerm/internal/services/network/virtual_wan_data_source.go +++ b/azurerm/internal/services/network/virtual_wan_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" diff --git a/azurerm/internal/services/network/virtual_wan_resource.go b/azurerm/internal/services/network/virtual_wan_resource.go index 9fd1413c0abe..e728e02eaa56 100644 --- a/azurerm/internal/services/network/virtual_wan_resource.go +++ b/azurerm/internal/services/network/virtual_wan_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/vpn_gateway_connection_resource.go b/azurerm/internal/services/network/vpn_gateway_connection_resource.go index 3787b6e33b9b..3fcb00e10dfc 100644 --- a/azurerm/internal/services/network/vpn_gateway_connection_resource.go +++ b/azurerm/internal/services/network/vpn_gateway_connection_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -120,10 +120,10 @@ func resourceVPNGatewayConnection() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.IKEv1), - string(network.IKEv2), + string(network.VirtualNetworkGatewayConnectionProtocolIKEv1), + string(network.VirtualNetworkGatewayConnectionProtocolIKEv2), }, false), - Default: string(network.IKEv2), + Default: string(network.VirtualNetworkGatewayConnectionProtocolIKEv2), }, "bandwidth_mbps": { @@ -194,13 +194,13 @@ func resourceVPNGatewayConnection() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.DES), - string(network.DES3), - string(network.AES128), - string(network.AES192), - string(network.AES256), - string(network.GCMAES128), - string(network.GCMAES256), + string(network.IkeEncryptionDES), + string(network.IkeEncryptionDES3), + string(network.IkeEncryptionAES128), + string(network.IkeEncryptionAES192), + string(network.IkeEncryptionAES256), + string(network.IkeEncryptionGCMAES128), + string(network.IkeEncryptionGCMAES256), }, false), }, diff --git a/azurerm/internal/services/network/vpn_gateway_resource.go b/azurerm/internal/services/network/vpn_gateway_resource.go index 733e25c127a0..5c2c1503ed33 100644 --- a/azurerm/internal/services/network/vpn_gateway_resource.go +++ b/azurerm/internal/services/network/vpn_gateway_resource.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -497,10 +497,10 @@ func vpnGatewayWaitForCreatedRefreshFunc(ctx context.Context, client *network.Vp log.Printf("[DEBUG] VPN Gateway %q (Resource Group %q) is %q..", name, resourceGroup, string(resp.VpnGatewayProperties.ProvisioningState)) switch resp.VpnGatewayProperties.ProvisioningState { - case network.Succeeded: + case network.ProvisioningStateSucceeded: return "available", "available", nil - case network.Failed: + case network.ProvisioningStateFailed: return "error", "error", fmt.Errorf("VPN Gateway %q (Resource Group %q) is in provisioningState `Failed`", name, resourceGroup) default: diff --git a/azurerm/internal/services/network/vpn_server_configuration_resource.go b/azurerm/internal/services/network/vpn_server_configuration_resource.go index caf18a6c7fdb..b50206b9cedb 100644 --- a/azurerm/internal/services/network/vpn_server_configuration_resource.go +++ b/azurerm/internal/services/network/vpn_server_configuration_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -51,9 +51,9 @@ func resourceVPNServerConfiguration() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.AAD), - string(network.Certificate), - string(network.Radius), + string(network.VpnAuthenticationTypeAAD), + string(network.VpnAuthenticationTypeCertificate), + string(network.VpnAuthenticationTypeRadius), }, false), }, @@ -149,13 +149,13 @@ func resourceVPNServerConfiguration() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.AES128), - string(network.AES192), - string(network.AES256), - string(network.DES), - string(network.DES3), - string(network.GCMAES128), - string(network.GCMAES256), + string(network.IkeEncryptionAES128), + string(network.IkeEncryptionAES192), + string(network.IkeEncryptionAES256), + string(network.IkeEncryptionDES), + string(network.IkeEncryptionDES3), + string(network.IkeEncryptionGCMAES128), + string(network.IkeEncryptionGCMAES256), }, false), }, @@ -437,13 +437,13 @@ func resourceVPNServerConfigurationCreateUpdate(d *pluginsdk.ResourceData, meta authType := network.VpnAuthenticationType(v.(string)) switch authType { - case network.AAD: + case network.VpnAuthenticationTypeAAD: supportsAAD = true - case network.Certificate: + case network.VpnAuthenticationTypeCertificate: supportsCertificates = true - case network.Radius: + case network.VpnAuthenticationTypeRadius: supportsRadius = true default: diff --git a/azurerm/internal/services/network/vpn_site_resource.go b/azurerm/internal/services/network/vpn_site_resource.go index 43c2f07b4cc1..4a71e2c2f551 100644 --- a/azurerm/internal/services/network/vpn_site_resource.go +++ b/azurerm/internal/services/network/vpn_site_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" diff --git a/azurerm/internal/services/network/web_application_firewall_policy_resource.go b/azurerm/internal/services/network/web_application_firewall_policy_resource.go index 330276a4c376..4f26a969430a 100644 --- a/azurerm/internal/services/network/web_application_firewall_policy_resource.go +++ b/azurerm/internal/services/network/web_application_firewall_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -82,14 +82,14 @@ func resourceWebApplicationFirewallPolicy() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.RemoteAddr), - string(network.RequestMethod), - string(network.QueryString), - string(network.PostArgs), - string(network.RequestURI), - string(network.RequestHeaders), - string(network.RequestBody), - string(network.RequestCookies), + string(network.WebApplicationFirewallMatchVariableRemoteAddr), + string(network.WebApplicationFirewallMatchVariableRequestMethod), + string(network.WebApplicationFirewallMatchVariableQueryString), + string(network.WebApplicationFirewallMatchVariablePostArgs), + string(network.WebApplicationFirewallMatchVariableRequestURI), + string(network.WebApplicationFirewallMatchVariableRequestHeaders), + string(network.WebApplicationFirewallMatchVariableRequestBody), + string(network.WebApplicationFirewallMatchVariableRequestCookies), }, false), }, "selector": { @@ -126,12 +126,12 @@ func resourceWebApplicationFirewallPolicy() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - string(network.HTMLEntityDecode), - string(network.Lowercase), - string(network.RemoveNulls), - string(network.Trim), - string(network.URLDecode), - string(network.URLEncode), + string(network.WebApplicationFirewallTransformHTMLEntityDecode), + string(network.WebApplicationFirewallTransformLowercase), + string(network.WebApplicationFirewallTransformRemoveNulls), + string(network.WebApplicationFirewallTransformTrim), + string(network.WebApplicationFirewallTransformURLDecode), + string(network.WebApplicationFirewallTransformURLEncode), }, false), }, }, @@ -173,9 +173,9 @@ func resourceWebApplicationFirewallPolicy() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.RequestArgNames), - string(network.RequestCookieNames), - string(network.RequestHeaderNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestArgNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestCookieNames), + string(network.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), }, false), }, "selector": { @@ -255,10 +255,10 @@ func resourceWebApplicationFirewallPolicy() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(network.Prevention), - string(network.Detection), + string(network.WebApplicationFirewallModePrevention), + string(network.WebApplicationFirewallModeDetection), }, false), - Default: string(network.Prevention), + Default: string(network.WebApplicationFirewallModePrevention), }, "request_body_check": { Type: pluginsdk.TypeBool, diff --git a/azurerm/internal/services/resource/client/client.go b/azurerm/internal/services/resource/client/client.go index e4bbcf54d77b..93b6411c8836 100644 --- a/azurerm/internal/services/resource/client/client.go +++ b/azurerm/internal/services/resource/client/client.go @@ -13,6 +13,7 @@ type Client struct { GroupsClient *resources.GroupsClient LocksClient *locks.ManagementLocksClient ProvidersClient *providers.ProvidersClient + ResourceProvidersClient *resources.ProvidersClient ResourcesClient *resources.Client TemplateSpecsVersionsClient *templatespecs.VersionsClient } @@ -31,6 +32,10 @@ func NewClient(o *common.ClientOptions) *Client { providersClient := providers.NewProvidersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&providersClient.Client, o.ResourceManagerAuthorizer) + // add a secondary ProvidersClient to use latest resources sdk + resourceProvidersClient := resources.NewProvidersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&resourceProvidersClient.Client, o.ResourceManagerAuthorizer) + resourcesClient := resources.NewClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&resourcesClient.Client, o.ResourceManagerAuthorizer) @@ -42,6 +47,7 @@ func NewClient(o *common.ClientOptions) *Client { DeploymentsClient: &deploymentsClient, LocksClient: &locksClient, ProvidersClient: &providersClient, + ResourceProvidersClient: &resourceProvidersClient, ResourcesClient: &resourcesClient, TemplateSpecsVersionsClient: &templatespecsVersionsClient, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/_meta.json deleted file mode 100644 index 33d3407aa648..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "tag": "package-2020-05", - "use": "@microsoft.azure/autorest.go@2.1.180", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2020-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivatelinkresources.go deleted file mode 100644 index 7e46f39e6b21..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivatelinkresources.go +++ /dev/null @@ -1,151 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayPrivateLinkResourcesClient is the network Client -type ApplicationGatewayPrivateLinkResourcesClient struct { - BaseClient -} - -// NewApplicationGatewayPrivateLinkResourcesClient creates an instance of the -// ApplicationGatewayPrivateLinkResourcesClient client. -func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient { - return NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI creates an instance of the -// ApplicationGatewayPrivateLinkResourcesClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient { - return ApplicationGatewayPrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all private link resources on an application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewayPrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List") - defer func() { - sc := -1 - if result.agplrlr.Response.Response != nil { - sc = result.agplrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.agplrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure sending request") - return - } - - result.agplrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure responding to request") - return - } - if result.agplrlr.hasNextLink() && result.agplrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListResponder(resp *http.Response) (result ApplicationGatewayPrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewayPrivateLinkResourcesClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayPrivateLinkResourceListResult) (result ApplicationGatewayPrivateLinkResourceListResult, err error) { - req, err := lastResults.applicationGatewayPrivateLinkResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, applicationGatewayName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewallfqdntags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewallfqdntags.go deleted file mode 100644 index a618bad833c7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewallfqdntags.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AzureFirewallFqdnTagsClient is the network Client -type AzureFirewallFqdnTagsClient struct { - BaseClient -} - -// NewAzureFirewallFqdnTagsClient creates an instance of the AzureFirewallFqdnTagsClient client. -func NewAzureFirewallFqdnTagsClient(subscriptionID string) AzureFirewallFqdnTagsClient { - return NewAzureFirewallFqdnTagsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAzureFirewallFqdnTagsClientWithBaseURI creates an instance of the AzureFirewallFqdnTagsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewAzureFirewallFqdnTagsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallFqdnTagsClient { - return AzureFirewallFqdnTagsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListAll gets all the Azure Firewall FQDN Tags in a subscription. -func (client AzureFirewallFqdnTagsClient) ListAll(ctx context.Context) (result AzureFirewallFqdnTagListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagsClient.ListAll") - defer func() { - sc := -1 - if result.afftlr.Response.Response != nil { - sc = result.afftlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.afftlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure sending request") - return - } - - result.afftlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.afftlr.hasNextLink() && result.afftlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client AzureFirewallFqdnTagsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallFqdnTagsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client AzureFirewallFqdnTagsClient) ListAllResponder(resp *http.Response) (result AzureFirewallFqdnTagListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client AzureFirewallFqdnTagsClient) listAllNextResults(ctx context.Context, lastResults AzureFirewallFqdnTagListResult) (result AzureFirewallFqdnTagListResult, err error) { - req, err := lastResults.azureFirewallFqdnTagListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallFqdnTagsClient) ListAllComplete(ctx context.Context) (result AzureFirewallFqdnTagListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewalls.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewalls.go deleted file mode 100644 index 6cf9c33de5bb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/azurefirewalls.go +++ /dev/null @@ -1,584 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AzureFirewallsClient is the network Client -type AzureFirewallsClient struct { - BaseClient -} - -// NewAzureFirewallsClient creates an instance of the AzureFirewallsClient client. -func NewAzureFirewallsClient(subscriptionID string) AzureFirewallsClient { - return NewAzureFirewallsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAzureFirewallsClientWithBaseURI creates an instance of the AzureFirewallsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAzureFirewallsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallsClient { - return AzureFirewallsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -// parameters - parameters supplied to the create or update Azure Firewall operation. -func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (result AzureFirewallsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: azureFirewallName, - Constraints: []validation.Constraint{{Target: "azureFirewallName", Name: validation.MaxLength, Rule: 56, Chain: nil}, - {Target: "azureFirewallName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.AzureFirewallsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, azureFirewallName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (future AzureFirewallsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, azureFirewallName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future AzureFirewallsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -func (client AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewall, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, azureFirewallName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Azure Firewalls in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") - defer func() { - sc := -1 - if result.aflr.Response.Response != nil { - sc = result.aflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure sending request") - return - } - - result.aflr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") - return - } - if result.aflr.hasNextLink() && result.aflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AzureFirewallsClient) listNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { - req, err := lastResults.azureFirewallListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Azure Firewalls in a subscription. -func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFirewallListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") - defer func() { - sc := -1 - if result.aflr.Response.Response != nil { - sc = result.aflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.aflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure sending request") - return - } - - result.aflr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.aflr.hasNextLink() && result.aflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client AzureFirewallsClient) listAllNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { - req, err := lastResults.azureFirewallListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallsClient) ListAllComplete(ctx context.Context) (result AzureFirewallListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates tags of an Azure Firewall resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -// parameters - parameters supplied to update azure firewall tags. -func (client AzureFirewallsClient) UpdateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject) (result AzureFirewallsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, azureFirewallName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", nil, "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) UpdateTagsSender(req *http.Request) (future AzureFirewallsUpdateTagsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) UpdateTagsResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bastionhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bastionhosts.go deleted file mode 100644 index cc134747fd84..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bastionhosts.go +++ /dev/null @@ -1,495 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BastionHostsClient is the network Client -type BastionHostsClient struct { - BaseClient -} - -// NewBastionHostsClient creates an instance of the BastionHostsClient client. -func NewBastionHostsClient(subscriptionID string) BastionHostsClient { - return NewBastionHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBastionHostsClientWithBaseURI creates an instance of the BastionHostsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBastionHostsClientWithBaseURI(baseURI string, subscriptionID string) BastionHostsClient { - return BastionHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// parameters - parameters supplied to the create or update Bastion Host operation. -func (client BastionHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost) (result BastionHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, bastionHostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BastionHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) CreateOrUpdateSender(req *http.Request) (future BastionHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) CreateOrUpdateResponder(resp *http.Response) (result BastionHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BastionHostsClient) Delete(ctx context.Context, resourceGroupName string, bastionHostName string) (result BastionHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BastionHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) DeleteSender(req *http.Request) (future BastionHostsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BastionHostsClient) Get(ctx context.Context, resourceGroupName string, bastionHostName string) (result BastionHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client BastionHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) GetResponder(resp *http.Response) (result BastionHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Bastion Hosts in a subscription. -func (client BastionHostsClient) List(ctx context.Context) (result BastionHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.List") - defer func() { - sc := -1 - if result.bhlr.Response.Response != nil { - sc = result.bhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.bhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", resp, "Failure sending request") - return - } - - result.bhlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", resp, "Failure responding to request") - return - } - if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BastionHostsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) ListResponder(resp *http.Response) (result BastionHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client BastionHostsClient) listNextResults(ctx context.Context, lastResults BastionHostListResult) (result BastionHostListResult, err error) { - req, err := lastResults.bastionHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BastionHostsClient) ListComplete(ctx context.Context) (result BastionHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Bastion Hosts in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client BastionHostsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result BastionHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.bhlr.Response.Response != nil { - sc = result.bhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.bhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.bhlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client BastionHostsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) ListByResourceGroupResponder(resp *http.Response) (result BastionHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client BastionHostsClient) listByResourceGroupNextResults(ctx context.Context, lastResults BastionHostListResult) (result BastionHostListResult, err error) { - req, err := lastResults.bastionHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client BastionHostsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result BastionHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bgpservicecommunities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bgpservicecommunities.go deleted file mode 100644 index e66969b06cbd..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/bgpservicecommunities.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BgpServiceCommunitiesClient is the network Client -type BgpServiceCommunitiesClient struct { - BaseClient -} - -// NewBgpServiceCommunitiesClient creates an instance of the BgpServiceCommunitiesClient client. -func NewBgpServiceCommunitiesClient(subscriptionID string) BgpServiceCommunitiesClient { - return NewBgpServiceCommunitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the BgpServiceCommunitiesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewBgpServiceCommunitiesClientWithBaseURI(baseURI string, subscriptionID string) BgpServiceCommunitiesClient { - return BgpServiceCommunitiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all the available bgp service communities. -func (client BgpServiceCommunitiesClient) List(ctx context.Context) (result BgpServiceCommunityListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunitiesClient.List") - defer func() { - sc := -1 - if result.bsclr.Response.Response != nil { - sc = result.bsclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.bsclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure sending request") - return - } - - result.bsclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure responding to request") - return - } - if result.bsclr.hasNextLink() && result.bsclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BgpServiceCommunitiesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BgpServiceCommunitiesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BgpServiceCommunitiesClient) ListResponder(resp *http.Response) (result BgpServiceCommunityListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client BgpServiceCommunitiesClient) listNextResults(ctx context.Context, lastResults BgpServiceCommunityListResult) (result BgpServiceCommunityListResult, err error) { - req, err := lastResults.bgpServiceCommunityListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BgpServiceCommunitiesClient) ListComplete(ctx context.Context) (result BgpServiceCommunityListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunitiesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/connectionmonitors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/connectionmonitors.go deleted file mode 100644 index 045d4ebf3d7f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/connectionmonitors.go +++ /dev/null @@ -1,677 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConnectionMonitorsClient is the network Client -type ConnectionMonitorsClient struct { - BaseClient -} - -// NewConnectionMonitorsClient creates an instance of the ConnectionMonitorsClient client. -func NewConnectionMonitorsClient(subscriptionID string) ConnectionMonitorsClient { - return NewConnectionMonitorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConnectionMonitorsClientWithBaseURI creates an instance of the ConnectionMonitorsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewConnectionMonitorsClientWithBaseURI(baseURI string, subscriptionID string) ConnectionMonitorsClient { - return ConnectionMonitorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -// parameters - parameters that define the operation to create a connection monitor. -func (client ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor) (result ConnectionMonitorsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Source", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.ConnectionMonitorsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) (future ConnectionMonitorsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future ConnectionMonitorsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a connection monitor by name. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) GetResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all connection monitors for the specified Network Watcher. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -func (client ConnectionMonitorsClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result ConnectionMonitorListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) ListResponder(resp *http.Response) (result ConnectionMonitorListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Query query a snapshot of the most recent connection states. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name given to the connection monitor. -func (client ConnectionMonitorsClient) Query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsQueryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Query") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.QueryPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", nil, "Failure preparing request") - return - } - - result, err = client.QuerySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", nil, "Failure sending request") - return - } - - return -} - -// QueryPreparer prepares the Query request. -func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// QuerySender sends the Query request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future ConnectionMonitorsQueryFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// QueryResponder handles the response to the Query request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) QueryResponder(resp *http.Response) (result ConnectionMonitorQueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start starts the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", nil, "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future ConnectionMonitorsStartFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stops the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", nil, "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future ConnectionMonitorsStopFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UpdateTags update tags of the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// connectionMonitorName - the name of the connection monitor. -// parameters - parameters supplied to update connection monitor tags. -func (client ConnectionMonitorsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject) (result ConnectionMonitorResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) UpdateTagsResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddosprotectionplans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddosprotectionplans.go deleted file mode 100644 index 27cfa80f8a13..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddosprotectionplans.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DdosProtectionPlansClient is the network Client -type DdosProtectionPlansClient struct { - BaseClient -} - -// NewDdosProtectionPlansClient creates an instance of the DdosProtectionPlansClient client. -func NewDdosProtectionPlansClient(subscriptionID string) DdosProtectionPlansClient { - return NewDdosProtectionPlansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDdosProtectionPlansClientWithBaseURI creates an instance of the DdosProtectionPlansClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDdosProtectionPlansClientWithBaseURI(baseURI string, subscriptionID string) DdosProtectionPlansClient { - return DdosProtectionPlansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -// parameters - parameters supplied to the create or update operation. -func (client DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (result DdosProtectionPlansCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) (future DdosProtectionPlansCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) CreateOrUpdateResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -func (client DdosProtectionPlansClient) Delete(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlansDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, ddosProtectionPlanName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future DdosProtectionPlansDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -func (client DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlan, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, ddosProtectionPlanName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) GetResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all DDoS protection plans in a subscription. -func (client DdosProtectionPlansClient) List(ctx context.Context) (result DdosProtectionPlanListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List") - defer func() { - sc := -1 - if result.dpplr.Response.Response != nil { - sc = result.dpplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dpplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure sending request") - return - } - - result.dpplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure responding to request") - return - } - if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) ListResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DdosProtectionPlansClient) listNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) { - req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DdosProtectionPlansClient) ListComplete(ctx context.Context) (result DdosProtectionPlanListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all the DDoS protection plans in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DdosProtectionPlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dpplr.Response.Response != nil { - sc = result.dpplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dpplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dpplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) ListByResourceGroupResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DdosProtectionPlansClient) listByResourceGroupNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) { - req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DdosProtectionPlansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags update a DDoS protection plan tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -// parameters - parameters supplied to the update DDoS protection plan resource tags. -func (client DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (result DdosProtectionPlan, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) UpdateTagsResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/enums.go deleted file mode 100644 index 6d1c580d39d6..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/enums.go +++ /dev/null @@ -1,2436 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// Access enumerates the values for access. -type Access string - -const ( - // Allow ... - Allow Access = "Allow" - // Deny ... - Deny Access = "Deny" -) - -// PossibleAccessValues returns an array of possible values for the Access const type. -func PossibleAccessValues() []Access { - return []Access{Allow, Deny} -} - -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health -// server health. -type ApplicationGatewayBackendHealthServerHealth string - -const ( - // Down ... - Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining ... - Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial ... - Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown ... - Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up ... - Up ApplicationGatewayBackendHealthServerHealth = "Up" -) - -// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. -func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} -} - -// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. -type ApplicationGatewayCookieBasedAffinity string - -const ( - // Disabled ... - Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled ... - Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. -func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} -} - -// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status -// code. -type ApplicationGatewayCustomErrorStatusCode string - -const ( - // HTTPStatus403 ... - HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // HTTPStatus502 ... - HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" -) - -// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. -func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} -} - -// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. -type ApplicationGatewayFirewallMode string - -const ( - // Detection ... - Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention ... - Prevention ApplicationGatewayFirewallMode = "Prevention" -) - -// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. -func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{Detection, Prevention} -} - -// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. -type ApplicationGatewayOperationalState string - -const ( - // Running ... - Running ApplicationGatewayOperationalState = "Running" - // Starting ... - Starting ApplicationGatewayOperationalState = "Starting" - // Stopped ... - Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping ... - Stopping ApplicationGatewayOperationalState = "Stopping" -) - -// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. -func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} -} - -// ApplicationGatewayProtocol enumerates the values for application gateway protocol. -type ApplicationGatewayProtocol string - -const ( - // HTTP ... - HTTP ApplicationGatewayProtocol = "Http" - // HTTPS ... - HTTPS ApplicationGatewayProtocol = "Https" -) - -// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. -func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{HTTP, HTTPS} -} - -// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. -type ApplicationGatewayRedirectType string - -const ( - // Found ... - Found ApplicationGatewayRedirectType = "Found" - // Permanent ... - Permanent ApplicationGatewayRedirectType = "Permanent" - // SeeOther ... - SeeOther ApplicationGatewayRedirectType = "SeeOther" - // Temporary ... - Temporary ApplicationGatewayRedirectType = "Temporary" -) - -// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. -func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} -} - -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule -// type. -type ApplicationGatewayRequestRoutingRuleType string - -const ( - // Basic ... - Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting ... - PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. -func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} -} - -// ApplicationGatewaySkuName enumerates the values for application gateway sku name. -type ApplicationGatewaySkuName string - -const ( - // StandardLarge ... - StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium ... - StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall ... - StandardSmall ApplicationGatewaySkuName = "Standard_Small" - // StandardV2 ... - StandardV2 ApplicationGatewaySkuName = "Standard_v2" - // WAFLarge ... - WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium ... - WAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // WAFV2 ... - WAFV2 ApplicationGatewaySkuName = "WAF_v2" -) - -// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. -func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} -} - -// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. -type ApplicationGatewaySslCipherSuite string - -const ( - // TLSDHEDSSWITH3DESEDECBCSHA ... - TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA ... - TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA256 ... - TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // TLSDHEDSSWITHAES256CBCSHA ... - TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // TLSDHEDSSWITHAES256CBCSHA256 ... - TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // TLSDHERSAWITHAES128CBCSHA ... - TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // TLSDHERSAWITHAES128GCMSHA256 ... - TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSDHERSAWITHAES256CBCSHA ... - TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // TLSDHERSAWITHAES256GCMSHA384 ... - TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSECDHEECDSAWITHAES128CBCSHA ... - TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // TLSECDHEECDSAWITHAES128CBCSHA256 ... - TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // TLSECDHEECDSAWITHAES128GCMSHA256 ... - TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // TLSECDHEECDSAWITHAES256CBCSHA ... - TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // TLSECDHEECDSAWITHAES256CBCSHA384 ... - TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // TLSECDHEECDSAWITHAES256GCMSHA384 ... - TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // TLSECDHERSAWITHAES128CBCSHA ... - TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // TLSECDHERSAWITHAES128CBCSHA256 ... - TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // TLSECDHERSAWITHAES128GCMSHA256 ... - TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSECDHERSAWITHAES256CBCSHA ... - TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // TLSECDHERSAWITHAES256CBCSHA384 ... - TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // TLSECDHERSAWITHAES256GCMSHA384 ... - TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSRSAWITH3DESEDECBCSHA ... - TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // TLSRSAWITHAES128CBCSHA ... - TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // TLSRSAWITHAES128CBCSHA256 ... - TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // TLSRSAWITHAES128GCMSHA256 ... - TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // TLSRSAWITHAES256CBCSHA ... - TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // TLSRSAWITHAES256CBCSHA256 ... - TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // TLSRSAWITHAES256GCMSHA384 ... - TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" -) - -// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. -func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} -} - -// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. -type ApplicationGatewaySslPolicyName string - -const ( - // AppGwSslPolicy20150501 ... - AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // AppGwSslPolicy20170401 ... - AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // AppGwSslPolicy20170401S ... - AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" -) - -// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. -func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} -} - -// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. -type ApplicationGatewaySslPolicyType string - -const ( - // Custom ... - Custom ApplicationGatewaySslPolicyType = "Custom" - // Predefined ... - Predefined ApplicationGatewaySslPolicyType = "Predefined" -) - -// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. -func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{Custom, Predefined} -} - -// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. -type ApplicationGatewaySslProtocol string - -const ( - // TLSv10 ... - TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 ... - TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 ... - TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" -) - -// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. -func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} -} - -// ApplicationGatewayTier enumerates the values for application gateway tier. -type ApplicationGatewayTier string - -const ( - // ApplicationGatewayTierStandard ... - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - // ApplicationGatewayTierStandardV2 ... - ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - // ApplicationGatewayTierWAF ... - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - // ApplicationGatewayTierWAFV2 ... - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" -) - -// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. -func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} -} - -// AssociationType enumerates the values for association type. -type AssociationType string - -const ( - // Associated ... - Associated AssociationType = "Associated" - // Contains ... - Contains AssociationType = "Contains" -) - -// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. -func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{Associated, Contains} -} - -// AuthenticationMethod enumerates the values for authentication method. -type AuthenticationMethod string - -const ( - // EAPMSCHAPv2 ... - EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // EAPTLS ... - EAPTLS AuthenticationMethod = "EAPTLS" -) - -// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. -func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} -} - -// AuthorizationUseStatus enumerates the values for authorization use status. -type AuthorizationUseStatus string - -const ( - // Available ... - Available AuthorizationUseStatus = "Available" - // InUse ... - InUse AuthorizationUseStatus = "InUse" -) - -// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. -func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{Available, InUse} -} - -// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol -// type. -type AzureFirewallApplicationRuleProtocolType string - -const ( - // AzureFirewallApplicationRuleProtocolTypeHTTP ... - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - // AzureFirewallApplicationRuleProtocolTypeHTTPS ... - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - // AzureFirewallApplicationRuleProtocolTypeMssql ... - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. -func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { - return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS, AzureFirewallApplicationRuleProtocolTypeMssql} -} - -// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. -type AzureFirewallNatRCActionType string - -const ( - // Dnat ... - Dnat AzureFirewallNatRCActionType = "Dnat" - // Snat ... - Snat AzureFirewallNatRCActionType = "Snat" -) - -// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. -func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{Dnat, Snat} -} - -// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. -type AzureFirewallNetworkRuleProtocol string - -const ( - // Any ... - Any AzureFirewallNetworkRuleProtocol = "Any" - // ICMP ... - ICMP AzureFirewallNetworkRuleProtocol = "ICMP" - // TCP ... - TCP AzureFirewallNetworkRuleProtocol = "TCP" - // UDP ... - UDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. -func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} -} - -// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. -type AzureFirewallRCActionType string - -const ( - // AzureFirewallRCActionTypeAllow ... - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - // AzureFirewallRCActionTypeDeny ... - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. -func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { - return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} -} - -// AzureFirewallSkuName enumerates the values for azure firewall sku name. -type AzureFirewallSkuName string - -const ( - // AZFWHub ... - AZFWHub AzureFirewallSkuName = "AZFW_Hub" - // AZFWVNet ... - AZFWVNet AzureFirewallSkuName = "AZFW_VNet" -) - -// PossibleAzureFirewallSkuNameValues returns an array of possible values for the AzureFirewallSkuName const type. -func PossibleAzureFirewallSkuNameValues() []AzureFirewallSkuName { - return []AzureFirewallSkuName{AZFWHub, AZFWVNet} -} - -// AzureFirewallSkuTier enumerates the values for azure firewall sku tier. -type AzureFirewallSkuTier string - -const ( - // Premium ... - Premium AzureFirewallSkuTier = "Premium" - // Standard ... - Standard AzureFirewallSkuTier = "Standard" -) - -// PossibleAzureFirewallSkuTierValues returns an array of possible values for the AzureFirewallSkuTier const type. -func PossibleAzureFirewallSkuTierValues() []AzureFirewallSkuTier { - return []AzureFirewallSkuTier{Premium, Standard} -} - -// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. -type AzureFirewallThreatIntelMode string - -const ( - // AzureFirewallThreatIntelModeAlert ... - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - // AzureFirewallThreatIntelModeDeny ... - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - // AzureFirewallThreatIntelModeOff ... - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. -func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { - return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} -} - -// BastionConnectProtocol enumerates the values for bastion connect protocol. -type BastionConnectProtocol string - -const ( - // RDP ... - RDP BastionConnectProtocol = "RDP" - // SSH ... - SSH BastionConnectProtocol = "SSH" -) - -// PossibleBastionConnectProtocolValues returns an array of possible values for the BastionConnectProtocol const type. -func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { - return []BastionConnectProtocol{RDP, SSH} -} - -// BgpPeerState enumerates the values for bgp peer state. -type BgpPeerState string - -const ( - // BgpPeerStateConnected ... - BgpPeerStateConnected BgpPeerState = "Connected" - // BgpPeerStateConnecting ... - BgpPeerStateConnecting BgpPeerState = "Connecting" - // BgpPeerStateIdle ... - BgpPeerStateIdle BgpPeerState = "Idle" - // BgpPeerStateStopped ... - BgpPeerStateStopped BgpPeerState = "Stopped" - // BgpPeerStateUnknown ... - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. -func PossibleBgpPeerStateValues() []BgpPeerState { - return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} -} - -// CircuitConnectionStatus enumerates the values for circuit connection status. -type CircuitConnectionStatus string - -const ( - // Connected ... - Connected CircuitConnectionStatus = "Connected" - // Connecting ... - Connecting CircuitConnectionStatus = "Connecting" - // Disconnected ... - Disconnected CircuitConnectionStatus = "Disconnected" -) - -// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. -func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{Connected, Connecting, Disconnected} -} - -// ConnectionMonitorEndpointFilterItemType enumerates the values for connection monitor endpoint filter item -// type. -type ConnectionMonitorEndpointFilterItemType string - -const ( - // AgentAddress ... - AgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" -) - -// PossibleConnectionMonitorEndpointFilterItemTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterItemType const type. -func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { - return []ConnectionMonitorEndpointFilterItemType{AgentAddress} -} - -// ConnectionMonitorEndpointFilterType enumerates the values for connection monitor endpoint filter type. -type ConnectionMonitorEndpointFilterType string - -const ( - // Include ... - Include ConnectionMonitorEndpointFilterType = "Include" -) - -// PossibleConnectionMonitorEndpointFilterTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterType const type. -func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { - return []ConnectionMonitorEndpointFilterType{Include} -} - -// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. -type ConnectionMonitorSourceStatus string - -const ( - // ConnectionMonitorSourceStatusActive ... - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - // ConnectionMonitorSourceStatusInactive ... - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - // ConnectionMonitorSourceStatusUnknown ... - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} -} - -// ConnectionMonitorTestConfigurationProtocol enumerates the values for connection monitor test configuration -// protocol. -type ConnectionMonitorTestConfigurationProtocol string - -const ( - // ConnectionMonitorTestConfigurationProtocolHTTP ... - ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" - // ConnectionMonitorTestConfigurationProtocolIcmp ... - ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - // ConnectionMonitorTestConfigurationProtocolTCP ... - ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" -) - -// PossibleConnectionMonitorTestConfigurationProtocolValues returns an array of possible values for the ConnectionMonitorTestConfigurationProtocol const type. -func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMonitorTestConfigurationProtocol { - return []ConnectionMonitorTestConfigurationProtocol{ConnectionMonitorTestConfigurationProtocolHTTP, ConnectionMonitorTestConfigurationProtocolIcmp, ConnectionMonitorTestConfigurationProtocolTCP} -} - -// ConnectionMonitorType enumerates the values for connection monitor type. -type ConnectionMonitorType string - -const ( - // MultiEndpoint ... - MultiEndpoint ConnectionMonitorType = "MultiEndpoint" - // SingleSourceDestination ... - SingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" -) - -// PossibleConnectionMonitorTypeValues returns an array of possible values for the ConnectionMonitorType const type. -func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { - return []ConnectionMonitorType{MultiEndpoint, SingleSourceDestination} -} - -// ConnectionState enumerates the values for connection state. -type ConnectionState string - -const ( - // ConnectionStateReachable ... - ConnectionStateReachable ConnectionState = "Reachable" - // ConnectionStateUnknown ... - ConnectionStateUnknown ConnectionState = "Unknown" - // ConnectionStateUnreachable ... - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} -} - -// ConnectionStatus enumerates the values for connection status. -type ConnectionStatus string - -const ( - // ConnectionStatusConnected ... - ConnectionStatusConnected ConnectionStatus = "Connected" - // ConnectionStatusDegraded ... - ConnectionStatusDegraded ConnectionStatus = "Degraded" - // ConnectionStatusDisconnected ... - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - // ConnectionStatusUnknown ... - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. -func PossibleConnectionStatusValues() []ConnectionStatus { - return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} -} - -// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. -type DdosCustomPolicyProtocol string - -const ( - // DdosCustomPolicyProtocolSyn ... - DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" - // DdosCustomPolicyProtocolTCP ... - DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" - // DdosCustomPolicyProtocolUDP ... - DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" -) - -// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. -func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { - return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} -} - -// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity -// override. -type DdosCustomPolicyTriggerSensitivityOverride string - -const ( - // Default ... - Default DdosCustomPolicyTriggerSensitivityOverride = "Default" - // High ... - High DdosCustomPolicyTriggerSensitivityOverride = "High" - // Low ... - Low DdosCustomPolicyTriggerSensitivityOverride = "Low" - // Relaxed ... - Relaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" -) - -// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. -func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { - return []DdosCustomPolicyTriggerSensitivityOverride{Default, High, Low, Relaxed} -} - -// DdosSettingsProtectionCoverage enumerates the values for ddos settings protection coverage. -type DdosSettingsProtectionCoverage string - -const ( - // DdosSettingsProtectionCoverageBasic ... - DdosSettingsProtectionCoverageBasic DdosSettingsProtectionCoverage = "Basic" - // DdosSettingsProtectionCoverageStandard ... - DdosSettingsProtectionCoverageStandard DdosSettingsProtectionCoverage = "Standard" -) - -// PossibleDdosSettingsProtectionCoverageValues returns an array of possible values for the DdosSettingsProtectionCoverage const type. -func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCoverage { - return []DdosSettingsProtectionCoverage{DdosSettingsProtectionCoverageBasic, DdosSettingsProtectionCoverageStandard} -} - -// DhGroup enumerates the values for dh group. -type DhGroup string - -const ( - // DHGroup1 ... - DHGroup1 DhGroup = "DHGroup1" - // DHGroup14 ... - DHGroup14 DhGroup = "DHGroup14" - // DHGroup2 ... - DHGroup2 DhGroup = "DHGroup2" - // DHGroup2048 ... - DHGroup2048 DhGroup = "DHGroup2048" - // DHGroup24 ... - DHGroup24 DhGroup = "DHGroup24" - // ECP256 ... - ECP256 DhGroup = "ECP256" - // ECP384 ... - ECP384 DhGroup = "ECP384" - // None ... - None DhGroup = "None" -) - -// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. -func PossibleDhGroupValues() []DhGroup { - return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} -} - -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - -// EffectiveRouteSource enumerates the values for effective route source. -type EffectiveRouteSource string - -const ( - // EffectiveRouteSourceDefault ... - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - // EffectiveRouteSourceUnknown ... - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - // EffectiveRouteSourceUser ... - EffectiveRouteSourceUser EffectiveRouteSource = "User" - // EffectiveRouteSourceVirtualNetworkGateway ... - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. -func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { - return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} -} - -// EffectiveRouteState enumerates the values for effective route state. -type EffectiveRouteState string - -const ( - // Active ... - Active EffectiveRouteState = "Active" - // Invalid ... - Invalid EffectiveRouteState = "Invalid" -) - -// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. -func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{Active, Invalid} -} - -// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. -type EffectiveSecurityRuleProtocol string - -const ( - // EffectiveSecurityRuleProtocolAll ... - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - // EffectiveSecurityRuleProtocolTCP ... - EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" - // EffectiveSecurityRuleProtocolUDP ... - EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" -) - -// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. -func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} -} - -// EvaluationState enumerates the values for evaluation state. -type EvaluationState string - -const ( - // Completed ... - Completed EvaluationState = "Completed" - // InProgress ... - InProgress EvaluationState = "InProgress" - // NotStarted ... - NotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{Completed, InProgress, NotStarted} -} - -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit -// peering advertised public prefix state. -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - // Configured ... - Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring ... - Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured ... - NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded ... - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. -func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} -} - -// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. -type ExpressRouteCircuitPeeringState string - -const ( - // ExpressRouteCircuitPeeringStateDisabled ... - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - // ExpressRouteCircuitPeeringStateEnabled ... - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. -func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { - return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} -} - -// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. -type ExpressRouteCircuitSkuFamily string - -const ( - // MeteredData ... - MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData ... - UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. -func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} -} - -// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. -type ExpressRouteCircuitSkuTier string - -const ( - // ExpressRouteCircuitSkuTierBasic ... - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - // ExpressRouteCircuitSkuTierLocal ... - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - // ExpressRouteCircuitSkuTierPremium ... - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard ... - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. -func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { - return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} -} - -// ExpressRouteLinkAdminState enumerates the values for express route link admin state. -type ExpressRouteLinkAdminState string - -const ( - // ExpressRouteLinkAdminStateDisabled ... - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - // ExpressRouteLinkAdminStateEnabled ... - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. -func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { - return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} -} - -// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. -type ExpressRouteLinkConnectorType string - -const ( - // LC ... - LC ExpressRouteLinkConnectorType = "LC" - // SC ... - SC ExpressRouteLinkConnectorType = "SC" -) - -// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. -func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{LC, SC} -} - -// ExpressRouteLinkMacSecCipher enumerates the values for express route link mac sec cipher. -type ExpressRouteLinkMacSecCipher string - -const ( - // GcmAes128 ... - GcmAes128 ExpressRouteLinkMacSecCipher = "gcm-aes-128" - // GcmAes256 ... - GcmAes256 ExpressRouteLinkMacSecCipher = "gcm-aes-256" -) - -// PossibleExpressRouteLinkMacSecCipherValues returns an array of possible values for the ExpressRouteLinkMacSecCipher const type. -func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { - return []ExpressRouteLinkMacSecCipher{GcmAes128, GcmAes256} -} - -// ExpressRoutePeeringState enumerates the values for express route peering state. -type ExpressRoutePeeringState string - -const ( - // ExpressRoutePeeringStateDisabled ... - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - // ExpressRoutePeeringStateEnabled ... - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. -func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { - return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} -} - -// ExpressRoutePeeringType enumerates the values for express route peering type. -type ExpressRoutePeeringType string - -const ( - // AzurePrivatePeering ... - AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // AzurePublicPeering ... - AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // MicrosoftPeering ... - MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. -func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} -} - -// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. -type ExpressRoutePortsEncapsulation string - -const ( - // Dot1Q ... - Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // QinQ ... - QinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. -func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} -} - -// FirewallPolicyFilterRuleCollectionActionType enumerates the values for firewall policy filter rule -// collection action type. -type FirewallPolicyFilterRuleCollectionActionType string - -const ( - // FirewallPolicyFilterRuleCollectionActionTypeAllow ... - FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - // FirewallPolicyFilterRuleCollectionActionTypeDeny ... - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" -) - -// PossibleFirewallPolicyFilterRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyFilterRuleCollectionActionType const type. -func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPolicyFilterRuleCollectionActionType { - return []FirewallPolicyFilterRuleCollectionActionType{FirewallPolicyFilterRuleCollectionActionTypeAllow, FirewallPolicyFilterRuleCollectionActionTypeDeny} -} - -// FirewallPolicyNatRuleCollectionActionType enumerates the values for firewall policy nat rule collection -// action type. -type FirewallPolicyNatRuleCollectionActionType string - -const ( - // DNAT ... - DNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" -) - -// PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleCollectionActionType const type. -func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { - return []FirewallPolicyNatRuleCollectionActionType{DNAT} -} - -// FirewallPolicyRuleApplicationProtocolType enumerates the values for firewall policy rule application -// protocol type. -type FirewallPolicyRuleApplicationProtocolType string - -const ( - // FirewallPolicyRuleApplicationProtocolTypeHTTP ... - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" - // FirewallPolicyRuleApplicationProtocolTypeHTTPS ... - FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" -) - -// PossibleFirewallPolicyRuleApplicationProtocolTypeValues returns an array of possible values for the FirewallPolicyRuleApplicationProtocolType const type. -func PossibleFirewallPolicyRuleApplicationProtocolTypeValues() []FirewallPolicyRuleApplicationProtocolType { - return []FirewallPolicyRuleApplicationProtocolType{FirewallPolicyRuleApplicationProtocolTypeHTTP, FirewallPolicyRuleApplicationProtocolTypeHTTPS} -} - -// FirewallPolicyRuleNetworkProtocol enumerates the values for firewall policy rule network protocol. -type FirewallPolicyRuleNetworkProtocol string - -const ( - // FirewallPolicyRuleNetworkProtocolAny ... - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" - // FirewallPolicyRuleNetworkProtocolICMP ... - FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - // FirewallPolicyRuleNetworkProtocolTCP ... - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - // FirewallPolicyRuleNetworkProtocolUDP ... - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" -) - -// PossibleFirewallPolicyRuleNetworkProtocolValues returns an array of possible values for the FirewallPolicyRuleNetworkProtocol const type. -func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetworkProtocol { - return []FirewallPolicyRuleNetworkProtocol{FirewallPolicyRuleNetworkProtocolAny, FirewallPolicyRuleNetworkProtocolICMP, FirewallPolicyRuleNetworkProtocolTCP, FirewallPolicyRuleNetworkProtocolUDP} -} - -// FlowLogFormatType enumerates the values for flow log format type. -type FlowLogFormatType string - -const ( - // JSON ... - JSON FlowLogFormatType = "JSON" -) - -// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. -func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{JSON} -} - -// HTTPConfigurationMethod enumerates the values for http configuration method. -type HTTPConfigurationMethod string - -const ( - // Get ... - Get HTTPConfigurationMethod = "Get" - // Post ... - Post HTTPConfigurationMethod = "Post" -) - -// PossibleHTTPConfigurationMethodValues returns an array of possible values for the HTTPConfigurationMethod const type. -func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { - return []HTTPConfigurationMethod{Get, Post} -} - -// HTTPMethod enumerates the values for http method. -type HTTPMethod string - -const ( - // HTTPMethodGet ... - HTTPMethodGet HTTPMethod = "Get" -) - -// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. -func PossibleHTTPMethodValues() []HTTPMethod { - return []HTTPMethod{HTTPMethodGet} -} - -// HubBgpConnectionStatus enumerates the values for hub bgp connection status. -type HubBgpConnectionStatus string - -const ( - // HubBgpConnectionStatusConnected ... - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - // HubBgpConnectionStatusConnecting ... - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - // HubBgpConnectionStatusNotConnected ... - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - // HubBgpConnectionStatusUnknown ... - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -// PossibleHubBgpConnectionStatusValues returns an array of possible values for the HubBgpConnectionStatus const type. -func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { - return []HubBgpConnectionStatus{HubBgpConnectionStatusConnected, HubBgpConnectionStatusConnecting, HubBgpConnectionStatusNotConnected, HubBgpConnectionStatusUnknown} -} - -// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. -type HubVirtualNetworkConnectionStatus string - -const ( - // HubVirtualNetworkConnectionStatusConnected ... - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - // HubVirtualNetworkConnectionStatusConnecting ... - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - // HubVirtualNetworkConnectionStatusNotConnected ... - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - // HubVirtualNetworkConnectionStatusUnknown ... - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} -} - -// IkeEncryption enumerates the values for ike encryption. -type IkeEncryption string - -const ( - // AES128 ... - AES128 IkeEncryption = "AES128" - // AES192 ... - AES192 IkeEncryption = "AES192" - // AES256 ... - AES256 IkeEncryption = "AES256" - // DES ... - DES IkeEncryption = "DES" - // DES3 ... - DES3 IkeEncryption = "DES3" - // GCMAES128 ... - GCMAES128 IkeEncryption = "GCMAES128" - // GCMAES256 ... - GCMAES256 IkeEncryption = "GCMAES256" -) - -// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. -func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} -} - -// IkeIntegrity enumerates the values for ike integrity. -type IkeIntegrity string - -const ( - // IkeIntegrityGCMAES128 ... - IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" - // IkeIntegrityGCMAES256 ... - IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - // IkeIntegrityMD5 ... - IkeIntegrityMD5 IkeIntegrity = "MD5" - // IkeIntegritySHA1 ... - IkeIntegritySHA1 IkeIntegrity = "SHA1" - // IkeIntegritySHA256 ... - IkeIntegritySHA256 IkeIntegrity = "SHA256" - // IkeIntegritySHA384 ... - IkeIntegritySHA384 IkeIntegrity = "SHA384" -) - -// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. -func PossibleIkeIntegrityValues() []IkeIntegrity { - return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} -} - -// IPAllocationMethod enumerates the values for ip allocation method. -type IPAllocationMethod string - -const ( - // Dynamic ... - Dynamic IPAllocationMethod = "Dynamic" - // Static ... - Static IPAllocationMethod = "Static" -) - -// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{Dynamic, Static} -} - -// IPAllocationType enumerates the values for ip allocation type. -type IPAllocationType string - -const ( - // Hypernet ... - Hypernet IPAllocationType = "Hypernet" - // Undefined ... - Undefined IPAllocationType = "Undefined" -) - -// PossibleIPAllocationTypeValues returns an array of possible values for the IPAllocationType const type. -func PossibleIPAllocationTypeValues() []IPAllocationType { - return []IPAllocationType{Hypernet, Undefined} -} - -// IPFlowProtocol enumerates the values for ip flow protocol. -type IPFlowProtocol string - -const ( - // IPFlowProtocolTCP ... - IPFlowProtocolTCP IPFlowProtocol = "TCP" - // IPFlowProtocolUDP ... - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. -func PossibleIPFlowProtocolValues() []IPFlowProtocol { - return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} -} - -// IpsecEncryption enumerates the values for ipsec encryption. -type IpsecEncryption string - -const ( - // IpsecEncryptionAES128 ... - IpsecEncryptionAES128 IpsecEncryption = "AES128" - // IpsecEncryptionAES192 ... - IpsecEncryptionAES192 IpsecEncryption = "AES192" - // IpsecEncryptionAES256 ... - IpsecEncryptionAES256 IpsecEncryption = "AES256" - // IpsecEncryptionDES ... - IpsecEncryptionDES IpsecEncryption = "DES" - // IpsecEncryptionDES3 ... - IpsecEncryptionDES3 IpsecEncryption = "DES3" - // IpsecEncryptionGCMAES128 ... - IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" - // IpsecEncryptionGCMAES192 ... - IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" - // IpsecEncryptionGCMAES256 ... - IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" - // IpsecEncryptionNone ... - IpsecEncryptionNone IpsecEncryption = "None" -) - -// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. -func PossibleIpsecEncryptionValues() []IpsecEncryption { - return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} -} - -// IpsecIntegrity enumerates the values for ipsec integrity. -type IpsecIntegrity string - -const ( - // IpsecIntegrityGCMAES128 ... - IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" - // IpsecIntegrityGCMAES192 ... - IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" - // IpsecIntegrityGCMAES256 ... - IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" - // IpsecIntegrityMD5 ... - IpsecIntegrityMD5 IpsecIntegrity = "MD5" - // IpsecIntegritySHA1 ... - IpsecIntegritySHA1 IpsecIntegrity = "SHA1" - // IpsecIntegritySHA256 ... - IpsecIntegritySHA256 IpsecIntegrity = "SHA256" -) - -// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. -func PossibleIpsecIntegrityValues() []IpsecIntegrity { - return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IssueType enumerates the values for issue type. -type IssueType string - -const ( - // IssueTypeAgentStopped ... - IssueTypeAgentStopped IssueType = "AgentStopped" - // IssueTypeDNSResolution ... - IssueTypeDNSResolution IssueType = "DnsResolution" - // IssueTypeGuestFirewall ... - IssueTypeGuestFirewall IssueType = "GuestFirewall" - // IssueTypeNetworkSecurityRule ... - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - // IssueTypePlatform ... - IssueTypePlatform IssueType = "Platform" - // IssueTypePortThrottled ... - IssueTypePortThrottled IssueType = "PortThrottled" - // IssueTypeSocketBind ... - IssueTypeSocketBind IssueType = "SocketBind" - // IssueTypeUnknown ... - IssueTypeUnknown IssueType = "Unknown" - // IssueTypeUserDefinedRoute ... - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} -} - -// LoadBalancerOutboundRuleProtocol enumerates the values for load balancer outbound rule protocol. -type LoadBalancerOutboundRuleProtocol string - -const ( - // LoadBalancerOutboundRuleProtocolAll ... - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - // LoadBalancerOutboundRuleProtocolTCP ... - LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" - // LoadBalancerOutboundRuleProtocolUDP ... - LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" -) - -// PossibleLoadBalancerOutboundRuleProtocolValues returns an array of possible values for the LoadBalancerOutboundRuleProtocol const type. -func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { - return []LoadBalancerOutboundRuleProtocol{LoadBalancerOutboundRuleProtocolAll, LoadBalancerOutboundRuleProtocolTCP, LoadBalancerOutboundRuleProtocolUDP} -} - -// LoadBalancerSkuName enumerates the values for load balancer sku name. -type LoadBalancerSkuName string - -const ( - // LoadBalancerSkuNameBasic ... - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - // LoadBalancerSkuNameStandard ... - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. -func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { - return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} -} - -// LoadDistribution enumerates the values for load distribution. -type LoadDistribution string - -const ( - // LoadDistributionDefault ... - LoadDistributionDefault LoadDistribution = "Default" - // LoadDistributionSourceIP ... - LoadDistributionSourceIP LoadDistribution = "SourceIP" - // LoadDistributionSourceIPProtocol ... - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. -func PossibleLoadDistributionValues() []LoadDistribution { - return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} -} - -// ManagedRuleEnabledState enumerates the values for managed rule enabled state. -type ManagedRuleEnabledState string - -const ( - // ManagedRuleEnabledStateDisabled ... - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" -) - -// PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. -func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { - return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled} -} - -// NatGatewaySkuName enumerates the values for nat gateway sku name. -type NatGatewaySkuName string - -const ( - // NatGatewaySkuNameStandard ... - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -// PossibleNatGatewaySkuNameValues returns an array of possible values for the NatGatewaySkuName const type. -func PossibleNatGatewaySkuNameValues() []NatGatewaySkuName { - return []NatGatewaySkuName{NatGatewaySkuNameStandard} -} - -// NextHopType enumerates the values for next hop type. -type NextHopType string - -const ( - // NextHopTypeHyperNetGateway ... - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - // NextHopTypeInternet ... - NextHopTypeInternet NextHopType = "Internet" - // NextHopTypeNone ... - NextHopTypeNone NextHopType = "None" - // NextHopTypeVirtualAppliance ... - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - // NextHopTypeVirtualNetworkGateway ... - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - // NextHopTypeVnetLocal ... - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. -func PossibleNextHopTypeValues() []NextHopType { - return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} -} - -// OfficeTrafficCategory enumerates the values for office traffic category. -type OfficeTrafficCategory string - -const ( - // OfficeTrafficCategoryAll ... - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - // OfficeTrafficCategoryNone ... - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - // OfficeTrafficCategoryOptimize ... - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - // OfficeTrafficCategoryOptimizeAndAllow ... - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. -func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { - return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusFailed ... - OperationStatusFailed OperationStatus = "Failed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} -} - -// Origin enumerates the values for origin. -type Origin string - -const ( - // OriginInbound ... - OriginInbound Origin = "Inbound" - // OriginLocal ... - OriginLocal Origin = "Local" - // OriginOutbound ... - OriginOutbound Origin = "Outbound" -) - -// PossibleOriginValues returns an array of possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{OriginInbound, OriginLocal, OriginOutbound} -} - -// OutputType enumerates the values for output type. -type OutputType string - -const ( - // Workspace ... - Workspace OutputType = "Workspace" -) - -// PossibleOutputTypeValues returns an array of possible values for the OutputType const type. -func PossibleOutputTypeValues() []OutputType { - return []OutputType{Workspace} -} - -// OwaspCrsExclusionEntryMatchVariable enumerates the values for owasp crs exclusion entry match variable. -type OwaspCrsExclusionEntryMatchVariable string - -const ( - // RequestArgNames ... - RequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - // RequestCookieNames ... - RequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - // RequestHeaderNames ... - RequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" -) - -// PossibleOwaspCrsExclusionEntryMatchVariableValues returns an array of possible values for the OwaspCrsExclusionEntryMatchVariable const type. -func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{RequestArgNames, RequestCookieNames, RequestHeaderNames} -} - -// OwaspCrsExclusionEntrySelectorMatchOperator enumerates the values for owasp crs exclusion entry selector -// match operator. -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - // OwaspCrsExclusionEntrySelectorMatchOperatorContains ... - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - // OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith ... - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - // OwaspCrsExclusionEntrySelectorMatchOperatorEquals ... - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - // OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny ... - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - // OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith ... - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -// PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues returns an array of possible values for the OwaspCrsExclusionEntrySelectorMatchOperator const type. -func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclusionEntrySelectorMatchOperator { - return []OwaspCrsExclusionEntrySelectorMatchOperator{OwaspCrsExclusionEntrySelectorMatchOperatorContains, OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, OwaspCrsExclusionEntrySelectorMatchOperatorEquals, OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith} -} - -// PcError enumerates the values for pc error. -type PcError string - -const ( - // AgentStopped ... - AgentStopped PcError = "AgentStopped" - // CaptureFailed ... - CaptureFailed PcError = "CaptureFailed" - // InternalError ... - InternalError PcError = "InternalError" - // LocalFileFailed ... - LocalFileFailed PcError = "LocalFileFailed" - // StorageFailed ... - StorageFailed PcError = "StorageFailed" -) - -// PossiblePcErrorValues returns an array of possible values for the PcError const type. -func PossiblePcErrorValues() []PcError { - return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} -} - -// PcProtocol enumerates the values for pc protocol. -type PcProtocol string - -const ( - // PcProtocolAny ... - PcProtocolAny PcProtocol = "Any" - // PcProtocolTCP ... - PcProtocolTCP PcProtocol = "TCP" - // PcProtocolUDP ... - PcProtocolUDP PcProtocol = "UDP" -) - -// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. -func PossiblePcProtocolValues() []PcProtocol { - return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} -} - -// PcStatus enumerates the values for pc status. -type PcStatus string - -const ( - // PcStatusError ... - PcStatusError PcStatus = "Error" - // PcStatusNotStarted ... - PcStatusNotStarted PcStatus = "NotStarted" - // PcStatusRunning ... - PcStatusRunning PcStatus = "Running" - // PcStatusStopped ... - PcStatusStopped PcStatus = "Stopped" - // PcStatusUnknown ... - PcStatusUnknown PcStatus = "Unknown" -) - -// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. -func PossiblePcStatusValues() []PcStatus { - return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} -} - -// PfsGroup enumerates the values for pfs group. -type PfsGroup string - -const ( - // PfsGroupECP256 ... - PfsGroupECP256 PfsGroup = "ECP256" - // PfsGroupECP384 ... - PfsGroupECP384 PfsGroup = "ECP384" - // PfsGroupNone ... - PfsGroupNone PfsGroup = "None" - // PfsGroupPFS1 ... - PfsGroupPFS1 PfsGroup = "PFS1" - // PfsGroupPFS14 ... - PfsGroupPFS14 PfsGroup = "PFS14" - // PfsGroupPFS2 ... - PfsGroupPFS2 PfsGroup = "PFS2" - // PfsGroupPFS2048 ... - PfsGroupPFS2048 PfsGroup = "PFS2048" - // PfsGroupPFS24 ... - PfsGroupPFS24 PfsGroup = "PFS24" - // PfsGroupPFSMM ... - PfsGroupPFSMM PfsGroup = "PFSMM" -) - -// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. -func PossiblePfsGroupValues() []PfsGroup { - return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} -} - -// PreferredIPVersion enumerates the values for preferred ip version. -type PreferredIPVersion string - -const ( - // PreferredIPVersionIPv4 ... - PreferredIPVersionIPv4 PreferredIPVersion = "IPv4" - // PreferredIPVersionIPv6 ... - PreferredIPVersionIPv6 PreferredIPVersion = "IPv6" -) - -// PossiblePreferredIPVersionValues returns an array of possible values for the PreferredIPVersion const type. -func PossiblePreferredIPVersionValues() []PreferredIPVersion { - return []PreferredIPVersion{PreferredIPVersionIPv4, PreferredIPVersionIPv6} -} - -// ProbeProtocol enumerates the values for probe protocol. -type ProbeProtocol string - -const ( - // ProbeProtocolHTTP ... - ProbeProtocolHTTP ProbeProtocol = "Http" - // ProbeProtocolHTTPS ... - ProbeProtocolHTTPS ProbeProtocol = "Https" - // ProbeProtocolTCP ... - ProbeProtocolTCP ProbeProtocol = "Tcp" -) - -// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. -func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} -} - -// ProcessorArchitecture enumerates the values for processor architecture. -type ProcessorArchitecture string - -const ( - // Amd64 ... - Amd64 ProcessorArchitecture = "Amd64" - // X86 ... - X86 ProcessorArchitecture = "X86" -) - -// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. -func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{Amd64, X86} -} - -// Protocol enumerates the values for protocol. -type Protocol string - -const ( - // ProtocolHTTP ... - ProtocolHTTP Protocol = "Http" - // ProtocolHTTPS ... - ProtocolHTTPS Protocol = "Https" - // ProtocolIcmp ... - ProtocolIcmp Protocol = "Icmp" - // ProtocolTCP ... - ProtocolTCP Protocol = "Tcp" -) - -// PossibleProtocolValues returns an array of possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Deleting, Failed, Succeeded, Updating} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. -type PublicIPPrefixSkuName string - -const ( - // PublicIPPrefixSkuNameStandard ... - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. -func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { - return []PublicIPPrefixSkuName{PublicIPPrefixSkuNameStandard} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// RouteNextHopType enumerates the values for route next hop type. -type RouteNextHopType string - -const ( - // RouteNextHopTypeInternet ... - RouteNextHopTypeInternet RouteNextHopType = "Internet" - // RouteNextHopTypeNone ... - RouteNextHopTypeNone RouteNextHopType = "None" - // RouteNextHopTypeVirtualAppliance ... - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - // RouteNextHopTypeVirtualNetworkGateway ... - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - // RouteNextHopTypeVnetLocal ... - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. -func PossibleRouteNextHopTypeValues() []RouteNextHopType { - return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} -} - -// RoutingState enumerates the values for routing state. -type RoutingState string - -const ( - // RoutingStateFailed ... - RoutingStateFailed RoutingState = "Failed" - // RoutingStateNone ... - RoutingStateNone RoutingState = "None" - // RoutingStateProvisioned ... - RoutingStateProvisioned RoutingState = "Provisioned" - // RoutingStateProvisioning ... - RoutingStateProvisioning RoutingState = "Provisioning" -) - -// PossibleRoutingStateValues returns an array of possible values for the RoutingState const type. -func PossibleRoutingStateValues() []RoutingState { - return []RoutingState{RoutingStateFailed, RoutingStateNone, RoutingStateProvisioned, RoutingStateProvisioning} -} - -// RuleCollectionType enumerates the values for rule collection type. -type RuleCollectionType string - -const ( - // RuleCollectionTypeFirewallPolicyFilterRuleCollection ... - RuleCollectionTypeFirewallPolicyFilterRuleCollection RuleCollectionType = "FirewallPolicyFilterRuleCollection" - // RuleCollectionTypeFirewallPolicyNatRuleCollection ... - RuleCollectionTypeFirewallPolicyNatRuleCollection RuleCollectionType = "FirewallPolicyNatRuleCollection" - // RuleCollectionTypeFirewallPolicyRuleCollection ... - RuleCollectionTypeFirewallPolicyRuleCollection RuleCollectionType = "FirewallPolicyRuleCollection" -) - -// PossibleRuleCollectionTypeValues returns an array of possible values for the RuleCollectionType const type. -func PossibleRuleCollectionTypeValues() []RuleCollectionType { - return []RuleCollectionType{RuleCollectionTypeFirewallPolicyFilterRuleCollection, RuleCollectionTypeFirewallPolicyNatRuleCollection, RuleCollectionTypeFirewallPolicyRuleCollection} -} - -// RuleType enumerates the values for rule type. -type RuleType string - -const ( - // RuleTypeApplicationRule ... - RuleTypeApplicationRule RuleType = "ApplicationRule" - // RuleTypeFirewallPolicyRule ... - RuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" - // RuleTypeNatRule ... - RuleTypeNatRule RuleType = "NatRule" - // RuleTypeNetworkRule ... - RuleTypeNetworkRule RuleType = "NetworkRule" -) - -// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. -func PossibleRuleTypeValues() []RuleType { - return []RuleType{RuleTypeApplicationRule, RuleTypeFirewallPolicyRule, RuleTypeNatRule, RuleTypeNetworkRule} -} - -// SecurityPartnerProviderConnectionStatus enumerates the values for security partner provider connection -// status. -type SecurityPartnerProviderConnectionStatus string - -const ( - // SecurityPartnerProviderConnectionStatusConnected ... - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - // SecurityPartnerProviderConnectionStatusNotConnected ... - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" - // SecurityPartnerProviderConnectionStatusPartiallyConnected ... - SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - // SecurityPartnerProviderConnectionStatusUnknown ... - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" -) - -// PossibleSecurityPartnerProviderConnectionStatusValues returns an array of possible values for the SecurityPartnerProviderConnectionStatus const type. -func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerProviderConnectionStatus { - return []SecurityPartnerProviderConnectionStatus{SecurityPartnerProviderConnectionStatusConnected, SecurityPartnerProviderConnectionStatusNotConnected, SecurityPartnerProviderConnectionStatusPartiallyConnected, SecurityPartnerProviderConnectionStatusUnknown} -} - -// SecurityProviderName enumerates the values for security provider name. -type SecurityProviderName string - -const ( - // Checkpoint ... - Checkpoint SecurityProviderName = "Checkpoint" - // IBoss ... - IBoss SecurityProviderName = "IBoss" - // ZScaler ... - ZScaler SecurityProviderName = "ZScaler" -) - -// PossibleSecurityProviderNameValues returns an array of possible values for the SecurityProviderName const type. -func PossibleSecurityProviderNameValues() []SecurityProviderName { - return []SecurityProviderName{Checkpoint, IBoss, ZScaler} -} - -// SecurityRuleAccess enumerates the values for security rule access. -type SecurityRuleAccess string - -const ( - // SecurityRuleAccessAllow ... - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - // SecurityRuleAccessDeny ... - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. -func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { - return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} -} - -// SecurityRuleDirection enumerates the values for security rule direction. -type SecurityRuleDirection string - -const ( - // SecurityRuleDirectionInbound ... - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - // SecurityRuleDirectionOutbound ... - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. -func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { - return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} -} - -// SecurityRuleProtocol enumerates the values for security rule protocol. -type SecurityRuleProtocol string - -const ( - // SecurityRuleProtocolAh ... - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - // SecurityRuleProtocolAsterisk ... - SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - // SecurityRuleProtocolEsp ... - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - // SecurityRuleProtocolIcmp ... - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - // SecurityRuleProtocolTCP ... - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - // SecurityRuleProtocolUDP ... - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" -) - -// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. -func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { - return []SecurityRuleProtocol{SecurityRuleProtocolAh, SecurityRuleProtocolAsterisk, SecurityRuleProtocolEsp, SecurityRuleProtocolIcmp, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} -} - -// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. -type ServiceProviderProvisioningState string - -const ( - // Deprovisioning ... - Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" - // NotProvisioned ... - NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - // Provisioned ... - Provisioned ServiceProviderProvisioningState = "Provisioned" - // Provisioning ... - Provisioning ServiceProviderProvisioningState = "Provisioning" -) - -// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. -func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { - return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} -} - -// Severity enumerates the values for severity. -type Severity string - -const ( - // SeverityError ... - SeverityError Severity = "Error" - // SeverityWarning ... - SeverityWarning Severity = "Warning" -) - -// PossibleSeverityValues returns an array of possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{SeverityError, SeverityWarning} -} - -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolAll ... - TransportProtocolAll TransportProtocol = "All" - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "Tcp" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "Udp" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} -} - -// TunnelConnectionStatus enumerates the values for tunnel connection status. -type TunnelConnectionStatus string - -const ( - // TunnelConnectionStatusConnected ... - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - // TunnelConnectionStatusConnecting ... - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - // TunnelConnectionStatusNotConnected ... - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - // TunnelConnectionStatusUnknown ... - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} -} - -// VerbosityLevel enumerates the values for verbosity level. -type VerbosityLevel string - -const ( - // Full ... - Full VerbosityLevel = "Full" - // Minimum ... - Minimum VerbosityLevel = "Minimum" - // Normal ... - Normal VerbosityLevel = "Normal" -) - -// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. -func PossibleVerbosityLevelValues() []VerbosityLevel { - return []VerbosityLevel{Full, Minimum, Normal} -} - -// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection -// protocol. -type VirtualNetworkGatewayConnectionProtocol string - -const ( - // IKEv1 ... - IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // IKEv2 ... - IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. -func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} -} - -// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. -type VirtualNetworkGatewayConnectionStatus string - -const ( - // VirtualNetworkGatewayConnectionStatusConnected ... - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - // VirtualNetworkGatewayConnectionStatusConnecting ... - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // VirtualNetworkGatewayConnectionStatusNotConnected ... - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // VirtualNetworkGatewayConnectionStatusUnknown ... - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. -func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { - return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} -} - -// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. -type VirtualNetworkGatewayConnectionType string - -const ( - // ExpressRoute ... - ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec ... - IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet ... - Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient ... - VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" -) - -// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. -func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} -} - -// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. -type VirtualNetworkGatewaySkuName string - -const ( - // VirtualNetworkGatewaySkuNameBasic ... - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - // VirtualNetworkGatewaySkuNameErGw1AZ ... - VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - // VirtualNetworkGatewaySkuNameErGw2AZ ... - VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - // VirtualNetworkGatewaySkuNameErGw3AZ ... - VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - // VirtualNetworkGatewaySkuNameHighPerformance ... - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - // VirtualNetworkGatewaySkuNameStandard ... - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - // VirtualNetworkGatewaySkuNameUltraPerformance ... - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - // VirtualNetworkGatewaySkuNameVpnGw1 ... - VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" - // VirtualNetworkGatewaySkuNameVpnGw1AZ ... - VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - // VirtualNetworkGatewaySkuNameVpnGw2 ... - VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" - // VirtualNetworkGatewaySkuNameVpnGw2AZ ... - VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" - // VirtualNetworkGatewaySkuNameVpnGw3 ... - VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" - // VirtualNetworkGatewaySkuNameVpnGw3AZ ... - VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - // VirtualNetworkGatewaySkuNameVpnGw4 ... - VirtualNetworkGatewaySkuNameVpnGw4 VirtualNetworkGatewaySkuName = "VpnGw4" - // VirtualNetworkGatewaySkuNameVpnGw4AZ ... - VirtualNetworkGatewaySkuNameVpnGw4AZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - // VirtualNetworkGatewaySkuNameVpnGw5 ... - VirtualNetworkGatewaySkuNameVpnGw5 VirtualNetworkGatewaySkuName = "VpnGw5" - // VirtualNetworkGatewaySkuNameVpnGw5AZ ... - VirtualNetworkGatewaySkuNameVpnGw5AZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. -func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { - return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ, VirtualNetworkGatewaySkuNameVpnGw4, VirtualNetworkGatewaySkuNameVpnGw4AZ, VirtualNetworkGatewaySkuNameVpnGw5, VirtualNetworkGatewaySkuNameVpnGw5AZ} -} - -// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. -type VirtualNetworkGatewaySkuTier string - -const ( - // VirtualNetworkGatewaySkuTierBasic ... - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - // VirtualNetworkGatewaySkuTierErGw1AZ ... - VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - // VirtualNetworkGatewaySkuTierErGw2AZ ... - VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - // VirtualNetworkGatewaySkuTierErGw3AZ ... - VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - // VirtualNetworkGatewaySkuTierHighPerformance ... - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - // VirtualNetworkGatewaySkuTierStandard ... - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - // VirtualNetworkGatewaySkuTierUltraPerformance ... - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - // VirtualNetworkGatewaySkuTierVpnGw1 ... - VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" - // VirtualNetworkGatewaySkuTierVpnGw1AZ ... - VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - // VirtualNetworkGatewaySkuTierVpnGw2 ... - VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" - // VirtualNetworkGatewaySkuTierVpnGw2AZ ... - VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" - // VirtualNetworkGatewaySkuTierVpnGw3 ... - VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" - // VirtualNetworkGatewaySkuTierVpnGw3AZ ... - VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - // VirtualNetworkGatewaySkuTierVpnGw4 ... - VirtualNetworkGatewaySkuTierVpnGw4 VirtualNetworkGatewaySkuTier = "VpnGw4" - // VirtualNetworkGatewaySkuTierVpnGw4AZ ... - VirtualNetworkGatewaySkuTierVpnGw4AZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - // VirtualNetworkGatewaySkuTierVpnGw5 ... - VirtualNetworkGatewaySkuTierVpnGw5 VirtualNetworkGatewaySkuTier = "VpnGw5" - // VirtualNetworkGatewaySkuTierVpnGw5AZ ... - VirtualNetworkGatewaySkuTierVpnGw5AZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. -func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { - return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ, VirtualNetworkGatewaySkuTierVpnGw4, VirtualNetworkGatewaySkuTierVpnGw4AZ, VirtualNetworkGatewaySkuTierVpnGw5, VirtualNetworkGatewaySkuTierVpnGw5AZ} -} - -// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. -type VirtualNetworkGatewayType string - -const ( - // VirtualNetworkGatewayTypeExpressRoute ... - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - // VirtualNetworkGatewayTypeVpn ... - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. -func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { - return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} -} - -// VirtualNetworkPeeringState enumerates the values for virtual network peering state. -type VirtualNetworkPeeringState string - -const ( - // VirtualNetworkPeeringStateConnected ... - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - // VirtualNetworkPeeringStateDisconnected ... - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - // VirtualNetworkPeeringStateInitiated ... - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. -func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { - return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} -} - -// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. -type VirtualWanSecurityProviderType string - -const ( - // External ... - External VirtualWanSecurityProviderType = "External" - // Native ... - Native VirtualWanSecurityProviderType = "Native" -) - -// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. -func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{External, Native} -} - -// VpnAuthenticationType enumerates the values for vpn authentication type. -type VpnAuthenticationType string - -const ( - // AAD ... - AAD VpnAuthenticationType = "AAD" - // Certificate ... - Certificate VpnAuthenticationType = "Certificate" - // Radius ... - Radius VpnAuthenticationType = "Radius" -) - -// PossibleVpnAuthenticationTypeValues returns an array of possible values for the VpnAuthenticationType const type. -func PossibleVpnAuthenticationTypeValues() []VpnAuthenticationType { - return []VpnAuthenticationType{AAD, Certificate, Radius} -} - -// VpnClientProtocol enumerates the values for vpn client protocol. -type VpnClientProtocol string - -const ( - // IkeV2 ... - IkeV2 VpnClientProtocol = "IkeV2" - // OpenVPN ... - OpenVPN VpnClientProtocol = "OpenVPN" - // SSTP ... - SSTP VpnClientProtocol = "SSTP" -) - -// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. -func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} -} - -// VpnConnectionStatus enumerates the values for vpn connection status. -type VpnConnectionStatus string - -const ( - // VpnConnectionStatusConnected ... - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - // VpnConnectionStatusConnecting ... - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - // VpnConnectionStatusNotConnected ... - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - // VpnConnectionStatusUnknown ... - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. -func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { - return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} -} - -// VpnGatewayGeneration enumerates the values for vpn gateway generation. -type VpnGatewayGeneration string - -const ( - // VpnGatewayGenerationGeneration1 ... - VpnGatewayGenerationGeneration1 VpnGatewayGeneration = "Generation1" - // VpnGatewayGenerationGeneration2 ... - VpnGatewayGenerationGeneration2 VpnGatewayGeneration = "Generation2" - // VpnGatewayGenerationNone ... - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -// PossibleVpnGatewayGenerationValues returns an array of possible values for the VpnGatewayGeneration const type. -func PossibleVpnGatewayGenerationValues() []VpnGatewayGeneration { - return []VpnGatewayGeneration{VpnGatewayGenerationGeneration1, VpnGatewayGenerationGeneration2, VpnGatewayGenerationNone} -} - -// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. -type VpnGatewayTunnelingProtocol string - -const ( - // VpnGatewayTunnelingProtocolIkeV2 ... - VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" - // VpnGatewayTunnelingProtocolOpenVPN ... - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. -func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { - return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} -} - -// VpnType enumerates the values for vpn type. -type VpnType string - -const ( - // PolicyBased ... - PolicyBased VpnType = "PolicyBased" - // RouteBased ... - RouteBased VpnType = "RouteBased" -) - -// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. -func PossibleVpnTypeValues() []VpnType { - return []VpnType{PolicyBased, RouteBased} -} - -// WebApplicationFirewallAction enumerates the values for web application firewall action. -type WebApplicationFirewallAction string - -const ( - // WebApplicationFirewallActionAllow ... - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - // WebApplicationFirewallActionBlock ... - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - // WebApplicationFirewallActionLog ... - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. -func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { - return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} -} - -// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. -type WebApplicationFirewallEnabledState string - -const ( - // WebApplicationFirewallEnabledStateDisabled ... - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - // WebApplicationFirewallEnabledStateEnabled ... - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. -func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { - return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} -} - -// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. -type WebApplicationFirewallMatchVariable string - -const ( - // PostArgs ... - PostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // QueryString ... - QueryString WebApplicationFirewallMatchVariable = "QueryString" - // RemoteAddr ... - RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // RequestBody ... - RequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // RequestCookies ... - RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // RequestHeaders ... - RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // RequestMethod ... - RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // RequestURI ... - RequestURI WebApplicationFirewallMatchVariable = "RequestUri" -) - -// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. -func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} -} - -// WebApplicationFirewallMode enumerates the values for web application firewall mode. -type WebApplicationFirewallMode string - -const ( - // WebApplicationFirewallModeDetection ... - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - // WebApplicationFirewallModePrevention ... - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. -func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { - return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} -} - -// WebApplicationFirewallOperator enumerates the values for web application firewall operator. -type WebApplicationFirewallOperator string - -const ( - // WebApplicationFirewallOperatorBeginsWith ... - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - // WebApplicationFirewallOperatorContains ... - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - // WebApplicationFirewallOperatorEndsWith ... - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - // WebApplicationFirewallOperatorEqual ... - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - // WebApplicationFirewallOperatorGeoMatch ... - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - // WebApplicationFirewallOperatorGreaterThan ... - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - // WebApplicationFirewallOperatorGreaterThanOrEqual ... - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - // WebApplicationFirewallOperatorIPMatch ... - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - // WebApplicationFirewallOperatorLessThan ... - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - // WebApplicationFirewallOperatorLessThanOrEqual ... - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - // WebApplicationFirewallOperatorRegex ... - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. -func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGeoMatch, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} -} - -// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource -// state. -type WebApplicationFirewallPolicyResourceState string - -const ( - // WebApplicationFirewallPolicyResourceStateCreating ... - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - // WebApplicationFirewallPolicyResourceStateDeleting ... - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - // WebApplicationFirewallPolicyResourceStateDisabled ... - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - // WebApplicationFirewallPolicyResourceStateDisabling ... - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - // WebApplicationFirewallPolicyResourceStateEnabled ... - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - // WebApplicationFirewallPolicyResourceStateEnabling ... - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. -func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { - return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} -} - -// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. -type WebApplicationFirewallRuleType string - -const ( - // WebApplicationFirewallRuleTypeInvalid ... - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - // WebApplicationFirewallRuleTypeMatchRule ... - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" -) - -// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. -func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { - return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} -} - -// WebApplicationFirewallTransform enumerates the values for web application firewall transform. -type WebApplicationFirewallTransform string - -const ( - // HTMLEntityDecode ... - HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // Lowercase ... - Lowercase WebApplicationFirewallTransform = "Lowercase" - // RemoveNulls ... - RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // Trim ... - Trim WebApplicationFirewallTransform = "Trim" - // URLDecode ... - URLDecode WebApplicationFirewallTransform = "UrlDecode" - // URLEncode ... - URLEncode WebApplicationFirewallTransform = "UrlEncode" -) - -// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. -func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteconnections.go deleted file mode 100644 index b75013d716d3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteconnections.go +++ /dev/null @@ -1,357 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteConnectionsClient is the network Client -type ExpressRouteConnectionsClient struct { - BaseClient -} - -// NewExpressRouteConnectionsClient creates an instance of the ExpressRouteConnectionsClient client. -func NewExpressRouteConnectionsClient(subscriptionID string) ExpressRouteConnectionsClient { - return NewExpressRouteConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteConnectionsClientWithBaseURI creates an instance of the ExpressRouteConnectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewExpressRouteConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteConnectionsClient { - return ExpressRouteConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the connection subresource. -// putExpressRouteConnectionParameters - parameters required in an ExpressRouteConnection PUT operation. -func (client ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection) (result ExpressRouteConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: putExpressRouteConnectionParameters, - Constraints: []validation.Constraint{{Target: "putExpressRouteConnectionParameters.ExpressRouteConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "putExpressRouteConnectionParameters.ExpressRouteConnectionProperties.ExpressRouteCircuitPeering", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "putExpressRouteConnectionParameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithJSON(putExpressRouteConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a connection to a ExpressRoute circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the connection subresource. -func (client ExpressRouteConnectionsClient) Delete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (result ExpressRouteConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) DeleteSender(req *http.Request) (future ExpressRouteConnectionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified ExpressRouteConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the ExpressRoute connection. -func (client ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (result ExpressRouteConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists ExpressRouteConnections. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteConnectionsClient) List(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteConnectionList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteConnectionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnections.go deleted file mode 100644 index 8bdaeb13bf9f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnections.go +++ /dev/null @@ -1,747 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCrossConnectionsClient is the network Client -type ExpressRouteCrossConnectionsClient struct { - BaseClient -} - -// NewExpressRouteCrossConnectionsClient creates an instance of the ExpressRouteCrossConnectionsClient client. -func NewExpressRouteCrossConnectionsClient(subscriptionID string) ExpressRouteCrossConnectionsClient { - return NewExpressRouteCrossConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCrossConnectionsClientWithBaseURI creates an instance of the ExpressRouteCrossConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteCrossConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCrossConnectionsClient { - return ExpressRouteCrossConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate update the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// parameters - parameters supplied to the update express route crossConnection operation. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection) (result ExpressRouteCrossConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, crossConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCrossConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets details about the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group (peering location of the circuit). -// crossConnectionName - the name of the ExpressRouteCrossConnection (service key of the circuit). -func (client ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, crossConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCrossConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves all the ExpressRouteCrossConnections in a subscription. -func (client ExpressRouteCrossConnectionsClient) List(ctx context.Context) (result ExpressRouteCrossConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.List") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCrossConnectionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionListResult) (result ExpressRouteCrossConnectionListResult, err error) { - req, err := lastResults.expressRouteCrossConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionsClient) ListComplete(ctx context.Context) (result ExpressRouteCrossConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListArpTable gets the currently advertised ARP table associated with the express route cross connection in a -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListArpTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListArpTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListArpTablePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", nil, "Failure preparing request") - return - } - - result, err = client.ListArpTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", nil, "Failure sending request") - return - } - - return -} - -// ListArpTablePreparer prepares the ListArpTable request. -func (client ExpressRouteCrossConnectionsClient) ListArpTablePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListArpTableSender sends the ListArpTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListArpTableSender(req *http.Request) (future ExpressRouteCrossConnectionsListArpTableFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListArpTableResponder handles the response to the ListArpTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup retrieves all the ExpressRouteCrossConnections in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRouteCrossConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionListResult) (result ExpressRouteCrossConnectionListResult, err error) { - req, err := lastResults.expressRouteCrossConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ExpressRouteCrossConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListRoutesTable gets the currently advertised routes table associated with the express route cross connection in a -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListRoutesTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTablePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", nil, "Failure sending request") - return - } - - return -} - -// ListRoutesTablePreparer prepares the ListRoutesTable request. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTablePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSender sends the ListRoutesTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSender(req *http.Request) (future ExpressRouteCrossConnectionsListRoutesTableFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTableSummary gets the route table summary associated with the express route cross connection in a resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListRoutesTableSummaryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTableSummary") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTableSummaryPreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSummarySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", nil, "Failure sending request") - return - } - - return -} - -// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummarySender(req *http.Request) (future ExpressRouteCrossConnectionsListRoutesTableSummaryFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates an express route cross connection tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the cross connection. -// crossConnectionParameters - parameters supplied to update express route cross connection tags. -func (client ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject) (result ExpressRouteCrossConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, crossConnectionName, crossConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithJSON(crossConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteports.go deleted file mode 100644 index a74203e0dd27..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteports.go +++ /dev/null @@ -1,575 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRoutePortsClient is the network Client -type ExpressRoutePortsClient struct { - BaseClient -} - -// NewExpressRoutePortsClient creates an instance of the ExpressRoutePortsClient client. -func NewExpressRoutePortsClient(subscriptionID string) ExpressRoutePortsClient { - return NewExpressRoutePortsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRoutePortsClientWithBaseURI creates an instance of the ExpressRoutePortsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRoutePortsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortsClient { - return ExpressRoutePortsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// parameters - parameters supplied to the create ExpressRoutePort operation. -func (client ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort) (result ExpressRoutePortsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRoutePortName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRoutePortsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRoutePortsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -func (client ExpressRoutePortsClient) Delete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRoutePortsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) DeleteSender(req *http.Request) (future ExpressRoutePortsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the requested ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of ExpressRoutePort. -func (client ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePort, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRoutePortsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) GetResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all the ExpressRoutePort resources in the specified subscription. -func (client ExpressRoutePortsClient) List(ctx context.Context) (result ExpressRoutePortListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.List") - defer func() { - sc := -1 - if result.erplr.Response.Response != nil { - sc = result.erplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure sending request") - return - } - - result.erplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure responding to request") - return - } - if result.erplr.hasNextLink() && result.erplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRoutePortsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) ListResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortListResult) (result ExpressRoutePortListResult, err error) { - req, err := lastResults.expressRoutePortListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsClient) ListComplete(ctx context.Context) (result ExpressRoutePortListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list all the ExpressRoutePort resources in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRoutePortsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRoutePortListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.erplr.Response.Response != nil { - sc = result.erplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.erplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.erplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.erplr.hasNextLink() && result.erplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRoutePortsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ExpressRoutePortListResult) (result ExpressRoutePortListResult, err error) { - req, err := lastResults.expressRoutePortListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ExpressRoutePortListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags update ExpressRoutePort tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// parameters - parameters supplied to update ExpressRoutePort resource tags. -func (client ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject) (result ExpressRoutePort, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, expressRoutePortName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRoutePortsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteportslocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteportslocations.go deleted file mode 100644 index f77c9a323f31..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteportslocations.go +++ /dev/null @@ -1,221 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRoutePortsLocationsClient is the network Client -type ExpressRoutePortsLocationsClient struct { - BaseClient -} - -// NewExpressRoutePortsLocationsClient creates an instance of the ExpressRoutePortsLocationsClient client. -func NewExpressRoutePortsLocationsClient(subscriptionID string) ExpressRoutePortsLocationsClient { - return NewExpressRoutePortsLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRoutePortsLocationsClientWithBaseURI creates an instance of the ExpressRoutePortsLocationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewExpressRoutePortsLocationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortsLocationsClient { - return ExpressRoutePortsLocationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at -// said peering location. -// Parameters: -// locationName - name of the requested ExpressRoutePort peering location. -func (client ExpressRoutePortsLocationsClient) Get(ctx context.Context, locationName string) (result ExpressRoutePortsLocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRoutePortsLocationsClient) GetPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsLocationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsLocationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortsLocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. -// Available bandwidths can only be obtained when retrieving a specific peering location. -func (client ExpressRoutePortsLocationsClient) List(ctx context.Context) (result ExpressRoutePortsLocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.List") - defer func() { - sc := -1 - if result.erpllr.Response.Response != nil { - sc = result.erpllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erpllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure sending request") - return - } - - result.erpllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure responding to request") - return - } - if result.erpllr.hasNextLink() && result.erpllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRoutePortsLocationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsLocationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsLocationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortsLocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsLocationsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortsLocationListResult) (result ExpressRoutePortsLocationListResult, err error) { - req, err := lastResults.expressRoutePortsLocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsLocationsClient) ListComplete(ctx context.Context) (result ExpressRoutePortsLocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteserviceproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteserviceproviders.go deleted file mode 100644 index 6389f0cb36d3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressrouteserviceproviders.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteServiceProvidersClient is the network Client -type ExpressRouteServiceProvidersClient struct { - BaseClient -} - -// NewExpressRouteServiceProvidersClient creates an instance of the ExpressRouteServiceProvidersClient client. -func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient { - return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the ExpressRouteServiceProvidersClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { - return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all the available express route service providers. -func (client ExpressRouteServiceProvidersClient) List(ctx context.Context) (result ExpressRouteServiceProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProvidersClient.List") - defer func() { - sc := -1 - if result.ersplr.Response.Response != nil { - sc = result.ersplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ersplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending request") - return - } - - result.ersplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to request") - return - } - if result.ersplr.hasNextLink() && result.ersplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteServiceProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteServiceProvidersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteServiceProvidersClient) ListResponder(resp *http.Response) (result ExpressRouteServiceProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteServiceProvidersClient) listNextResults(ctx context.Context, lastResults ExpressRouteServiceProviderListResult) (result ExpressRouteServiceProviderListResult, err error) { - req, err := lastResults.expressRouteServiceProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteServiceProvidersClient) ListComplete(ctx context.Context) (result ExpressRouteServiceProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProvidersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/flowlogs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/flowlogs.go deleted file mode 100644 index ee2bd4dc85d2..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/flowlogs.go +++ /dev/null @@ -1,400 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FlowLogsClient is the network Client -type FlowLogsClient struct { - BaseClient -} - -// NewFlowLogsClient creates an instance of the FlowLogsClient client. -func NewFlowLogsClient(subscriptionID string) FlowLogsClient { - return NewFlowLogsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFlowLogsClientWithBaseURI creates an instance of the FlowLogsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFlowLogsClientWithBaseURI(baseURI string, subscriptionID string) FlowLogsClient { - return FlowLogsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a flow log for the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log. -// parameters - parameters that define the create or update flow log resource. -func (client FlowLogsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog) (result FlowLogsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FlowLogPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FlowLogPropertiesFormat.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogPropertiesFormat.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.FlowLogsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FlowLogsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) CreateOrUpdateSender(req *http.Request) (future FlowLogsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) CreateOrUpdateResponder(resp *http.Response) (result FlowLog, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified flow log resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log resource. -func (client FlowLogsClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (result FlowLogsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, flowLogName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FlowLogsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) DeleteSender(req *http.Request) (future FlowLogsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a flow log resource by name. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log resource. -func (client FlowLogsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (result FlowLog, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, flowLogName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FlowLogsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) GetResponder(resp *http.Response) (result FlowLog, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all flow log resources for the specified Network Watcher. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -func (client FlowLogsClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result FlowLogListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.List") - defer func() { - sc := -1 - if result.fllr.Response.Response != nil { - sc = result.fllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", resp, "Failure sending request") - return - } - - result.fllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", resp, "Failure responding to request") - return - } - if result.fllr.hasNextLink() && result.fllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FlowLogsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) ListResponder(resp *http.Response) (result FlowLogListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FlowLogsClient) listNextResults(ctx context.Context, lastResults FlowLogListResult) (result FlowLogListResult, err error) { - req, err := lastResults.flowLogListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FlowLogsClient) ListComplete(ctx context.Context, resourceGroupName string, networkWatcherName string) (result FlowLogListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkWatcherName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubroutetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubroutetables.go deleted file mode 100644 index 82a484099046..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubroutetables.go +++ /dev/null @@ -1,391 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// HubRouteTablesClient is the network Client -type HubRouteTablesClient struct { - BaseClient -} - -// NewHubRouteTablesClient creates an instance of the HubRouteTablesClient client. -func NewHubRouteTablesClient(subscriptionID string) HubRouteTablesClient { - return NewHubRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHubRouteTablesClientWithBaseURI creates an instance of the HubRouteTablesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewHubRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) HubRouteTablesClient { - return HubRouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -// routeTableParameters - parameters supplied to create or update RouteTable. -func (client HubRouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable) (result HubRouteTablesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HubRouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeTableParameters.Etag = nil - routeTableParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithJSON(routeTableParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) CreateOrUpdateSender(req *http.Request) (future HubRouteTablesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result HubRouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the RouteTable. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -func (client HubRouteTablesClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result HubRouteTablesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HubRouteTablesClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) DeleteSender(req *http.Request) (future HubRouteTablesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -func (client HubRouteTablesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result HubRouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client HubRouteTablesClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) GetResponder(resp *http.Response) (result HubRouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all RouteTables. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client HubRouteTablesClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubRouteTablesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.List") - defer func() { - sc := -1 - if result.lhrtr.Response.Response != nil { - sc = result.lhrtr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lhrtr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", resp, "Failure sending request") - return - } - - result.lhrtr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", resp, "Failure responding to request") - return - } - if result.lhrtr.hasNextLink() && result.lhrtr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client HubRouteTablesClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) ListResponder(resp *http.Response) (result ListHubRouteTablesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client HubRouteTablesClient) listNextResults(ctx context.Context, lastResults ListHubRouteTablesResult) (result ListHubRouteTablesResult, err error) { - req, err := lastResults.listHubRouteTablesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client HubRouteTablesClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubRouteTablesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubvirtualnetworkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubvirtualnetworkconnections.go deleted file mode 100644 index 4ece8ae0e607..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/hubvirtualnetworkconnections.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// HubVirtualNetworkConnectionsClient is the network Client -type HubVirtualNetworkConnectionsClient struct { - BaseClient -} - -// NewHubVirtualNetworkConnectionsClient creates an instance of the HubVirtualNetworkConnectionsClient client. -func NewHubVirtualNetworkConnectionsClient(subscriptionID string) HubVirtualNetworkConnectionsClient { - return NewHubVirtualNetworkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHubVirtualNetworkConnectionsClientWithBaseURI creates an instance of the HubVirtualNetworkConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewHubVirtualNetworkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) HubVirtualNetworkConnectionsClient { - return HubVirtualNetworkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a hub virtual network connection if it doesn't exist else updates the existing one. -// Parameters: -// resourceGroupName - the resource group name of the HubVirtualNetworkConnection. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the HubVirtualNetworkConnection. -// hubVirtualNetworkConnectionParameters - parameters supplied to create or update a hub virtual network -// connection. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection) (result HubVirtualNetworkConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - hubVirtualNetworkConnectionParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithJSON(hubVirtualNetworkConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdateSender(req *http.Request) (future HubVirtualNetworkConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a HubVirtualNetworkConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the HubVirtualNetworkConnection. -func (client HubVirtualNetworkConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result HubVirtualNetworkConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HubVirtualNetworkConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) DeleteSender(req *http.Request) (future HubVirtualNetworkConnectionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a HubVirtualNetworkConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the vpn connection. -func (client HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result HubVirtualNetworkConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) GetResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all HubVirtualNetworkConnections. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client HubVirtualNetworkConnectionsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.List") - defer func() { - sc := -1 - if result.lhvncr.Response.Response != nil { - sc = result.lhvncr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lhvncr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.lhvncr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.lhvncr.hasNextLink() && result.lhvncr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) ListResponder(resp *http.Response) (result ListHubVirtualNetworkConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client HubVirtualNetworkConnectionsClient) listNextResults(ctx context.Context, lastResults ListHubVirtualNetworkConnectionsResult) (result ListHubVirtualNetworkConnectionsResult, err error) { - req, err := lastResults.listHubVirtualNetworkConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client HubVirtualNetworkConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/inboundnatrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/inboundnatrules.go deleted file mode 100644 index 9080954c5105..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/inboundnatrules.go +++ /dev/null @@ -1,415 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InboundNatRulesClient is the network Client -type InboundNatRulesClient struct { - BaseClient -} - -// NewInboundNatRulesClient creates an instance of the InboundNatRulesClient client. -func NewInboundNatRulesClient(subscriptionID string) InboundNatRulesClient { - return NewInboundNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInboundNatRulesClientWithBaseURI creates an instance of the InboundNatRulesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string) InboundNatRulesClient { - return InboundNatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer inbound nat rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. -// inboundNatRuleParameters - parameters supplied to the create or update inbound nat rule operation. -func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (result InboundNatRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: inboundNatRuleParameters, - Constraints: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.InboundNatRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - inboundNatRuleParameters.Etag = nil - inboundNatRuleParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithJSON(inboundNatRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (future InboundNatRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result InboundNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer inbound nat rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. -func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (result InboundNatRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future InboundNatRulesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified load balancer inbound nat rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound nat rule. -// expand - expands referenced resources. -func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InboundNatRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result InboundNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the inbound nat rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.List") - defer func() { - sc := -1 - if result.inrlr.Response.Response != nil { - sc = result.inrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.inrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure sending request") - return - } - - result.inrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to request") - return - } - if result.inrlr.hasNextLink() && result.inrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InboundNatRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) ListResponder(resp *http.Response) (result InboundNatRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InboundNatRulesClient) listNextResults(ctx context.Context, lastResults InboundNatRuleListResult) (result InboundNatRuleListResult, err error) { - req, err := lastResults.inboundNatRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InboundNatRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceipconfigurations.go deleted file mode 100644 index 80e5617b14c1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceipconfigurations.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceIPConfigurationsClient is the network Client -type InterfaceIPConfigurationsClient struct { - BaseClient -} - -// NewInterfaceIPConfigurationsClient creates an instance of the InterfaceIPConfigurationsClient client. -func NewInterfaceIPConfigurationsClient(subscriptionID string) InterfaceIPConfigurationsClient { - return NewInterfaceIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceIPConfigurationsClientWithBaseURI creates an instance of the InterfaceIPConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewInterfaceIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) InterfaceIPConfigurationsClient { - return InterfaceIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified network interface ip configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the ip configuration name. -func (client InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (result InterfaceIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, IPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfaceIPConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all ip configurations in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.iiclr.Response.Response != nil { - sc = result.iiclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.iiclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.iiclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceIPConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceIPConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceIPConfigurationsClient) listNextResults(ctx context.Context, lastResults InterfaceIPConfigurationListResult) (result InterfaceIPConfigurationListResult, err error) { - req, err := lastResults.interfaceIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceIPConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacesgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacesgroup.go deleted file mode 100644 index b9dc40194c59..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacesgroup.go +++ /dev/null @@ -1,1271 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfacesClient is the network Client -type InterfacesClient struct { - BaseClient -} - -// NewInterfacesClient creates an instance of the InterfacesClient client. -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// parameters - parameters supplied to the create or update network interface operation. -func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface) (result InterfacesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkInterfaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future InterfacesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) DeleteSender(req *http.Request) (future InterfacesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InterfacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfacesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEffectiveRouteTable gets all route tables applied to a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) GetEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesGetEffectiveRouteTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetEffectiveRouteTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetEffectiveRouteTablePreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", nil, "Failure preparing request") - return - } - - result, err = client.GetEffectiveRouteTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", nil, "Failure sending request") - return - } - - return -} - -// GetEffectiveRouteTablePreparer prepares the GetEffectiveRouteTable request. -func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEffectiveRouteTableSender sends the GetEffectiveRouteTable request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) (future InterfacesGetEffectiveRouteTableFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetEffectiveRouteTableResponder handles the response to the GetEffectiveRouteTable request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Response) (result EffectiveRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetIPConfiguration get the specified network interface ip configuration in a virtual machine -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the ip configuration. -// expand - expands referenced resources. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (result InterfaceIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetVirtualMachineScaleSetIPConfiguration") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetIPConfigurationPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetIPConfigurationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetIPConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetIPConfigurationPreparer prepares the GetVirtualMachineScaleSetIPConfiguration request. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetIPConfigurationSender sends the GetVirtualMachineScaleSetIPConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetIPConfigurationResponder handles the response to the GetVirtualMachineScaleSetIPConfiguration request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetNetworkInterface get the specified network interface in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetVirtualMachineScaleSetNetworkInterface") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetNetworkInterfaceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetNetworkInterfaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetNetworkInterfacePreparer prepares the GetVirtualMachineScaleSetNetworkInterface request. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetNetworkInterfaceSender sends the GetVirtualMachineScaleSetNetworkInterface request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetNetworkInterfaceResponder handles the response to the GetVirtualMachineScaleSetNetworkInterface request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network interfaces in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client InterfacesClient) List(ctx context.Context, resourceGroupName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfacesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListComplete(ctx context.Context, resourceGroupName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all network interfaces in a subscription. -func (client InterfacesClient) ListAll(ctx context.Context) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListAll") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client InterfacesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListAllResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listAllNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListAllComplete(ctx context.Context) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListEffectiveNetworkSecurityGroups gets all network security groups applied to a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesListEffectiveNetworkSecurityGroupsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListEffectiveNetworkSecurityGroups") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListEffectiveNetworkSecurityGroupsPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", nil, "Failure preparing request") - return - } - - result, err = client.ListEffectiveNetworkSecurityGroupsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", nil, "Failure sending request") - return - } - - return -} - -// ListEffectiveNetworkSecurityGroupsPreparer prepares the ListEffectiveNetworkSecurityGroups request. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListEffectiveNetworkSecurityGroupsSender sends the ListEffectiveNetworkSecurityGroups request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *http.Request) (future InterfacesListEffectiveNetworkSecurityGroupsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListEffectiveNetworkSecurityGroupsResponder handles the response to the ListEffectiveNetworkSecurityGroups request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp *http.Response) (result EffectiveNetworkSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVirtualMachineScaleSetIPConfigurations get the specified network interface ip configuration in a virtual machine -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetIPConfigurations") - defer func() { - sc := -1 - if result.iiclr.Response.Response != nil { - sc = result.iiclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetIPConfigurationsNextResults - req, err := client.ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetIPConfigurationsSender(req) - if err != nil { - result.iiclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure sending request") - return - } - - result.iiclr, err = client.ListVirtualMachineScaleSetIPConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure responding to request") - return - } - if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetIPConfigurationsPreparer prepares the ListVirtualMachineScaleSetIPConfigurations request. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetIPConfigurationsSender sends the ListVirtualMachineScaleSetIPConfigurations request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetIPConfigurationsResponder handles the response to the ListVirtualMachineScaleSetIPConfigurations request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetIPConfigurationsNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetIPConfigurationsNextResults(ctx context.Context, lastResults InterfaceIPConfigurationListResult) (result InterfaceIPConfigurationListResult, err error) { - req, err := lastResults.interfaceIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetIPConfigurationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetIPConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetIPConfigurationsComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetIPConfigurations") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetIPConfigurations(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - return -} - -// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetNetworkInterfacesNextResults - req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetNetworkInterfaces request. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetNetworkInterfacesSender sends the ListVirtualMachineScaleSetNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, resourceGroupName, virtualMachineScaleSetName) - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all network interfaces in a virtual machine in -// a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetVMNetworkInterfacesNextResults - req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetVMNetworkInterfaces request. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesSender sends the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetVMNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) - return -} - -// UpdateTags updates a network interface tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// parameters - parameters supplied to update network interface tags. -func (client InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkInterfaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client InterfacesClient) UpdateTagsResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacetapconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacetapconfigurations.go deleted file mode 100644 index 07958249b770..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfacetapconfigurations.go +++ /dev/null @@ -1,428 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceTapConfigurationsClient is the network Client -type InterfaceTapConfigurationsClient struct { - BaseClient -} - -// NewInterfaceTapConfigurationsClient creates an instance of the InterfaceTapConfigurationsClient client. -func NewInterfaceTapConfigurationsClient(subscriptionID string) InterfaceTapConfigurationsClient { - return NewInterfaceTapConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceTapConfigurationsClientWithBaseURI creates an instance of the InterfaceTapConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewInterfaceTapConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) InterfaceTapConfigurationsClient { - return InterfaceTapConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Tap configuration in the specified NetworkInterface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -// tapConfigurationParameters - parameters supplied to the create or update tap configuration operation. -func (client InterfaceTapConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration) (result InterfaceTapConfigurationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: tapConfigurationParameters, - Constraints: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.InterfaceTapConfigurationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InterfaceTapConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - tapConfigurationParameters.Etag = nil - tapConfigurationParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithJSON(tapConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future InterfaceTapConfigurationsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified tap configuration from the NetworkInterface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -func (client InterfaceTapConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (result InterfaceTapConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InterfaceTapConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) DeleteSender(req *http.Request) (future InterfaceTapConfigurationsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified tap configuration on a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -func (client InterfaceTapConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (result InterfaceTapConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfaceTapConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all Tap configurations in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceTapConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceTapConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.List") - defer func() { - sc := -1 - if result.itclr.Response.Response != nil { - sc = result.itclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.itclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.itclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.itclr.hasNextLink() && result.itclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceTapConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceTapConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceTapConfigurationsClient) listNextResults(ctx context.Context, lastResults InterfaceTapConfigurationListResult) (result InterfaceTapConfigurationListResult, err error) { - req, err := lastResults.interfaceTapConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceTapConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceTapConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipgroups.go deleted file mode 100644 index f55be1852fe7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipgroups.go +++ /dev/null @@ -1,579 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// IPGroupsClient is the network Client -type IPGroupsClient struct { - BaseClient -} - -// NewIPGroupsClient creates an instance of the IPGroupsClient client. -func NewIPGroupsClient(subscriptionID string) IPGroupsClient { - return NewIPGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIPGroupsClientWithBaseURI creates an instance of the IPGroupsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIPGroupsClientWithBaseURI(baseURI string, subscriptionID string) IPGroupsClient { - return IPGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an ipGroups in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// parameters - parameters supplied to the create or update IpGroups operation. -func (client IPGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters IPGroup) (result IPGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, IPGroupsName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IPGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters IPGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) CreateOrUpdateSender(req *http.Request) (future IPGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ipGroups. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -func (client IPGroupsClient) Delete(ctx context.Context, resourceGroupName string, IPGroupsName string) (result IPGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, IPGroupsName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IPGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, IPGroupsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) DeleteSender(req *http.Request) (future IPGroupsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified ipGroups. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// expand - expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups -// resource. -func (client IPGroupsClient) Get(ctx context.Context, resourceGroupName string, IPGroupsName string, expand string) (result IPGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, IPGroupsName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IPGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) GetResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all IpGroups in a subscription. -func (client IPGroupsClient) List(ctx context.Context) (result IPGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.List") - defer func() { - sc := -1 - if result.iglr.Response.Response != nil { - sc = result.iglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.iglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", resp, "Failure sending request") - return - } - - result.iglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.iglr.hasNextLink() && result.iglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IPGroupsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) ListResponder(resp *http.Response) (result IPGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client IPGroupsClient) listNextResults(ctx context.Context, lastResults IPGroupListResult) (result IPGroupListResult, err error) { - req, err := lastResults.iPGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPGroupsClient) ListComplete(ctx context.Context) (result IPGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all IpGroups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client IPGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result IPGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.iglr.Response.Response != nil { - sc = result.iglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.iglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.iglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.iglr.hasNextLink() && result.iglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client IPGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result IPGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client IPGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IPGroupListResult) (result IPGroupListResult, err error) { - req, err := lastResults.iPGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result IPGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateGroups updates tags of an IpGroups resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// parameters - parameters supplied to the update ipGroups operation. -func (client IPGroupsClient) UpdateGroups(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters TagsObject) (result IPGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.UpdateGroups") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateGroupsPreparer(ctx, resourceGroupName, IPGroupsName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateGroupsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", resp, "Failure sending request") - return - } - - result, err = client.UpdateGroupsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", resp, "Failure responding to request") - return - } - - return -} - -// UpdateGroupsPreparer prepares the UpdateGroups request. -func (client IPGroupsClient) UpdateGroupsPreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateGroupsSender sends the UpdateGroups request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) UpdateGroupsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateGroupsResponder handles the response to the UpdateGroups request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) UpdateGroupsResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerfrontendipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerfrontendipconfigurations.go deleted file mode 100644 index 2c0f7428760a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerfrontendipconfigurations.go +++ /dev/null @@ -1,229 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerFrontendIPConfigurationsClient is the network Client -type LoadBalancerFrontendIPConfigurationsClient struct { - BaseClient -} - -// NewLoadBalancerFrontendIPConfigurationsClient creates an instance of the LoadBalancerFrontendIPConfigurationsClient -// client. -func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { - return NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI creates an instance of the -// LoadBalancerFrontendIPConfigurationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { - return LoadBalancerFrontendIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets load balancer frontend IP configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// frontendIPConfigurationName - the name of the frontend IP configuration. -func (client LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (result FrontendIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontendIPConfigurationName": autorest.Encode("path", frontendIPConfigurationName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerFrontendIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http.Response) (result FrontendIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer frontend IP configurations. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.lbficlr.Response.Response != nil { - sc = result.lbficlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbficlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.lbficlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.lbficlr.hasNextLink() && result.lbficlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerFrontendIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerFrontendIPConfigurationsClient) ListResponder(resp *http.Response) (result LoadBalancerFrontendIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerFrontendIPConfigurationsClient) listNextResults(ctx context.Context, lastResults LoadBalancerFrontendIPConfigurationListResult) (result LoadBalancerFrontendIPConfigurationListResult, err error) { - req, err := lastResults.loadBalancerFrontendIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerFrontendIPConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerloadbalancingrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerloadbalancingrules.go deleted file mode 100644 index 3e12015fb6e2..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerloadbalancingrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerLoadBalancingRulesClient is the network Client -type LoadBalancerLoadBalancingRulesClient struct { - BaseClient -} - -// NewLoadBalancerLoadBalancingRulesClient creates an instance of the LoadBalancerLoadBalancingRulesClient client. -func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string) LoadBalancerLoadBalancingRulesClient { - return NewLoadBalancerLoadBalancingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerLoadBalancingRulesClientWithBaseURI creates an instance of the LoadBalancerLoadBalancingRulesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerLoadBalancingRulesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerLoadBalancingRulesClient { - return LoadBalancerLoadBalancingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified load balancer load balancing rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// loadBalancingRuleName - the name of the load balancing rule. -func (client LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (result LoadBalancingRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "loadBalancingRuleName": autorest.Encode("path", loadBalancingRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerLoadBalancingRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Response) (result LoadBalancingRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancing rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.List") - defer func() { - sc := -1 - if result.lblbrlr.Response.Response != nil { - sc = result.lblbrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lblbrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure sending request") - return - } - - result.lblbrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to request") - return - } - if result.lblbrlr.hasNextLink() && result.lblbrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerLoadBalancingRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerLoadBalancingRulesClient) ListResponder(resp *http.Response) (result LoadBalancerLoadBalancingRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerLoadBalancingRulesClient) listNextResults(ctx context.Context, lastResults LoadBalancerLoadBalancingRuleListResult) (result LoadBalancerLoadBalancingRuleListResult, err error) { - req, err := lastResults.loadBalancerLoadBalancingRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerLoadBalancingRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancernetworkinterfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancernetworkinterfaces.go deleted file mode 100644 index d1e1103a6483..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancernetworkinterfaces.go +++ /dev/null @@ -1,150 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerNetworkInterfacesClient is the network Client -type LoadBalancerNetworkInterfacesClient struct { - BaseClient -} - -// NewLoadBalancerNetworkInterfacesClient creates an instance of the LoadBalancerNetworkInterfacesClient client. -func NewLoadBalancerNetworkInterfacesClient(subscriptionID string) LoadBalancerNetworkInterfacesClient { - return NewLoadBalancerNetworkInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerNetworkInterfacesClientWithBaseURI creates an instance of the LoadBalancerNetworkInterfacesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerNetworkInterfacesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerNetworkInterfacesClient { - return LoadBalancerNetworkInterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets associated load balancer network interfaces. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerNetworkInterfacesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerNetworkInterfacesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerNetworkInterfacesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerNetworkInterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerNetworkInterfacesClient) listNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerNetworkInterfacesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerNetworkInterfacesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancers.go deleted file mode 100644 index 641ca7124bd0..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancers.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancersClient is the network Client -type LoadBalancersClient struct { - BaseClient -} - -// NewLoadBalancersClient creates an instance of the LoadBalancersClient client. -func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { - return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient { - return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// parameters - parameters supplied to the create or update load balancer operation. -func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// expand - expands referenced resources. -func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") - defer func() { - sc := -1 - if result.lblr.Response.Response != nil { - sc = result.lblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending request") - return - } - - result.lblr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request") - return - } - if result.lblr.hasNextLink() && result.lblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancersClient) listNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { - req, err := lastResults.loadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the load balancers in a subscription. -func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") - defer func() { - sc := -1 - if result.lblr.Response.Response != nil { - sc = result.lblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.lblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending request") - return - } - - result.lblr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request") - return - } - if result.lblr.hasNextLink() && result.lblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client LoadBalancersClient) listAllNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { - req, err := lastResults.loadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result LoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates a load balancer tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// parameters - parameters supplied to update load balancer tags. -func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) UpdateTagsResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/models.go deleted file mode 100644 index fdd00f9215c8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/models.go +++ /dev/null @@ -1,45250 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network" - -// AadAuthenticationParameters AAD Vpn authentication type related parameters. -type AadAuthenticationParameters struct { - // AadTenant - AAD Vpn authentication parameter AAD tenant. - AadTenant *string `json:"aadTenant,omitempty"` - // AadAudience - AAD Vpn authentication parameter AAD audience. - AadAudience *string `json:"aadAudience,omitempty"` - // AadIssuer - AAD Vpn authentication parameter AAD issuer. - AadIssuer *string `json:"aadIssuer,omitempty"` -} - -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the -// virtual network. -type AddressSpace struct { - // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} - -// ApplicationGateway application gateway resource. -type ApplicationGateway struct { - autorest.Response `json:"-"` - // ApplicationGatewayPropertiesFormat - Properties of the application gateway. - *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting where the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // Identity - The identity of the application gateway, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGateway. -func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ag.ApplicationGatewayPropertiesFormat != nil { - objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat - } - if ag.Zones != nil { - objectMap["zones"] = ag.Zones - } - if ag.Identity != nil { - objectMap["identity"] = ag.Identity - } - if ag.ID != nil { - objectMap["id"] = ag.ID - } - if ag.Location != nil { - objectMap["location"] = ag.Location - } - if ag.Tags != nil { - objectMap["tags"] = ag.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. -func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) - if err != nil { - return err - } - ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ag.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ag.Zones = &zones - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - ag.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ag.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ag.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ag.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ag.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ag.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. -type ApplicationGatewayAuthenticationCertificate struct { - // ApplicationGatewayAuthenticationCertificatePropertiesFormat - Properties of the application gateway authentication certificate. - *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the authentication certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. -func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { - objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat - } - if agac.Name != nil { - objectMap["name"] = agac.Name - } - if agac.ID != nil { - objectMap["id"] = agac.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. -func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) - if err != nil { - return err - } - agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agac.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agac.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agac.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agac.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an -// application gateway. -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificatePropertiesFormat. -func (agacpf ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agacpf.Data != nil { - objectMap["data"] = agacpf.Data - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. -type ApplicationGatewayAutoscaleConfiguration struct { - // MinCapacity - Lower bound on number of Application Gateway capacity. - MinCapacity *int32 `json:"minCapacity,omitempty"` - // MaxCapacity - Upper bound on number of Application Gateway capacity. - MaxCapacity *int32 `json:"maxCapacity,omitempty"` -} - -// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service -// call. -type ApplicationGatewayAvailableSslOptions struct { - autorest.Response `json:"-"` - // ApplicationGatewayAvailableSslOptionsPropertiesFormat - Properties of the application gateway available SSL options. - *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. -func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { - objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat - } - if agaso.ID != nil { - objectMap["id"] = agaso.ID - } - if agaso.Location != nil { - objectMap["location"] = agaso.Location - } - if agaso.Tags != nil { - objectMap["tags"] = agaso.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. -func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) - if err != nil { - return err - } - agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agaso.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agaso.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agaso.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - agaso.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - agaso.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of -// ApplicationGatewayAvailableSslOptions. -type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { - // PredefinedPolicies - List of available Ssl predefined policy. - PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` - // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` - // AvailableCipherSuites - List of available Ssl cipher suites. - AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` - // AvailableProtocols - List of available Ssl protocols. - AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` -} - -// ApplicationGatewayAvailableSslPredefinedPolicies response for ApplicationGatewayAvailableSslOptions API -// service call. -type ApplicationGatewayAvailableSslPredefinedPolicies struct { - autorest.Response `json:"-"` - // Value - List of available Ssl predefined policy. - Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayAvailableSslPredefinedPoliciesIterator provides access to a complete listing of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct { - i int - page ApplicationGatewayAvailableSslPredefinedPoliciesPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy { - if !iter.page.NotDone() { - return ApplicationGatewaySslPredefinedPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesIterator type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator { - return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { - return agaspp.Value == nil || len(*agaspp.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { - return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 -} - -// applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - if !agaspp.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agaspp.NextLink))) -} - -// ApplicationGatewayAvailableSslPredefinedPoliciesPage contains a page of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct { - fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error) - agaspp ApplicationGatewayAvailableSslPredefinedPolicies -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agaspp) - if err != nil { - return err - } - page.agaspp = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool { - return !page.agaspp.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies { - return page.agaspp -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy { - if page.agaspp.IsEmpty() { - return nil - } - return *page.agaspp.Value -} - -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { - return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ - fn: getNextPage, - agaspp: cur, - } -} - -// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API -// service call. -type ApplicationGatewayAvailableWafRuleSetsResult struct { - autorest.Response `json:"-"` - // Value - The list of application gateway rule sets. - Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` -} - -// ApplicationGatewayBackendAddress backend address of an application gateway. -type ApplicationGatewayBackendAddress struct { - // Fqdn - Fully qualified domain name (FQDN). - Fqdn *string `json:"fqdn,omitempty"` - // IPAddress - IP address. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. -type ApplicationGatewayBackendAddressPool struct { - // ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of the application gateway backend address pool. - *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend address pool that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. -func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { - objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat - } - if agbap.Name != nil { - objectMap["name"] = agbap.Name - } - if agbap.ID != nil { - objectMap["id"] = agbap.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. -func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) - if err != nil { - return err - } - agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agbap.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agbap.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agbap.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agbap.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an -// application gateway. -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - // BackendIPConfigurations - READ-ONLY; Collection of references to IPs defined in network interfaces. - BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - // BackendAddresses - Backend addresses. - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPoolPropertiesFormat. -func (agbappf ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbappf.BackendAddresses != nil { - objectMap["backendAddresses"] = agbappf.BackendAddresses - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayBackendHealth response for ApplicationGatewayBackendHealth API service call. -type ApplicationGatewayBackendHealth struct { - autorest.Response `json:"-"` - // BackendAddressPools - A list of ApplicationGatewayBackendHealthPool resources. - BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} - -// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. -type ApplicationGatewayBackendHealthHTTPSettings struct { - // BackendHTTPSettings - Reference to an ApplicationGatewayBackendHttpSettings resource. - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - // Servers - List of ApplicationGatewayBackendHealthServer resources. - Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} - -// ApplicationGatewayBackendHealthOnDemand result of on demand test probe. -type ApplicationGatewayBackendHealthOnDemand struct { - autorest.Response `json:"-"` - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} - -// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. -type ApplicationGatewayBackendHealthPool struct { - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} - -// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. -type ApplicationGatewayBackendHealthServer struct { - // Address - IP address or FQDN of backend server. - Address *string `json:"address,omitempty"` - // IPConfiguration - Reference to IP configuration of backend server. - IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` - // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' - Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - // HealthProbeLog - Health Probe Log. - HealthProbeLog *string `json:"healthProbeLog,omitempty"` -} - -// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. -type ApplicationGatewayBackendHTTPSettings struct { - // ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of the application gateway backend HTTP settings. - *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend http settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. -func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { - objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat - } - if agbhs.Name != nil { - objectMap["name"] = agbhs.Name - } - if agbhs.ID != nil { - objectMap["id"] = agbhs.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. -func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) - if err != nil { - return err - } - agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agbhs.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agbhs.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agbhs.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agbhs.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an -// application gateway. -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - // Port - The destination port on the backend. - Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' - CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - RequestTimeout *int32 `json:"requestTimeout,omitempty"` - // Probe - Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - // AuthenticationCertificates - Array of references to application gateway authentication certificates. - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - // TrustedRootCertificates - Array of references to application gateway trusted root certificates. - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` - // ConnectionDraining - Connection draining of the backend http settings resource. - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - // HostName - Host header to be sent to the backend servers. - HostName *string `json:"hostName,omitempty"` - // PickHostNameFromBackendAddress - Whether to pick host header should be picked from the host name of the backend server. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - // AffinityCookieName - Cookie name to use for the affinity cookie. - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - // ProbeEnabled - Whether the probe is enabled. Default value is false. - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. - Path *string `json:"path,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettingsPropertiesFormat. -func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbhspf.Port != nil { - objectMap["port"] = agbhspf.Port - } - if agbhspf.Protocol != "" { - objectMap["protocol"] = agbhspf.Protocol - } - if agbhspf.CookieBasedAffinity != "" { - objectMap["cookieBasedAffinity"] = agbhspf.CookieBasedAffinity - } - if agbhspf.RequestTimeout != nil { - objectMap["requestTimeout"] = agbhspf.RequestTimeout - } - if agbhspf.Probe != nil { - objectMap["probe"] = agbhspf.Probe - } - if agbhspf.AuthenticationCertificates != nil { - objectMap["authenticationCertificates"] = agbhspf.AuthenticationCertificates - } - if agbhspf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agbhspf.TrustedRootCertificates - } - if agbhspf.ConnectionDraining != nil { - objectMap["connectionDraining"] = agbhspf.ConnectionDraining - } - if agbhspf.HostName != nil { - objectMap["hostName"] = agbhspf.HostName - } - if agbhspf.PickHostNameFromBackendAddress != nil { - objectMap["pickHostNameFromBackendAddress"] = agbhspf.PickHostNameFromBackendAddress - } - if agbhspf.AffinityCookieName != nil { - objectMap["affinityCookieName"] = agbhspf.AffinityCookieName - } - if agbhspf.ProbeEnabled != nil { - objectMap["probeEnabled"] = agbhspf.ProbeEnabled - } - if agbhspf.Path != nil { - objectMap["path"] = agbhspf.Path - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to -// be active for a specified time after the backend server got removed from the configuration. -type ApplicationGatewayConnectionDraining struct { - // Enabled - Whether connection draining is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. - DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` -} - -// ApplicationGatewayCustomError customer error of an application gateway. -type ApplicationGatewayCustomError struct { - // StatusCode - Status code of the application gateway customer error. Possible values include: 'HTTPStatus403', 'HTTPStatus502' - StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` - // CustomErrorPageURL - Error page URL of the application gateway customer error. - CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` -} - -// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire -// rule group. -type ApplicationGatewayFirewallDisabledRuleGroup struct { - // RuleGroupName - The name of the rule group that will be disabled. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. - Rules *[]int32 `json:"rules,omitempty"` -} - -// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF -// check. -type ApplicationGatewayFirewallExclusion struct { - // MatchVariable - The variable to be excluded. - MatchVariable *string `json:"matchVariable,omitempty"` - // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. - SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"` - // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. - Selector *string `json:"selector,omitempty"` -} - -// ApplicationGatewayFirewallRule a web application firewall rule. -type ApplicationGatewayFirewallRule struct { - // RuleID - The identifier of the web application firewall rule. - RuleID *int32 `json:"ruleId,omitempty"` - // Description - The description of the web application firewall rule. - Description *string `json:"description,omitempty"` -} - -// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. -type ApplicationGatewayFirewallRuleGroup struct { - // RuleGroupName - The name of the web application firewall rule group. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Description - The description of the web application firewall rule group. - Description *string `json:"description,omitempty"` - // Rules - The rules of the web application firewall rule group. - Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` -} - -// ApplicationGatewayFirewallRuleSet a web application firewall rule set. -type ApplicationGatewayFirewallRuleSet struct { - // ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the application gateway firewall rule set. - *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. -func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { - objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat - } - if agfrs.ID != nil { - objectMap["id"] = agfrs.ID - } - if agfrs.Location != nil { - objectMap["location"] = agfrs.Location - } - if agfrs.Tags != nil { - objectMap["tags"] = agfrs.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. -func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) - if err != nil { - return err - } - agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfrs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfrs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfrs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - agfrs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - agfrs.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // RuleSetType - The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroups - The rule groups of the web application firewall rule set. - RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSetPropertiesFormat. -func (agfrspf ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfrspf.RuleSetType != nil { - objectMap["ruleSetType"] = agfrspf.RuleSetType - } - if agfrspf.RuleSetVersion != nil { - objectMap["ruleSetVersion"] = agfrspf.RuleSetVersion - } - if agfrspf.RuleGroups != nil { - objectMap["ruleGroups"] = agfrspf.RuleGroups - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. -type ApplicationGatewayFrontendIPConfiguration struct { - // ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of the application gateway frontend IP configuration. - *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. -func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat - } - if agfic.Name != nil { - objectMap["name"] = agfic.Name - } - if agfic.ID != nil { - objectMap["id"] = agfic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. -func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) - if err != nil { - return err - } - agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agfic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an -// application gateway. -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference to the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // PrivateLinkConfiguration - Reference to the application gateway private link configuration. - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfigurationPropertiesFormat. -func (agficpf ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agficpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = agficpf.PrivateIPAddress - } - if agficpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = agficpf.PrivateIPAllocationMethod - } - if agficpf.Subnet != nil { - objectMap["subnet"] = agficpf.Subnet - } - if agficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = agficpf.PublicIPAddress - } - if agficpf.PrivateLinkConfiguration != nil { - objectMap["privateLinkConfiguration"] = agficpf.PrivateLinkConfiguration - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayFrontendPort frontend port of an application gateway. -type ApplicationGatewayFrontendPort struct { - // ApplicationGatewayFrontendPortPropertiesFormat - Properties of the application gateway frontend port. - *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend port that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. -func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { - objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat - } - if agfp.Name != nil { - objectMap["name"] = agfp.Name - } - if agfp.ID != nil { - objectMap["id"] = agfp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. -func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) - if err != nil { - return err - } - agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agfp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. -type ApplicationGatewayFrontendPortPropertiesFormat struct { - // Port - Frontend port. - Port *int32 `json:"port,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPortPropertiesFormat. -func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfppf.Port != nil { - objectMap["port"] = agfppf.Port - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayHeaderConfiguration header configuration of the Actions set in Application Gateway. -type ApplicationGatewayHeaderConfiguration struct { - // HeaderName - Header name of the header configuration. - HeaderName *string `json:"headerName,omitempty"` - // HeaderValue - Header value of the header configuration. - HeaderValue *string `json:"headerValue,omitempty"` -} - -// ApplicationGatewayHTTPListener http listener of an application gateway. -type ApplicationGatewayHTTPListener struct { - // ApplicationGatewayHTTPListenerPropertiesFormat - Properties of the application gateway HTTP listener. - *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the HTTP listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. -func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { - objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat - } - if aghl.Name != nil { - objectMap["name"] = aghl.Name - } - if aghl.ID != nil { - objectMap["id"] = aghl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. -func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) - if err != nil { - return err - } - aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - aghl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - aghl.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - aghl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - aghl.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // FrontendPort - Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the HTTP listener. Possible values include: 'HTTP', 'HTTPS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // HostName - Host name of HTTP listener. - HostName *string `json:"hostName,omitempty"` - // SslCertificate - SSL certificate resource of an application gateway. - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CustomErrorConfigurations - Custom error configurations of the HTTP listener. - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // HostNames - List of Host names for HTTP Listener that allows special wildcard characters as well. - HostNames *[]string `json:"hostNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListenerPropertiesFormat. -func (aghlpf ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aghlpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = aghlpf.FrontendIPConfiguration - } - if aghlpf.FrontendPort != nil { - objectMap["frontendPort"] = aghlpf.FrontendPort - } - if aghlpf.Protocol != "" { - objectMap["protocol"] = aghlpf.Protocol - } - if aghlpf.HostName != nil { - objectMap["hostName"] = aghlpf.HostName - } - if aghlpf.SslCertificate != nil { - objectMap["sslCertificate"] = aghlpf.SslCertificate - } - if aghlpf.RequireServerNameIndication != nil { - objectMap["requireServerNameIndication"] = aghlpf.RequireServerNameIndication - } - if aghlpf.CustomErrorConfigurations != nil { - objectMap["customErrorConfigurations"] = aghlpf.CustomErrorConfigurations - } - if aghlpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = aghlpf.FirewallPolicy - } - if aghlpf.HostNames != nil { - objectMap["hostNames"] = aghlpf.HostNames - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 -// private IP configuration is allowed. -type ApplicationGatewayIPConfiguration struct { - // ApplicationGatewayIPConfigurationPropertiesFormat - Properties of the application gateway IP configuration. - *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. -func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat - } - if agic.Name != nil { - objectMap["name"] = agic.Name - } - if agic.ID != nil { - objectMap["id"] = agic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. -func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) - if err != nil { - return err - } - agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application -// gateway. -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - // Subnet - Reference to the subnet resource. A subnet from where application gateway gets its private address. - Subnet *SubResource `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfigurationPropertiesFormat. -func (agicpf ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agicpf.Subnet != nil { - objectMap["subnet"] = agicpf.Subnet - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayListResult response for ListApplicationGateways API service call. -type ApplicationGatewayListResult struct { - autorest.Response `json:"-"` - // Value - List of an application gateways in a resource group. - Value *[]ApplicationGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. -type ApplicationGatewayListResultIterator struct { - i int - page ApplicationGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { - if !iter.page.NotDone() { - return ApplicationGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayListResultIterator type. -func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator { - return ApplicationGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aglr ApplicationGatewayListResult) IsEmpty() bool { - return aglr.Value == nil || len(*aglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aglr ApplicationGatewayListResult) hasNextLink() bool { - return aglr.NextLink != nil && len(*aglr.NextLink) != 0 -} - -// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aglr.NextLink))) -} - -// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. -type ApplicationGatewayListResultPage struct { - fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error) - aglr ApplicationGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aglr) - if err != nil { - return err - } - page.aglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayListResultPage) NotDone() bool { - return !page.aglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { - return page.aglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { - if page.aglr.IsEmpty() { - return nil - } - return *page.aglr.Value -} - -// Creates a new instance of the ApplicationGatewayListResultPage type. -func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { - return ApplicationGatewayListResultPage{ - fn: getNextPage, - aglr: cur, - } -} - -// ApplicationGatewayOnDemandProbe details of on demand test probe request. -type ApplicationGatewayOnDemandProbe struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Host - Host name to send the probe to. - Host *string `json:"host,omitempty"` - // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - // Timeout - The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - // Match - Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - // BackendAddressPool - Reference to backend pool of application gateway to which probe request will be sent. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Reference to backend http setting of application gateway to be used for test probe. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` -} - -// ApplicationGatewayPathRule path rule of URL path map of an application gateway. -type ApplicationGatewayPathRule struct { - // ApplicationGatewayPathRulePropertiesFormat - Properties of the application gateway path rule. - *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the path rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. -func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { - objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat - } - if agpr.Name != nil { - objectMap["name"] = agpr.Name - } - if agpr.ID != nil { - objectMap["id"] = agpr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. -func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) - if err != nil { - return err - } - agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agpr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agpr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agpr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agpr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPathRulePropertiesFormat properties of path rule of an application gateway. -type ApplicationGatewayPathRulePropertiesFormat struct { - // Paths - Path rules of URL path map. - Paths *[]string `json:"paths,omitempty"` - // BackendAddressPool - Backend address pool resource of URL path map path rule. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Backend http settings resource of URL path map path rule. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - // RedirectConfiguration - Redirect configuration resource of URL path map path rule. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - // RewriteRuleSet - Rewrite rule set resource of URL path map path rule. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the path rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPathRulePropertiesFormat. -func (agprpf ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agprpf.Paths != nil { - objectMap["paths"] = agprpf.Paths - } - if agprpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = agprpf.BackendAddressPool - } - if agprpf.BackendHTTPSettings != nil { - objectMap["backendHttpSettings"] = agprpf.BackendHTTPSettings - } - if agprpf.RedirectConfiguration != nil { - objectMap["redirectConfiguration"] = agprpf.RedirectConfiguration - } - if agprpf.RewriteRuleSet != nil { - objectMap["rewriteRuleSet"] = agprpf.RewriteRuleSet - } - if agprpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = agprpf.FirewallPolicy - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateEndpointConnection private Endpoint connection on an application gateway. -type ApplicationGatewayPrivateEndpointConnection struct { - autorest.Response `json:"-"` - // ApplicationGatewayPrivateEndpointConnectionProperties - Properties of the application gateway private endpoint connection. - *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - // Name - Name of the private endpoint connection on an application gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateEndpointConnection. -func (agpec ApplicationGatewayPrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpec.ApplicationGatewayPrivateEndpointConnectionProperties != nil { - objectMap["properties"] = agpec.ApplicationGatewayPrivateEndpointConnectionProperties - } - if agpec.Name != nil { - objectMap["name"] = agpec.Name - } - if agpec.ID != nil { - objectMap["id"] = agpec.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateEndpointConnection struct. -func (agpec *ApplicationGatewayPrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateEndpointConnectionProperties ApplicationGatewayPrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateEndpointConnectionProperties) - if err != nil { - return err - } - agpec.ApplicationGatewayPrivateEndpointConnectionProperties = &applicationGatewayPrivateEndpointConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agpec.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agpec.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agpec.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agpec.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateEndpointConnectionListResult response for -// ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections -// for an application gateway. -type ApplicationGatewayPrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - List of private endpoint connections on an application gateway. - Value *[]ApplicationGatewayPrivateEndpointConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayPrivateEndpointConnectionListResultIterator provides access to a complete listing of -// ApplicationGatewayPrivateEndpointConnection values. -type ApplicationGatewayPrivateEndpointConnectionListResultIterator struct { - i int - page ApplicationGatewayPrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayPrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayPrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) Response() ApplicationGatewayPrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) Value() ApplicationGatewayPrivateEndpointConnection { - if !iter.page.NotDone() { - return ApplicationGatewayPrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayPrivateEndpointConnectionListResultIterator type. -func NewApplicationGatewayPrivateEndpointConnectionListResultIterator(page ApplicationGatewayPrivateEndpointConnectionListResultPage) ApplicationGatewayPrivateEndpointConnectionListResultIterator { - return ApplicationGatewayPrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) IsEmpty() bool { - return agpeclr.Value == nil || len(*agpeclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) hasNextLink() bool { - return agpeclr.NextLink != nil && len(*agpeclr.NextLink) != 0 -} - -// applicationGatewayPrivateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) applicationGatewayPrivateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !agpeclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agpeclr.NextLink))) -} - -// ApplicationGatewayPrivateEndpointConnectionListResultPage contains a page of -// ApplicationGatewayPrivateEndpointConnection values. -type ApplicationGatewayPrivateEndpointConnectionListResultPage struct { - fn func(context.Context, ApplicationGatewayPrivateEndpointConnectionListResult) (ApplicationGatewayPrivateEndpointConnectionListResult, error) - agpeclr ApplicationGatewayPrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayPrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agpeclr) - if err != nil { - return err - } - page.agpeclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayPrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.agpeclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) Response() ApplicationGatewayPrivateEndpointConnectionListResult { - return page.agpeclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) Values() []ApplicationGatewayPrivateEndpointConnection { - if page.agpeclr.IsEmpty() { - return nil - } - return *page.agpeclr.Value -} - -// Creates a new instance of the ApplicationGatewayPrivateEndpointConnectionListResultPage type. -func NewApplicationGatewayPrivateEndpointConnectionListResultPage(cur ApplicationGatewayPrivateEndpointConnectionListResult, getNextPage func(context.Context, ApplicationGatewayPrivateEndpointConnectionListResult) (ApplicationGatewayPrivateEndpointConnectionListResult, error)) ApplicationGatewayPrivateEndpointConnectionListResultPage { - return ApplicationGatewayPrivateEndpointConnectionListResultPage{ - fn: getNextPage, - agpeclr: cur, - } -} - -// ApplicationGatewayPrivateEndpointConnectionProperties properties of Private Link Resource of an -// application gateway. -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // LinkIdentifier - READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateEndpointConnectionProperties. -func (agpecp ApplicationGatewayPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = agpecp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ApplicationGatewayPrivateEndpointConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewayPrivateEndpointConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewayPrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewayPrivateEndpointConnectionsDeleteFuture.Result. -func (future *ApplicationGatewayPrivateEndpointConnectionsDeleteFuture) result(client ApplicationGatewayPrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewayPrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewayPrivateEndpointConnectionsUpdateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ApplicationGatewayPrivateEndpointConnectionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewayPrivateEndpointConnectionsClient) (ApplicationGatewayPrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewayPrivateEndpointConnectionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewayPrivateEndpointConnectionsUpdateFuture.Result. -func (future *ApplicationGatewayPrivateEndpointConnectionsUpdateFuture) result(client ApplicationGatewayPrivateEndpointConnectionsClient) (agpec ApplicationGatewayPrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agpec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agpec.Response.Response, err = future.GetResult(sender); err == nil && agpec.Response.Response.StatusCode != http.StatusNoContent { - agpec, err = client.UpdateResponder(agpec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture", "Result", agpec.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewayPrivateLinkConfiguration private Link Configuration on an application gateway. -type ApplicationGatewayPrivateLinkConfiguration struct { - // ApplicationGatewayPrivateLinkConfigurationProperties - Properties of the application gateway private link configuration. - *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - // Name - Name of the private link configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkConfiguration. -func (agplc ApplicationGatewayPrivateLinkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplc.ApplicationGatewayPrivateLinkConfigurationProperties != nil { - objectMap["properties"] = agplc.ApplicationGatewayPrivateLinkConfigurationProperties - } - if agplc.Name != nil { - objectMap["name"] = agplc.Name - } - if agplc.ID != nil { - objectMap["id"] = agplc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkConfiguration struct. -func (agplc *ApplicationGatewayPrivateLinkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkConfigurationProperties ApplicationGatewayPrivateLinkConfigurationProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkConfigurationProperties) - if err != nil { - return err - } - agplc.ApplicationGatewayPrivateLinkConfigurationProperties = &applicationGatewayPrivateLinkConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkConfigurationProperties properties of private link configuration on an -// application gateway. -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - // IPConfigurations - An array of application gateway private link ip configurations. - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkConfigurationProperties. -func (agplcp ApplicationGatewayPrivateLinkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplcp.IPConfigurations != nil { - objectMap["ipConfigurations"] = agplcp.IPConfigurations - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateLinkIPConfiguration the application gateway private link ip configuration. -type ApplicationGatewayPrivateLinkIPConfiguration struct { - // ApplicationGatewayPrivateLinkIPConfigurationProperties - Properties of an application gateway private link ip configuration. - *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - // Name - The name of application gateway private link ip configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkIPConfiguration. -func (agplic ApplicationGatewayPrivateLinkIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties != nil { - objectMap["properties"] = agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties - } - if agplic.Name != nil { - objectMap["name"] = agplic.Name - } - if agplic.ID != nil { - objectMap["id"] = agplic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkIPConfiguration struct. -func (agplic *ApplicationGatewayPrivateLinkIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkIPConfigurationProperties ApplicationGatewayPrivateLinkIPConfigurationProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkIPConfigurationProperties) - if err != nil { - return err - } - agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties = &applicationGatewayPrivateLinkIPConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkIPConfigurationProperties properties of an application gateway private link -// IP configuration. -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // Primary - Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkIPConfigurationProperties. -func (agplicp ApplicationGatewayPrivateLinkIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplicp.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = agplicp.PrivateIPAddress - } - if agplicp.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = agplicp.PrivateIPAllocationMethod - } - if agplicp.Subnet != nil { - objectMap["subnet"] = agplicp.Subnet - } - if agplicp.Primary != nil { - objectMap["primary"] = agplicp.Primary - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateLinkResource privateLink Resource of an application gateway. -type ApplicationGatewayPrivateLinkResource struct { - // ApplicationGatewayPrivateLinkResourceProperties - Properties of the application gateway private link resource. - *ApplicationGatewayPrivateLinkResourceProperties `json:"properties,omitempty"` - // Name - Name of the private link resource that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkResource. -func (agplr ApplicationGatewayPrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplr.ApplicationGatewayPrivateLinkResourceProperties != nil { - objectMap["properties"] = agplr.ApplicationGatewayPrivateLinkResourceProperties - } - if agplr.Name != nil { - objectMap["name"] = agplr.Name - } - if agplr.ID != nil { - objectMap["id"] = agplr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkResource struct. -func (agplr *ApplicationGatewayPrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkResourceProperties ApplicationGatewayPrivateLinkResourceProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkResourceProperties) - if err != nil { - return err - } - agplr.ApplicationGatewayPrivateLinkResourceProperties = &applicationGatewayPrivateLinkResourceProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkResourceListResult response for ListApplicationGatewayPrivateLinkResources -// API service call. Gets all private link resources for an application gateway. -type ApplicationGatewayPrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - List of private link resources of an application gateway. - Value *[]ApplicationGatewayPrivateLinkResource `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayPrivateLinkResourceListResultIterator provides access to a complete listing of -// ApplicationGatewayPrivateLinkResource values. -type ApplicationGatewayPrivateLinkResourceListResultIterator struct { - i int - page ApplicationGatewayPrivateLinkResourceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayPrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayPrivateLinkResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) Response() ApplicationGatewayPrivateLinkResourceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) Value() ApplicationGatewayPrivateLinkResource { - if !iter.page.NotDone() { - return ApplicationGatewayPrivateLinkResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayPrivateLinkResourceListResultIterator type. -func NewApplicationGatewayPrivateLinkResourceListResultIterator(page ApplicationGatewayPrivateLinkResourceListResultPage) ApplicationGatewayPrivateLinkResourceListResultIterator { - return ApplicationGatewayPrivateLinkResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) IsEmpty() bool { - return agplrlr.Value == nil || len(*agplrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) hasNextLink() bool { - return agplrlr.NextLink != nil && len(*agplrlr.NextLink) != 0 -} - -// applicationGatewayPrivateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) applicationGatewayPrivateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !agplrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agplrlr.NextLink))) -} - -// ApplicationGatewayPrivateLinkResourceListResultPage contains a page of -// ApplicationGatewayPrivateLinkResource values. -type ApplicationGatewayPrivateLinkResourceListResultPage struct { - fn func(context.Context, ApplicationGatewayPrivateLinkResourceListResult) (ApplicationGatewayPrivateLinkResourceListResult, error) - agplrlr ApplicationGatewayPrivateLinkResourceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayPrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agplrlr) - if err != nil { - return err - } - page.agplrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayPrivateLinkResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) NotDone() bool { - return !page.agplrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) Response() ApplicationGatewayPrivateLinkResourceListResult { - return page.agplrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) Values() []ApplicationGatewayPrivateLinkResource { - if page.agplrlr.IsEmpty() { - return nil - } - return *page.agplrlr.Value -} - -// Creates a new instance of the ApplicationGatewayPrivateLinkResourceListResultPage type. -func NewApplicationGatewayPrivateLinkResourceListResultPage(cur ApplicationGatewayPrivateLinkResourceListResult, getNextPage func(context.Context, ApplicationGatewayPrivateLinkResourceListResult) (ApplicationGatewayPrivateLinkResourceListResult, error)) ApplicationGatewayPrivateLinkResourceListResultPage { - return ApplicationGatewayPrivateLinkResourceListResultPage{ - fn: getNextPage, - agplrlr: cur, - } -} - -// ApplicationGatewayPrivateLinkResourceProperties properties of a private link resource. -type ApplicationGatewayPrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; Group identifier of private link resource. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; Required member names of private link resource. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - Required DNS zone names of the the private link resource. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkResourceProperties. -func (agplrp ApplicationGatewayPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = agplrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayProbe probe of the application gateway. -type ApplicationGatewayProbe struct { - // ApplicationGatewayProbePropertiesFormat - Properties of the application gateway probe. - *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the probe that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. -func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agp.ApplicationGatewayProbePropertiesFormat != nil { - objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat - } - if agp.Name != nil { - objectMap["name"] = agp.Name - } - if agp.ID != nil { - objectMap["id"] = agp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. -func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) - if err != nil { - return err - } - agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayProbeHealthResponseMatch application gateway probe health response match. -type ApplicationGatewayProbeHealthResponseMatch struct { - // Body - Body that must be contained in the health response. Default value is empty. - Body *string `json:"body,omitempty"` - // StatusCodes - Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. - StatusCodes *[]string `json:"statusCodes,omitempty"` -} - -// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. -type ApplicationGatewayProbePropertiesFormat struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Host - Host name to send the probe to. - Host *string `json:"host,omitempty"` - // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - // Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. - Interval *int32 `json:"interval,omitempty"` - // Timeout - The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // UnhealthyThreshold - The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` - // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - // MinServers - Minimum number of servers that are always marked healthy. Default value is 0. - MinServers *int32 `json:"minServers,omitempty"` - // Match - Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Port - Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 and WAF_v2 only. - Port *int32 `json:"port,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayProbePropertiesFormat. -func (agppf ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agppf.Protocol != "" { - objectMap["protocol"] = agppf.Protocol - } - if agppf.Host != nil { - objectMap["host"] = agppf.Host - } - if agppf.Path != nil { - objectMap["path"] = agppf.Path - } - if agppf.Interval != nil { - objectMap["interval"] = agppf.Interval - } - if agppf.Timeout != nil { - objectMap["timeout"] = agppf.Timeout - } - if agppf.UnhealthyThreshold != nil { - objectMap["unhealthyThreshold"] = agppf.UnhealthyThreshold - } - if agppf.PickHostNameFromBackendHTTPSettings != nil { - objectMap["pickHostNameFromBackendHttpSettings"] = agppf.PickHostNameFromBackendHTTPSettings - } - if agppf.MinServers != nil { - objectMap["minServers"] = agppf.MinServers - } - if agppf.Match != nil { - objectMap["match"] = agppf.Match - } - if agppf.Port != nil { - objectMap["port"] = agppf.Port - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPropertiesFormat properties of the application gateway. -type ApplicationGatewayPropertiesFormat struct { - // Sku - SKU of the application gateway resource. - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - // SslPolicy - SSL policy of the application gateway resource. - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' - OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - // GatewayIPConfigurations - Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - // AuthenticationCertificates - Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - // TrustedRootCertificates - Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - // SslCertificates - SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - // FrontendIPConfigurations - Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - // FrontendPorts - Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - // Probes - Probes of the application gateway resource. - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - // BackendAddressPools - Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - // HTTPListeners - Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - // URLPathMaps - URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` - // RequestRoutingRules - Request routing rules of the application gateway resource. - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - // RewriteRuleSets - Rewrite rules for the application gateway resource. - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - // RedirectConfigurations - Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - // WebApplicationFirewallConfiguration - Web application firewall configuration. - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // EnableHTTP2 - Whether HTTP2 is enabled on the application gateway resource. - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - // EnableFips - Whether FIPS is enabled on the application gateway resource. - EnableFips *bool `json:"enableFips,omitempty"` - // AutoscaleConfiguration - Autoscale Configuration. - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - // PrivateLinkConfigurations - PrivateLink configurations on application gateway. - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - // PrivateEndpointConnections - READ-ONLY; Private Endpoint connections on application gateway. - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the application gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CustomErrorConfigurations - Custom error configurations of the application gateway resource. - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - // ForceFirewallPolicyAssociation - If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. -func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpf.Sku != nil { - objectMap["sku"] = agpf.Sku - } - if agpf.SslPolicy != nil { - objectMap["sslPolicy"] = agpf.SslPolicy - } - if agpf.GatewayIPConfigurations != nil { - objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations - } - if agpf.AuthenticationCertificates != nil { - objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates - } - if agpf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agpf.TrustedRootCertificates - } - if agpf.SslCertificates != nil { - objectMap["sslCertificates"] = agpf.SslCertificates - } - if agpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations - } - if agpf.FrontendPorts != nil { - objectMap["frontendPorts"] = agpf.FrontendPorts - } - if agpf.Probes != nil { - objectMap["probes"] = agpf.Probes - } - if agpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = agpf.BackendAddressPools - } - if agpf.BackendHTTPSettingsCollection != nil { - objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection - } - if agpf.HTTPListeners != nil { - objectMap["httpListeners"] = agpf.HTTPListeners - } - if agpf.URLPathMaps != nil { - objectMap["urlPathMaps"] = agpf.URLPathMaps - } - if agpf.RequestRoutingRules != nil { - objectMap["requestRoutingRules"] = agpf.RequestRoutingRules - } - if agpf.RewriteRuleSets != nil { - objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets - } - if agpf.RedirectConfigurations != nil { - objectMap["redirectConfigurations"] = agpf.RedirectConfigurations - } - if agpf.WebApplicationFirewallConfiguration != nil { - objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration - } - if agpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = agpf.FirewallPolicy - } - if agpf.EnableHTTP2 != nil { - objectMap["enableHttp2"] = agpf.EnableHTTP2 - } - if agpf.EnableFips != nil { - objectMap["enableFips"] = agpf.EnableFips - } - if agpf.AutoscaleConfiguration != nil { - objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration - } - if agpf.PrivateLinkConfigurations != nil { - objectMap["privateLinkConfigurations"] = agpf.PrivateLinkConfigurations - } - if agpf.CustomErrorConfigurations != nil { - objectMap["customErrorConfigurations"] = agpf.CustomErrorConfigurations - } - if agpf.ForceFirewallPolicyAssociation != nil { - objectMap["forceFirewallPolicyAssociation"] = agpf.ForceFirewallPolicyAssociation - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. -type ApplicationGatewayRedirectConfiguration struct { - // ApplicationGatewayRedirectConfigurationPropertiesFormat - Properties of the application gateway redirect configuration. - *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the redirect configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRedirectConfiguration. -func (agrc ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat != nil { - objectMap["properties"] = agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat - } - if agrc.Name != nil { - objectMap["name"] = agrc.Name - } - if agrc.ID != nil { - objectMap["id"] = agrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRedirectConfiguration struct. -func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRedirectConfigurationPropertiesFormat ApplicationGatewayRedirectConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRedirectConfigurationPropertiesFormat) - if err != nil { - return err - } - agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &applicationGatewayRedirectConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agrc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRedirectConfigurationPropertiesFormat properties of redirect configuration of the -// application gateway. -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - // RedirectType - HTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' - RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - // TargetListener - Reference to a listener to redirect the request to. - TargetListener *SubResource `json:"targetListener,omitempty"` - // TargetURL - Url to redirect the request to. - TargetURL *string `json:"targetUrl,omitempty"` - // IncludePath - Include path in the redirected url. - IncludePath *bool `json:"includePath,omitempty"` - // IncludeQueryString - Include query string in the redirected url. - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - // RequestRoutingRules - Request routing specifying redirect configuration. - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - // URLPathMaps - Url path maps specifying default redirect configuration. - URLPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` - // PathRules - Path rules specifying redirect configuration. - PathRules *[]SubResource `json:"pathRules,omitempty"` -} - -// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. -type ApplicationGatewayRequestRoutingRule struct { - // ApplicationGatewayRequestRoutingRulePropertiesFormat - Properties of the application gateway request routing rule. - *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the request routing rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. -func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { - objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat - } - if agrrr.Name != nil { - objectMap["name"] = agrrr.Name - } - if agrrr.ID != nil { - objectMap["id"] = agrrr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. -func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) - if err != nil { - return err - } - agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrrr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrrr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agrrr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrrr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the -// application gateway. -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' - RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - // Priority - Priority of the request routing rule. - Priority *int32 `json:"priority,omitempty"` - // BackendAddressPool - Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Backend http settings resource of the application gateway. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - // HTTPListener - Http listener resource of the application gateway. - HTTPListener *SubResource `json:"httpListener,omitempty"` - // URLPathMap - URL path map resource of the application gateway. - URLPathMap *SubResource `json:"urlPathMap,omitempty"` - // RewriteRuleSet - Rewrite Rule Set resource in Basic rule of the application gateway. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - // RedirectConfiguration - Redirect configuration resource of the application gateway. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRulePropertiesFormat. -func (agrrrpf ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrrpf.RuleType != "" { - objectMap["ruleType"] = agrrrpf.RuleType - } - if agrrrpf.Priority != nil { - objectMap["priority"] = agrrrpf.Priority - } - if agrrrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = agrrrpf.BackendAddressPool - } - if agrrrpf.BackendHTTPSettings != nil { - objectMap["backendHttpSettings"] = agrrrpf.BackendHTTPSettings - } - if agrrrpf.HTTPListener != nil { - objectMap["httpListener"] = agrrrpf.HTTPListener - } - if agrrrpf.URLPathMap != nil { - objectMap["urlPathMap"] = agrrrpf.URLPathMap - } - if agrrrpf.RewriteRuleSet != nil { - objectMap["rewriteRuleSet"] = agrrrpf.RewriteRuleSet - } - if agrrrpf.RedirectConfiguration != nil { - objectMap["redirectConfiguration"] = agrrrpf.RedirectConfiguration - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayRewriteRule rewrite rule of an application gateway. -type ApplicationGatewayRewriteRule struct { - // Name - Name of the rewrite rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // RuleSequence - Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a RewriteRuleSet. - RuleSequence *int32 `json:"ruleSequence,omitempty"` - // Conditions - Conditions based on which the action set execution will be evaluated. - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - // ActionSet - Set of actions to be done as part of the rewrite Rule. - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` -} - -// ApplicationGatewayRewriteRuleActionSet set of actions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleActionSet struct { - // RequestHeaderConfigurations - Request Header Actions in the Action Set. - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - // ResponseHeaderConfigurations - Response Header Actions in the Action Set. - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - // URLConfiguration - Url Configuration Action in the Action Set. - URLConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` -} - -// ApplicationGatewayRewriteRuleCondition set of conditions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleCondition struct { - // Variable - The condition parameter of the RewriteRuleCondition. - Variable *string `json:"variable,omitempty"` - // Pattern - The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. - Pattern *string `json:"pattern,omitempty"` - // IgnoreCase - Setting this paramter to truth value with force the pattern to do a case in-sensitive comparison. - IgnoreCase *bool `json:"ignoreCase,omitempty"` - // Negate - Setting this value as truth will force to check the negation of the condition given by the user. - Negate *bool `json:"negate,omitempty"` -} - -// ApplicationGatewayRewriteRuleSet rewrite rule set of an application gateway. -type ApplicationGatewayRewriteRuleSet struct { - // ApplicationGatewayRewriteRuleSetPropertiesFormat - Properties of the application gateway rewrite rule set. - *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the rewrite rule set that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSet. -func (agrrs ApplicationGatewayRewriteRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat != nil { - objectMap["properties"] = agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat - } - if agrrs.Name != nil { - objectMap["name"] = agrrs.Name - } - if agrrs.ID != nil { - objectMap["id"] = agrrs.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRewriteRuleSet struct. -func (agrrs *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRewriteRuleSetPropertiesFormat ApplicationGatewayRewriteRuleSetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRewriteRuleSetPropertiesFormat) - if err != nil { - return err - } - agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat = &applicationGatewayRewriteRuleSetPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrrs.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrrs.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrrs.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRewriteRuleSetPropertiesFormat properties of rewrite rule set of the application -// gateway. -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - // RewriteRules - Rewrite rules in the rewrite rule set. - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the rewrite rule set resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSetPropertiesFormat. -func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrspf.RewriteRules != nil { - objectMap["rewriteRules"] = agrrspf.RewriteRules - } - return json.Marshal(objectMap) -} - -// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysBackendHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result. -func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agbh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent { - agbh, err = client.BackendHealthResponder(agbh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysBackendHealthOnDemandFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ApplicationGatewaysBackendHealthOnDemandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealthOnDemand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysBackendHealthOnDemandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysBackendHealthOnDemandFuture.Result. -func (future *ApplicationGatewaysBackendHealthOnDemandFuture) result(client ApplicationGatewaysClient) (agbhod ApplicationGatewayBackendHealthOnDemand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agbhod.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthOnDemandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agbhod.Response.Response, err = future.GetResult(sender); err == nil && agbhod.Response.Response.StatusCode != http.StatusNoContent { - agbhod, err = client.BackendHealthOnDemandResponder(agbhod.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", agbhod.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. -func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ag.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { - ag, err = client.CreateOrUpdateResponder(ag.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. -func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewaySku SKU of an application gateway. -type ApplicationGatewaySku struct { - // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'WAFV2' - Name ApplicationGatewaySkuName `json:"name,omitempty"` - // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2' - Tier ApplicationGatewayTier `json:"tier,omitempty"` - // Capacity - Capacity (instance count) of an application gateway. - Capacity *int32 `json:"capacity,omitempty"` -} - -// ApplicationGatewaySslCertificate SSL certificates of an application gateway. -type ApplicationGatewaySslCertificate struct { - // ApplicationGatewaySslCertificatePropertiesFormat - Properties of the application gateway SSL certificate. - *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the SSL certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. -func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { - objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat - } - if agsc.Name != nil { - objectMap["name"] = agsc.Name - } - if agsc.ID != nil { - objectMap["id"] = agsc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. -func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) - if err != nil { - return err - } - agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agsc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agsc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agsc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agsc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application -// gateway. -type ApplicationGatewaySslCertificatePropertiesFormat struct { - // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. - Data *string `json:"data,omitempty"` - // Password - Password for the pfx file specified in data. Only applicable in PUT request. - Password *string `json:"password,omitempty"` - // PublicCertData - READ-ONLY; Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. - PublicCertData *string `json:"publicCertData,omitempty"` - // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the SSL certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificatePropertiesFormat. -func (agscpf ApplicationGatewaySslCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agscpf.Data != nil { - objectMap["data"] = agscpf.Data - } - if agscpf.Password != nil { - objectMap["password"] = agscpf.Password - } - if agscpf.KeyVaultSecretID != nil { - objectMap["keyVaultSecretId"] = agscpf.KeyVaultSecretID - } - return json.Marshal(objectMap) -} - -// ApplicationGatewaySslPolicy application Gateway Ssl policy. -type ApplicationGatewaySslPolicy struct { - // DisabledSslProtocols - Ssl protocols to be disabled on application gateway. - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - // PolicyType - Type of Ssl Policy. Possible values include: 'Predefined', 'Custom' - PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` - // PolicyName - Name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - // CipherSuites - Ssl cipher suites to be enabled in the specified order to application gateway. - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' - MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} - -// ApplicationGatewaySslPredefinedPolicy an Ssl predefined policy. -type ApplicationGatewaySslPredefinedPolicy struct { - autorest.Response `json:"-"` - // Name - Name of the Ssl predefined policy. - Name *string `json:"name,omitempty"` - // ApplicationGatewaySslPredefinedPolicyPropertiesFormat - Properties of the application gateway SSL predefined policy. - *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslPredefinedPolicy. -func (agspp ApplicationGatewaySslPredefinedPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agspp.Name != nil { - objectMap["name"] = agspp.Name - } - if agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat != nil { - objectMap["properties"] = agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat - } - if agspp.ID != nil { - objectMap["id"] = agspp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslPredefinedPolicy struct. -func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agspp.Name = &name - } - case "properties": - if v != nil { - var applicationGatewaySslPredefinedPolicyPropertiesFormat ApplicationGatewaySslPredefinedPolicyPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewaySslPredefinedPolicyPropertiesFormat) - if err != nil { - return err - } - agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &applicationGatewaySslPredefinedPolicyPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agspp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewaySslPredefinedPolicyPropertiesFormat properties of -// ApplicationGatewaySslPredefinedPolicy. -type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { - // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' - MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} - -// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysStartFuture.Result. -func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationGatewaysStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysStopFuture.Result. -func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewayTrustedRootCertificate trusted Root certificates of an application gateway. -type ApplicationGatewayTrustedRootCertificate struct { - // ApplicationGatewayTrustedRootCertificatePropertiesFormat - Properties of the application gateway trusted root certificate. - *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the trusted root certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedRootCertificate. -func (agtrc ApplicationGatewayTrustedRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat != nil { - objectMap["properties"] = agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat - } - if agtrc.Name != nil { - objectMap["name"] = agtrc.Name - } - if agtrc.ID != nil { - objectMap["id"] = agtrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayTrustedRootCertificate struct. -func (agtrc *ApplicationGatewayTrustedRootCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayTrustedRootCertificatePropertiesFormat ApplicationGatewayTrustedRootCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayTrustedRootCertificatePropertiesFormat) - if err != nil { - return err - } - agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat = &applicationGatewayTrustedRootCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agtrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agtrc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agtrc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agtrc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayTrustedRootCertificatePropertiesFormat trusted Root certificates properties of an -// application gateway. -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the trusted root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedRootCertificatePropertiesFormat. -func (agtrcpf ApplicationGatewayTrustedRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtrcpf.Data != nil { - objectMap["data"] = agtrcpf.Data - } - if agtrcpf.KeyVaultSecretID != nil { - objectMap["keyVaultSecretId"] = agtrcpf.KeyVaultSecretID - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayURLConfiguration url configuration of the Actions set in Application Gateway. -type ApplicationGatewayURLConfiguration struct { - // ModifiedPath - Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. - ModifiedPath *string `json:"modifiedPath,omitempty"` - // ModifiedQueryString - Query string which user has provided for url rewrite. Null means no query string will be updated. Default value is null. - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - // Reroute - If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified path. Default value is false. - Reroute *bool `json:"reroute,omitempty"` -} - -// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for -// PathBasedRouting. -type ApplicationGatewayURLPathMap struct { - // ApplicationGatewayURLPathMapPropertiesFormat - Properties of the application gateway URL path map. - *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the URL path map that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. -func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { - objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat - } - if agupm.Name != nil { - objectMap["name"] = agupm.Name - } - if agupm.ID != nil { - objectMap["id"] = agupm.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. -func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) - if err != nil { - return err - } - agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agupm.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agupm.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agupm.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agupm.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway. -type ApplicationGatewayURLPathMapPropertiesFormat struct { - // DefaultBackendAddressPool - Default backend address pool resource of URL path map. - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - // DefaultBackendHTTPSettings - Default backend http settings resource of URL path map. - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - // DefaultRewriteRuleSet - Default Rewrite rule set resource of URL path map. - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - // DefaultRedirectConfiguration - Default redirect configuration resource of URL path map. - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - // PathRules - Path rule of URL path map resource. - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the URL path map resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMapPropertiesFormat. -func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agupmpf.DefaultBackendAddressPool != nil { - objectMap["defaultBackendAddressPool"] = agupmpf.DefaultBackendAddressPool - } - if agupmpf.DefaultBackendHTTPSettings != nil { - objectMap["defaultBackendHttpSettings"] = agupmpf.DefaultBackendHTTPSettings - } - if agupmpf.DefaultRewriteRuleSet != nil { - objectMap["defaultRewriteRuleSet"] = agupmpf.DefaultRewriteRuleSet - } - if agupmpf.DefaultRedirectConfiguration != nil { - objectMap["defaultRedirectConfiguration"] = agupmpf.DefaultRedirectConfiguration - } - if agupmpf.PathRules != nil { - objectMap["pathRules"] = agupmpf.PathRules - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall -// configuration. -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - // Enabled - Whether the web application firewall is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` - // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // DisabledRuleGroups - The disabled rule groups. - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - // RequestBodyCheck - Whether allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - // MaxRequestBodySize - Maximum request body size for WAF. - MaxRequestBodySize *int32 `json:"maxRequestBodySize,omitempty"` - // MaxRequestBodySizeInKb - Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - // FileUploadLimitInMb - Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` - // Exclusions - The exclusion list. - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` -} - -// ApplicationRule rule of type application. -type ApplicationRule struct { - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // Protocols - Array of Application Protocols. - Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - // TargetFqdns - List of FQDNs for this rule. - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - // FqdnTags - List of FQDN Tags for this rule. - FqdnTags *[]string `json:"fqdnTags,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationRule. -func (ar ApplicationRule) MarshalJSON() ([]byte, error) { - ar.RuleType = RuleTypeApplicationRule - objectMap := make(map[string]interface{}) - if ar.SourceAddresses != nil { - objectMap["sourceAddresses"] = ar.SourceAddresses - } - if ar.DestinationAddresses != nil { - objectMap["destinationAddresses"] = ar.DestinationAddresses - } - if ar.Protocols != nil { - objectMap["protocols"] = ar.Protocols - } - if ar.TargetFqdns != nil { - objectMap["targetFqdns"] = ar.TargetFqdns - } - if ar.FqdnTags != nil { - objectMap["fqdnTags"] = ar.FqdnTags - } - if ar.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = ar.SourceIPGroups - } - if ar.Name != nil { - objectMap["name"] = ar.Name - } - if ar.Description != nil { - objectMap["description"] = ar.Description - } - if ar.RuleType != "" { - objectMap["ruleType"] = ar.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsApplicationRule() (*ApplicationRule, bool) { - return &ar, true -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &ar, true -} - -// ApplicationSecurityGroup an application security group in a resource group. -type ApplicationSecurityGroup struct { - autorest.Response `json:"-"` - // ApplicationSecurityGroupPropertiesFormat - Properties of the application security group. - *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationSecurityGroup. -func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asg.ApplicationSecurityGroupPropertiesFormat != nil { - objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat - } - if asg.ID != nil { - objectMap["id"] = asg.ID - } - if asg.Location != nil { - objectMap["location"] = asg.Location - } - if asg.Tags != nil { - objectMap["tags"] = asg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationSecurityGroup struct. -func (asg *ApplicationSecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationSecurityGroupPropertiesFormat ApplicationSecurityGroupPropertiesFormat - err = json.Unmarshal(*v, &applicationSecurityGroupPropertiesFormat) - if err != nil { - return err - } - asg.ApplicationSecurityGroupPropertiesFormat = &applicationSecurityGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - asg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - asg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - asg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - asg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - asg.Tags = tags - } - } - } - - return nil -} - -// ApplicationSecurityGroupListResult a list of application security groups. -type ApplicationSecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of application security groups. - Value *[]ApplicationSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationSecurityGroupListResult. -func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asglr.Value != nil { - objectMap["value"] = asglr.Value - } - return json.Marshal(objectMap) -} - -// ApplicationSecurityGroupListResultIterator provides access to a complete listing of -// ApplicationSecurityGroup values. -type ApplicationSecurityGroupListResultIterator struct { - i int - page ApplicationSecurityGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationSecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationSecurityGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationSecurityGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationSecurityGroupListResultIterator) Response() ApplicationSecurityGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationSecurityGroupListResultIterator) Value() ApplicationSecurityGroup { - if !iter.page.NotDone() { - return ApplicationSecurityGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationSecurityGroupListResultIterator type. -func NewApplicationSecurityGroupListResultIterator(page ApplicationSecurityGroupListResultPage) ApplicationSecurityGroupListResultIterator { - return ApplicationSecurityGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool { - return asglr.Value == nil || len(*asglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool { - return asglr.NextLink != nil && len(*asglr.NextLink) != 0 -} - -// applicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !asglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(asglr.NextLink))) -} - -// ApplicationSecurityGroupListResultPage contains a page of ApplicationSecurityGroup values. -type ApplicationSecurityGroupListResultPage struct { - fn func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error) - asglr ApplicationSecurityGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.asglr) - if err != nil { - return err - } - page.asglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationSecurityGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationSecurityGroupListResultPage) NotDone() bool { - return !page.asglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationSecurityGroupListResultPage) Response() ApplicationSecurityGroupListResult { - return page.asglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationSecurityGroupListResultPage) Values() []ApplicationSecurityGroup { - if page.asglr.IsEmpty() { - return nil - } - return *page.asglr.Value -} - -// Creates a new instance of the ApplicationSecurityGroupListResultPage type. -func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListResult, getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage { - return ApplicationSecurityGroupListResultPage{ - fn: getNextPage, - asglr: cur, - } -} - -// ApplicationSecurityGroupPropertiesFormat application security group properties. -type ApplicationSecurityGroupPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ApplicationSecurityGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationSecurityGroupsCreateOrUpdateFuture.Result. -func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - asg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if asg.Response.Response, err = future.GetResult(sender); err == nil && asg.Response.Response.StatusCode != http.StatusNoContent { - asg, err = client.CreateOrUpdateResponder(asg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", asg.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationSecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationSecurityGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationSecurityGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationSecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationSecurityGroupsDeleteFuture.Result. -func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations -// that belongs to an ExpressRouteCircuit. -type AuthorizationListResult struct { - autorest.Response `json:"-"` - // Value - The authorizations in an ExpressRoute Circuit. - Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AuthorizationListResultIterator provides access to a complete listing of -// ExpressRouteCircuitAuthorization values. -type AuthorizationListResultIterator struct { - i int - page AuthorizationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AuthorizationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AuthorizationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { - if !iter.page.NotDone() { - return ExpressRouteCircuitAuthorization{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AuthorizationListResultIterator type. -func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator { - return AuthorizationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr AuthorizationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (alr AuthorizationListResult) hasNextLink() bool { - return alr.NextLink != nil && len(*alr.NextLink) != 0 -} - -// authorizationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !alr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.NextLink))) -} - -// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. -type AuthorizationListResultPage struct { - fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error) - alr AuthorizationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.alr) - if err != nil { - return err - } - page.alr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AuthorizationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AuthorizationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AuthorizationListResultPage) Response() AuthorizationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// Creates a new instance of the AuthorizationListResultPage type. -func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { - return AuthorizationListResultPage{ - fn: getNextPage, - alr: cur, - } -} - -// AuthorizationPropertiesFormat properties of ExpressRouteCircuitAuthorization. -type AuthorizationPropertiesFormat struct { - // AuthorizationKey - The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // AuthorizationUseStatus - The authorization use status. Possible values include: 'Available', 'InUse' - AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AuthorizationPropertiesFormat. -func (apf AuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apf.AuthorizationKey != nil { - objectMap["authorizationKey"] = apf.AuthorizationKey - } - if apf.AuthorizationUseStatus != "" { - objectMap["authorizationUseStatus"] = apf.AuthorizationUseStatus - } - return json.Marshal(objectMap) -} - -// AutoApprovedPrivateLinkService the information of an AutoApprovedPrivateLinkService. -type AutoApprovedPrivateLinkService struct { - // PrivateLinkService - The id of the private link service resource. - PrivateLinkService *string `json:"privateLinkService,omitempty"` -} - -// AutoApprovedPrivateLinkServicesResult an array of private link service id that can be linked to a -// private end point with auto approved. -type AutoApprovedPrivateLinkServicesResult struct { - autorest.Response `json:"-"` - // Value - An array of auto approved private link service. - Value *[]AutoApprovedPrivateLinkService `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AutoApprovedPrivateLinkServicesResult. -func (aaplsr AutoApprovedPrivateLinkServicesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aaplsr.Value != nil { - objectMap["value"] = aaplsr.Value - } - return json.Marshal(objectMap) -} - -// AutoApprovedPrivateLinkServicesResultIterator provides access to a complete listing of -// AutoApprovedPrivateLinkService values. -type AutoApprovedPrivateLinkServicesResultIterator struct { - i int - page AutoApprovedPrivateLinkServicesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AutoApprovedPrivateLinkServicesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AutoApprovedPrivateLinkServicesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AutoApprovedPrivateLinkServicesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AutoApprovedPrivateLinkServicesResultIterator) Response() AutoApprovedPrivateLinkServicesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AutoApprovedPrivateLinkServicesResultIterator) Value() AutoApprovedPrivateLinkService { - if !iter.page.NotDone() { - return AutoApprovedPrivateLinkService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AutoApprovedPrivateLinkServicesResultIterator type. -func NewAutoApprovedPrivateLinkServicesResultIterator(page AutoApprovedPrivateLinkServicesResultPage) AutoApprovedPrivateLinkServicesResultIterator { - return AutoApprovedPrivateLinkServicesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aaplsr AutoApprovedPrivateLinkServicesResult) IsEmpty() bool { - return aaplsr.Value == nil || len(*aaplsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aaplsr AutoApprovedPrivateLinkServicesResult) hasNextLink() bool { - return aaplsr.NextLink != nil && len(*aaplsr.NextLink) != 0 -} - -// autoApprovedPrivateLinkServicesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aaplsr AutoApprovedPrivateLinkServicesResult) autoApprovedPrivateLinkServicesResultPreparer(ctx context.Context) (*http.Request, error) { - if !aaplsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aaplsr.NextLink))) -} - -// AutoApprovedPrivateLinkServicesResultPage contains a page of AutoApprovedPrivateLinkService values. -type AutoApprovedPrivateLinkServicesResultPage struct { - fn func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error) - aaplsr AutoApprovedPrivateLinkServicesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AutoApprovedPrivateLinkServicesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aaplsr) - if err != nil { - return err - } - page.aaplsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AutoApprovedPrivateLinkServicesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AutoApprovedPrivateLinkServicesResultPage) NotDone() bool { - return !page.aaplsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AutoApprovedPrivateLinkServicesResultPage) Response() AutoApprovedPrivateLinkServicesResult { - return page.aaplsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AutoApprovedPrivateLinkServicesResultPage) Values() []AutoApprovedPrivateLinkService { - if page.aaplsr.IsEmpty() { - return nil - } - return *page.aaplsr.Value -} - -// Creates a new instance of the AutoApprovedPrivateLinkServicesResultPage type. -func NewAutoApprovedPrivateLinkServicesResultPage(cur AutoApprovedPrivateLinkServicesResult, getNextPage func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)) AutoApprovedPrivateLinkServicesResultPage { - return AutoApprovedPrivateLinkServicesResultPage{ - fn: getNextPage, - aaplsr: cur, - } -} - -// Availability availability of the metric. -type Availability struct { - // TimeGrain - The time grain of the availability. - TimeGrain *string `json:"timeGrain,omitempty"` - // Retention - The retention of the availability. - Retention *string `json:"retention,omitempty"` - // BlobDuration - Duration of the availability blob. - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// AvailableDelegation the serviceName of an AvailableDelegation indicates a possible delegation for a -// subnet. -type AvailableDelegation struct { - // Name - The name of the AvailableDelegation resource. - Name *string `json:"name,omitempty"` - // ID - A unique identifier of the AvailableDelegation resource. - ID *string `json:"id,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ServiceName - The name of the service and resource. - ServiceName *string `json:"serviceName,omitempty"` - // Actions - The actions permitted to the service upon delegation. - Actions *[]string `json:"actions,omitempty"` -} - -// AvailableDelegationsResult an array of available delegations. -type AvailableDelegationsResult struct { - autorest.Response `json:"-"` - // Value - An array of available delegations. - Value *[]AvailableDelegation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailableDelegationsResult. -func (adr AvailableDelegationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if adr.Value != nil { - objectMap["value"] = adr.Value - } - return json.Marshal(objectMap) -} - -// AvailableDelegationsResultIterator provides access to a complete listing of AvailableDelegation values. -type AvailableDelegationsResultIterator struct { - i int - page AvailableDelegationsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailableDelegationsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailableDelegationsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailableDelegationsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailableDelegationsResultIterator) Response() AvailableDelegationsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailableDelegationsResultIterator) Value() AvailableDelegation { - if !iter.page.NotDone() { - return AvailableDelegation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailableDelegationsResultIterator type. -func NewAvailableDelegationsResultIterator(page AvailableDelegationsResultPage) AvailableDelegationsResultIterator { - return AvailableDelegationsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (adr AvailableDelegationsResult) IsEmpty() bool { - return adr.Value == nil || len(*adr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (adr AvailableDelegationsResult) hasNextLink() bool { - return adr.NextLink != nil && len(*adr.NextLink) != 0 -} - -// availableDelegationsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (adr AvailableDelegationsResult) availableDelegationsResultPreparer(ctx context.Context) (*http.Request, error) { - if !adr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(adr.NextLink))) -} - -// AvailableDelegationsResultPage contains a page of AvailableDelegation values. -type AvailableDelegationsResultPage struct { - fn func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error) - adr AvailableDelegationsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailableDelegationsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.adr) - if err != nil { - return err - } - page.adr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailableDelegationsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailableDelegationsResultPage) NotDone() bool { - return !page.adr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailableDelegationsResultPage) Response() AvailableDelegationsResult { - return page.adr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailableDelegationsResultPage) Values() []AvailableDelegation { - if page.adr.IsEmpty() { - return nil - } - return *page.adr.Value -} - -// Creates a new instance of the AvailableDelegationsResultPage type. -func NewAvailableDelegationsResultPage(cur AvailableDelegationsResult, getNextPage func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)) AvailableDelegationsResultPage { - return AvailableDelegationsResultPage{ - fn: getNextPage, - adr: cur, - } -} - -// AvailablePrivateEndpointType the information of an AvailablePrivateEndpointType. -type AvailablePrivateEndpointType struct { - // Name - The name of the service and resource. - Name *string `json:"name,omitempty"` - // ID - A unique identifier of the AvailablePrivateEndpoint Type resource. - ID *string `json:"id,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ResourceName - The name of the service and resource. - ResourceName *string `json:"resourceName,omitempty"` -} - -// AvailablePrivateEndpointTypesResult an array of available PrivateEndpoint types. -type AvailablePrivateEndpointTypesResult struct { - autorest.Response `json:"-"` - // Value - An array of available privateEndpoint type. - Value *[]AvailablePrivateEndpointType `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailablePrivateEndpointTypesResult. -func (apetr AvailablePrivateEndpointTypesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apetr.Value != nil { - objectMap["value"] = apetr.Value - } - return json.Marshal(objectMap) -} - -// AvailablePrivateEndpointTypesResultIterator provides access to a complete listing of -// AvailablePrivateEndpointType values. -type AvailablePrivateEndpointTypesResultIterator struct { - i int - page AvailablePrivateEndpointTypesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailablePrivateEndpointTypesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailablePrivateEndpointTypesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailablePrivateEndpointTypesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailablePrivateEndpointTypesResultIterator) Response() AvailablePrivateEndpointTypesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailablePrivateEndpointTypesResultIterator) Value() AvailablePrivateEndpointType { - if !iter.page.NotDone() { - return AvailablePrivateEndpointType{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailablePrivateEndpointTypesResultIterator type. -func NewAvailablePrivateEndpointTypesResultIterator(page AvailablePrivateEndpointTypesResultPage) AvailablePrivateEndpointTypesResultIterator { - return AvailablePrivateEndpointTypesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (apetr AvailablePrivateEndpointTypesResult) IsEmpty() bool { - return apetr.Value == nil || len(*apetr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (apetr AvailablePrivateEndpointTypesResult) hasNextLink() bool { - return apetr.NextLink != nil && len(*apetr.NextLink) != 0 -} - -// availablePrivateEndpointTypesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (apetr AvailablePrivateEndpointTypesResult) availablePrivateEndpointTypesResultPreparer(ctx context.Context) (*http.Request, error) { - if !apetr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(apetr.NextLink))) -} - -// AvailablePrivateEndpointTypesResultPage contains a page of AvailablePrivateEndpointType values. -type AvailablePrivateEndpointTypesResultPage struct { - fn func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error) - apetr AvailablePrivateEndpointTypesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailablePrivateEndpointTypesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.apetr) - if err != nil { - return err - } - page.apetr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailablePrivateEndpointTypesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailablePrivateEndpointTypesResultPage) NotDone() bool { - return !page.apetr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailablePrivateEndpointTypesResultPage) Response() AvailablePrivateEndpointTypesResult { - return page.apetr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailablePrivateEndpointTypesResultPage) Values() []AvailablePrivateEndpointType { - if page.apetr.IsEmpty() { - return nil - } - return *page.apetr.Value -} - -// Creates a new instance of the AvailablePrivateEndpointTypesResultPage type. -func NewAvailablePrivateEndpointTypesResultPage(cur AvailablePrivateEndpointTypesResult, getNextPage func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)) AvailablePrivateEndpointTypesResultPage { - return AvailablePrivateEndpointTypesResultPage{ - fn: getNextPage, - apetr: cur, - } -} - -// AvailableProvidersList list of available countries with details. -type AvailableProvidersList struct { - autorest.Response `json:"-"` - // Countries - List of available countries. - Countries *[]AvailableProvidersListCountry `json:"countries,omitempty"` -} - -// AvailableProvidersListCity city or town details. -type AvailableProvidersListCity struct { - // CityName - The city or town name. - CityName *string `json:"cityName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` -} - -// AvailableProvidersListCountry country details. -type AvailableProvidersListCountry struct { - // CountryName - The country name. - CountryName *string `json:"countryName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // States - List of available states in the country. - States *[]AvailableProvidersListState `json:"states,omitempty"` -} - -// AvailableProvidersListParameters constraints that determine the list of available Internet service -// providers. -type AvailableProvidersListParameters struct { - // AzureLocations - A list of Azure regions. - AzureLocations *[]string `json:"azureLocations,omitempty"` - // Country - The country for available providers list. - Country *string `json:"country,omitempty"` - // State - The state for available providers list. - State *string `json:"state,omitempty"` - // City - The city or town for available providers list. - City *string `json:"city,omitempty"` -} - -// AvailableProvidersListState state details. -type AvailableProvidersListState struct { - // StateName - The state name. - StateName *string `json:"stateName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // Cities - List of available cities or towns in the state. - Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` -} - -// AvailableServiceAlias the available service alias. -type AvailableServiceAlias struct { - // Name - The name of the service alias. - Name *string `json:"name,omitempty"` - // ID - The ID of the service alias. - ID *string `json:"id,omitempty"` - // Type - The type of the resource. - Type *string `json:"type,omitempty"` - // ResourceName - The resource name of the service alias. - ResourceName *string `json:"resourceName,omitempty"` -} - -// AvailableServiceAliasesResult an array of available service aliases. -type AvailableServiceAliasesResult struct { - autorest.Response `json:"-"` - // Value - An array of available service aliases. - Value *[]AvailableServiceAlias `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailableServiceAliasesResult. -func (asar AvailableServiceAliasesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asar.Value != nil { - objectMap["value"] = asar.Value - } - return json.Marshal(objectMap) -} - -// AvailableServiceAliasesResultIterator provides access to a complete listing of AvailableServiceAlias -// values. -type AvailableServiceAliasesResultIterator struct { - i int - page AvailableServiceAliasesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailableServiceAliasesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailableServiceAliasesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailableServiceAliasesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailableServiceAliasesResultIterator) Response() AvailableServiceAliasesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailableServiceAliasesResultIterator) Value() AvailableServiceAlias { - if !iter.page.NotDone() { - return AvailableServiceAlias{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailableServiceAliasesResultIterator type. -func NewAvailableServiceAliasesResultIterator(page AvailableServiceAliasesResultPage) AvailableServiceAliasesResultIterator { - return AvailableServiceAliasesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (asar AvailableServiceAliasesResult) IsEmpty() bool { - return asar.Value == nil || len(*asar.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (asar AvailableServiceAliasesResult) hasNextLink() bool { - return asar.NextLink != nil && len(*asar.NextLink) != 0 -} - -// availableServiceAliasesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (asar AvailableServiceAliasesResult) availableServiceAliasesResultPreparer(ctx context.Context) (*http.Request, error) { - if !asar.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(asar.NextLink))) -} - -// AvailableServiceAliasesResultPage contains a page of AvailableServiceAlias values. -type AvailableServiceAliasesResultPage struct { - fn func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error) - asar AvailableServiceAliasesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailableServiceAliasesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.asar) - if err != nil { - return err - } - page.asar = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailableServiceAliasesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailableServiceAliasesResultPage) NotDone() bool { - return !page.asar.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailableServiceAliasesResultPage) Response() AvailableServiceAliasesResult { - return page.asar -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailableServiceAliasesResultPage) Values() []AvailableServiceAlias { - if page.asar.IsEmpty() { - return nil - } - return *page.asar.Value -} - -// Creates a new instance of the AvailableServiceAliasesResultPage type. -func NewAvailableServiceAliasesResultPage(cur AvailableServiceAliasesResult, getNextPage func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error)) AvailableServiceAliasesResultPage { - return AvailableServiceAliasesResultPage{ - fn: getNextPage, - asar: cur, - } -} - -// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, -// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct -// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous -// operation succeeded, the response body includes the HTTP status code for the successful request. If the -// asynchronous operation failed, the response body includes the HTTP status code for the failed request -// and error information regarding the failure. -type AzureAsyncOperationResult struct { - // Status - Status of the Azure async operation. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed' - Status OperationStatus `json:"status,omitempty"` - // Error - Details of the error occurred during specified asynchronous operation. - Error *Error `json:"error,omitempty"` -} - -// AzureFirewall azure Firewall resource. -type AzureFirewall struct { - autorest.Response `json:"-"` - // AzureFirewallPropertiesFormat - Properties of the azure firewall. - *AzureFirewallPropertiesFormat `json:"properties,omitempty"` - // Zones - A list of availability zones denoting where the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AzureFirewall. -func (af AzureFirewall) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if af.AzureFirewallPropertiesFormat != nil { - objectMap["properties"] = af.AzureFirewallPropertiesFormat - } - if af.Zones != nil { - objectMap["zones"] = af.Zones - } - if af.ID != nil { - objectMap["id"] = af.ID - } - if af.Location != nil { - objectMap["location"] = af.Location - } - if af.Tags != nil { - objectMap["tags"] = af.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewall struct. -func (af *AzureFirewall) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallPropertiesFormat AzureFirewallPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallPropertiesFormat) - if err != nil { - return err - } - af.AzureFirewallPropertiesFormat = &azureFirewallPropertiesFormat - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - af.Zones = &zones - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - af.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - af.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - af.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - af.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - af.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - af.Tags = tags - } - } - } - - return nil -} - -// AzureFirewallApplicationRule properties of an application rule. -type AzureFirewallApplicationRule struct { - // Name - Name of the application rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // Protocols - Array of ApplicationRuleProtocols. - Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` - // TargetFqdns - List of FQDNs for this rule. - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - // FqdnTags - List of FQDN Tags for this rule. - FqdnTags *[]string `json:"fqdnTags,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} - -// AzureFirewallApplicationRuleCollection application rule collection resource. -type AzureFirewallApplicationRuleCollection struct { - // AzureFirewallApplicationRuleCollectionPropertiesFormat - Properties of the azure firewall application rule collection. - *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollection. -func (afarc AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat != nil { - objectMap["properties"] = afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat - } - if afarc.Name != nil { - objectMap["name"] = afarc.Name - } - if afarc.ID != nil { - objectMap["id"] = afarc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallApplicationRuleCollection struct. -func (afarc *AzureFirewallApplicationRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallApplicationRuleCollectionPropertiesFormat AzureFirewallApplicationRuleCollectionPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallApplicationRuleCollectionPropertiesFormat) - if err != nil { - return err - } - afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat = &azureFirewallApplicationRuleCollectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afarc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afarc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afarc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallApplicationRuleCollectionPropertiesFormat properties of the application rule collection. -type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { - // Priority - Priority of the application rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a application rule collection. - Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollectionPropertiesFormat. -func (afarcpf AzureFirewallApplicationRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afarcpf.Priority != nil { - objectMap["priority"] = afarcpf.Priority - } - if afarcpf.Action != nil { - objectMap["action"] = afarcpf.Action - } - if afarcpf.Rules != nil { - objectMap["rules"] = afarcpf.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallApplicationRuleProtocol properties of the application rule protocol. -type AzureFirewallApplicationRuleProtocol struct { - // ProtocolType - Protocol type. Possible values include: 'AzureFirewallApplicationRuleProtocolTypeHTTP', 'AzureFirewallApplicationRuleProtocolTypeHTTPS', 'AzureFirewallApplicationRuleProtocolTypeMssql' - ProtocolType AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` - // Port - Port number for the protocol, cannot be greater than 64000. This field is optional. - Port *int32 `json:"port,omitempty"` -} - -// AzureFirewallFqdnTag azure Firewall FQDN Tag Resource. -type AzureFirewallFqdnTag struct { - // AzureFirewallFqdnTagPropertiesFormat - Properties of the azure firewall FQDN tag. - *AzureFirewallFqdnTagPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallFqdnTag. -func (afft AzureFirewallFqdnTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afft.AzureFirewallFqdnTagPropertiesFormat != nil { - objectMap["properties"] = afft.AzureFirewallFqdnTagPropertiesFormat - } - if afft.ID != nil { - objectMap["id"] = afft.ID - } - if afft.Location != nil { - objectMap["location"] = afft.Location - } - if afft.Tags != nil { - objectMap["tags"] = afft.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallFqdnTag struct. -func (afft *AzureFirewallFqdnTag) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallFqdnTagPropertiesFormat AzureFirewallFqdnTagPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallFqdnTagPropertiesFormat) - if err != nil { - return err - } - afft.AzureFirewallFqdnTagPropertiesFormat = &azureFirewallFqdnTagPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afft.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afft.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afft.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - afft.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - afft.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - afft.Tags = tags - } - } - } - - return nil -} - -// AzureFirewallFqdnTagListResult response for ListAzureFirewallFqdnTags API service call. -type AzureFirewallFqdnTagListResult struct { - autorest.Response `json:"-"` - // Value - List of Azure Firewall FQDN Tags in a resource group. - Value *[]AzureFirewallFqdnTag `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AzureFirewallFqdnTagListResultIterator provides access to a complete listing of AzureFirewallFqdnTag -// values. -type AzureFirewallFqdnTagListResultIterator struct { - i int - page AzureFirewallFqdnTagListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AzureFirewallFqdnTagListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AzureFirewallFqdnTagListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AzureFirewallFqdnTagListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AzureFirewallFqdnTagListResultIterator) Response() AzureFirewallFqdnTagListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AzureFirewallFqdnTagListResultIterator) Value() AzureFirewallFqdnTag { - if !iter.page.NotDone() { - return AzureFirewallFqdnTag{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AzureFirewallFqdnTagListResultIterator type. -func NewAzureFirewallFqdnTagListResultIterator(page AzureFirewallFqdnTagListResultPage) AzureFirewallFqdnTagListResultIterator { - return AzureFirewallFqdnTagListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (afftlr AzureFirewallFqdnTagListResult) IsEmpty() bool { - return afftlr.Value == nil || len(*afftlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (afftlr AzureFirewallFqdnTagListResult) hasNextLink() bool { - return afftlr.NextLink != nil && len(*afftlr.NextLink) != 0 -} - -// azureFirewallFqdnTagListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (afftlr AzureFirewallFqdnTagListResult) azureFirewallFqdnTagListResultPreparer(ctx context.Context) (*http.Request, error) { - if !afftlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(afftlr.NextLink))) -} - -// AzureFirewallFqdnTagListResultPage contains a page of AzureFirewallFqdnTag values. -type AzureFirewallFqdnTagListResultPage struct { - fn func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error) - afftlr AzureFirewallFqdnTagListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AzureFirewallFqdnTagListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.afftlr) - if err != nil { - return err - } - page.afftlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AzureFirewallFqdnTagListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AzureFirewallFqdnTagListResultPage) NotDone() bool { - return !page.afftlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AzureFirewallFqdnTagListResultPage) Response() AzureFirewallFqdnTagListResult { - return page.afftlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AzureFirewallFqdnTagListResultPage) Values() []AzureFirewallFqdnTag { - if page.afftlr.IsEmpty() { - return nil - } - return *page.afftlr.Value -} - -// Creates a new instance of the AzureFirewallFqdnTagListResultPage type. -func NewAzureFirewallFqdnTagListResultPage(cur AzureFirewallFqdnTagListResult, getNextPage func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)) AzureFirewallFqdnTagListResultPage { - return AzureFirewallFqdnTagListResultPage{ - fn: getNextPage, - afftlr: cur, - } -} - -// AzureFirewallFqdnTagPropertiesFormat azure Firewall FQDN Tag Properties. -type AzureFirewallFqdnTagPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // FqdnTagName - READ-ONLY; The name of this FQDN Tag. - FqdnTagName *string `json:"fqdnTagName,omitempty"` -} - -// AzureFirewallIPConfiguration IP configuration of an Azure Firewall. -type AzureFirewallIPConfiguration struct { - // AzureFirewallIPConfigurationPropertiesFormat - Properties of the azure firewall IP configuration. - *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallIPConfiguration. -func (afic AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afic.AzureFirewallIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = afic.AzureFirewallIPConfigurationPropertiesFormat - } - if afic.Name != nil { - objectMap["name"] = afic.Name - } - if afic.ID != nil { - objectMap["id"] = afic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallIPConfiguration struct. -func (afic *AzureFirewallIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallIPConfigurationPropertiesFormat AzureFirewallIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallIPConfigurationPropertiesFormat) - if err != nil { - return err - } - afic.AzureFirewallIPConfigurationPropertiesFormat = &azureFirewallIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - afic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afic.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallIPConfigurationPropertiesFormat properties of IP configuration of an Azure Firewall. -type AzureFirewallIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - READ-ONLY; The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // Subnet - Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallIPConfigurationPropertiesFormat. -func (aficpf AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aficpf.Subnet != nil { - objectMap["subnet"] = aficpf.Subnet - } - if aficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = aficpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// AzureFirewallIPGroups ipGroups associated with azure firewall. -type AzureFirewallIPGroups struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // ChangeNumber - READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty"` -} - -// AzureFirewallListResult response for ListAzureFirewalls API service call. -type AzureFirewallListResult struct { - autorest.Response `json:"-"` - // Value - List of Azure Firewalls in a resource group. - Value *[]AzureFirewall `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AzureFirewallListResultIterator provides access to a complete listing of AzureFirewall values. -type AzureFirewallListResultIterator struct { - i int - page AzureFirewallListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AzureFirewallListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AzureFirewallListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AzureFirewallListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AzureFirewallListResultIterator) Response() AzureFirewallListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AzureFirewallListResultIterator) Value() AzureFirewall { - if !iter.page.NotDone() { - return AzureFirewall{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AzureFirewallListResultIterator type. -func NewAzureFirewallListResultIterator(page AzureFirewallListResultPage) AzureFirewallListResultIterator { - return AzureFirewallListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aflr AzureFirewallListResult) IsEmpty() bool { - return aflr.Value == nil || len(*aflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aflr AzureFirewallListResult) hasNextLink() bool { - return aflr.NextLink != nil && len(*aflr.NextLink) != 0 -} - -// azureFirewallListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aflr.NextLink))) -} - -// AzureFirewallListResultPage contains a page of AzureFirewall values. -type AzureFirewallListResultPage struct { - fn func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error) - aflr AzureFirewallListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aflr) - if err != nil { - return err - } - page.aflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AzureFirewallListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AzureFirewallListResultPage) NotDone() bool { - return !page.aflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AzureFirewallListResultPage) Response() AzureFirewallListResult { - return page.aflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AzureFirewallListResultPage) Values() []AzureFirewall { - if page.aflr.IsEmpty() { - return nil - } - return *page.aflr.Value -} - -// Creates a new instance of the AzureFirewallListResultPage type. -func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage { - return AzureFirewallListResultPage{ - fn: getNextPage, - aflr: cur, - } -} - -// AzureFirewallNatRCAction azureFirewall NAT Rule Collection Action. -type AzureFirewallNatRCAction struct { - // Type - The type of action. Possible values include: 'Snat', 'Dnat' - Type AzureFirewallNatRCActionType `json:"type,omitempty"` -} - -// AzureFirewallNatRule properties of a NAT rule. -type AzureFirewallNatRule struct { - // Name - Name of the NAT rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // Protocols - Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - // TranslatedAddress - The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - // TranslatedPort - The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` - // TranslatedFqdn - The translated FQDN for this NAT rule. - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} - -// AzureFirewallNatRuleCollection NAT rule collection resource. -type AzureFirewallNatRuleCollection struct { - // AzureFirewallNatRuleCollectionProperties - Properties of the azure firewall NAT rule collection. - *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNatRuleCollection. -func (afnrc AzureFirewallNatRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrc.AzureFirewallNatRuleCollectionProperties != nil { - objectMap["properties"] = afnrc.AzureFirewallNatRuleCollectionProperties - } - if afnrc.Name != nil { - objectMap["name"] = afnrc.Name - } - if afnrc.ID != nil { - objectMap["id"] = afnrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallNatRuleCollection struct. -func (afnrc *AzureFirewallNatRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallNatRuleCollectionProperties AzureFirewallNatRuleCollectionProperties - err = json.Unmarshal(*v, &azureFirewallNatRuleCollectionProperties) - if err != nil { - return err - } - afnrc.AzureFirewallNatRuleCollectionProperties = &azureFirewallNatRuleCollectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afnrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afnrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afnrc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallNatRuleCollectionProperties properties of the NAT rule collection. -type AzureFirewallNatRuleCollectionProperties struct { - // Priority - Priority of the NAT rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a NAT rule collection. - Action *AzureFirewallNatRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a NAT rule collection. - Rules *[]AzureFirewallNatRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNatRuleCollectionProperties. -func (afnrcp AzureFirewallNatRuleCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrcp.Priority != nil { - objectMap["priority"] = afnrcp.Priority - } - if afnrcp.Action != nil { - objectMap["action"] = afnrcp.Action - } - if afnrcp.Rules != nil { - objectMap["rules"] = afnrcp.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallNetworkRule properties of the network rule. -type AzureFirewallNetworkRule struct { - // Name - Name of the network rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // Protocols - Array of AzureFirewallNetworkRuleProtocols. - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // DestinationFqdns - List of destination FQDNs. - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // DestinationIPGroups - List of destination IpGroups for this rule. - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` -} - -// AzureFirewallNetworkRuleCollection network rule collection resource. -type AzureFirewallNetworkRuleCollection struct { - // AzureFirewallNetworkRuleCollectionPropertiesFormat - Properties of the azure firewall network rule collection. - *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollection. -func (afnrc AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat != nil { - objectMap["properties"] = afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat - } - if afnrc.Name != nil { - objectMap["name"] = afnrc.Name - } - if afnrc.ID != nil { - objectMap["id"] = afnrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallNetworkRuleCollection struct. -func (afnrc *AzureFirewallNetworkRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallNetworkRuleCollectionPropertiesFormat AzureFirewallNetworkRuleCollectionPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallNetworkRuleCollectionPropertiesFormat) - if err != nil { - return err - } - afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat = &azureFirewallNetworkRuleCollectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afnrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afnrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afnrc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallNetworkRuleCollectionPropertiesFormat properties of the network rule collection. -type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { - // Priority - Priority of the network rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a network rule collection. - Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollectionPropertiesFormat. -func (afnrcpf AzureFirewallNetworkRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrcpf.Priority != nil { - objectMap["priority"] = afnrcpf.Priority - } - if afnrcpf.Action != nil { - objectMap["action"] = afnrcpf.Action - } - if afnrcpf.Rules != nil { - objectMap["rules"] = afnrcpf.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallPropertiesFormat properties of the Azure Firewall. -type AzureFirewallPropertiesFormat struct { - // ApplicationRuleCollections - Collection of application rule collections used by Azure Firewall. - ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` - // NatRuleCollections - Collection of NAT rule collections used by Azure Firewall. - NatRuleCollections *[]AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"` - // NetworkRuleCollections - Collection of network rule collections used by Azure Firewall. - NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` - // IPConfigurations - IP configuration of the Azure Firewall resource. - IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` - // ManagementIPConfiguration - IP configuration of the Azure Firewall used for management traffic. - ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ThreatIntelMode - The operation mode for Threat Intelligence. Possible values include: 'AzureFirewallThreatIntelModeAlert', 'AzureFirewallThreatIntelModeDeny', 'AzureFirewallThreatIntelModeOff' - ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - // VirtualHub - The virtualHub to which the firewall belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // FirewallPolicy - The firewallPolicy associated with this azure firewall. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // HubIPAddresses - IP addresses associated with AzureFirewall. - HubIPAddresses *HubIPAddresses `json:"hubIPAddresses,omitempty"` - // IPGroups - READ-ONLY; IpGroups associated with AzureFirewall. - IPGroups *[]AzureFirewallIPGroups `json:"ipGroups,omitempty"` - // Sku - The Azure Firewall Resource SKU. - Sku *AzureFirewallSku `json:"sku,omitempty"` - // AdditionalProperties - The additional properties used to further config this azure firewall. - AdditionalProperties map[string]*string `json:"additionalProperties"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallPropertiesFormat. -func (afpf AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afpf.ApplicationRuleCollections != nil { - objectMap["applicationRuleCollections"] = afpf.ApplicationRuleCollections - } - if afpf.NatRuleCollections != nil { - objectMap["natRuleCollections"] = afpf.NatRuleCollections - } - if afpf.NetworkRuleCollections != nil { - objectMap["networkRuleCollections"] = afpf.NetworkRuleCollections - } - if afpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = afpf.IPConfigurations - } - if afpf.ManagementIPConfiguration != nil { - objectMap["managementIpConfiguration"] = afpf.ManagementIPConfiguration - } - if afpf.ThreatIntelMode != "" { - objectMap["threatIntelMode"] = afpf.ThreatIntelMode - } - if afpf.VirtualHub != nil { - objectMap["virtualHub"] = afpf.VirtualHub - } - if afpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = afpf.FirewallPolicy - } - if afpf.HubIPAddresses != nil { - objectMap["hubIPAddresses"] = afpf.HubIPAddresses - } - if afpf.Sku != nil { - objectMap["sku"] = afpf.Sku - } - if afpf.AdditionalProperties != nil { - objectMap["additionalProperties"] = afpf.AdditionalProperties - } - return json.Marshal(objectMap) -} - -// AzureFirewallPublicIPAddress public IP Address associated with azure firewall. -type AzureFirewallPublicIPAddress struct { - // Address - Public IP Address value. - Address *string `json:"address,omitempty"` -} - -// AzureFirewallRCAction properties of the AzureFirewallRCAction. -type AzureFirewallRCAction struct { - // Type - The type of action. Possible values include: 'AzureFirewallRCActionTypeAllow', 'AzureFirewallRCActionTypeDeny' - Type AzureFirewallRCActionType `json:"type,omitempty"` -} - -// AzureFirewallsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AzureFirewallsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (AzureFirewall, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsCreateOrUpdateFuture.Result. -func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - af.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { - af, err = client.CreateOrUpdateResponder(af.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request") - } - } - return -} - -// AzureFirewallsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AzureFirewallsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsDeleteFuture.Result. -func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AzureFirewallSku SKU of an Azure Firewall. -type AzureFirewallSku struct { - // Name - Name of an Azure Firewall SKU. Possible values include: 'AZFWVNet', 'AZFWHub' - Name AzureFirewallSkuName `json:"name,omitempty"` - // Tier - Tier of an Azure Firewall. Possible values include: 'Standard', 'Premium' - Tier AzureFirewallSkuTier `json:"tier,omitempty"` -} - -// AzureFirewallsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AzureFirewallsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (AzureFirewall, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsUpdateTagsFuture.Result. -func (future *AzureFirewallsUpdateTagsFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - af.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { - af, err = client.UpdateTagsResponder(af.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", af.Response.Response, "Failure responding to request") - } - } - return -} - -// AzureReachabilityReport azure reachability report details. -type AzureReachabilityReport struct { - autorest.Response `json:"-"` - // AggregationLevel - The aggregation level of Azure reachability report. Can be Country, State or City. - AggregationLevel *string `json:"aggregationLevel,omitempty"` - // ProviderLocation - Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - // ReachabilityReport - List of Azure reachability report items. - ReachabilityReport *[]AzureReachabilityReportItem `json:"reachabilityReport,omitempty"` -} - -// AzureReachabilityReportItem azure reachability report details for a given provider location. -type AzureReachabilityReportItem struct { - // Provider - The Internet service provider. - Provider *string `json:"provider,omitempty"` - // AzureLocation - The Azure region. - AzureLocation *string `json:"azureLocation,omitempty"` - // Latencies - List of latency details for each of the time series. - Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` -} - -// AzureReachabilityReportLatencyInfo details on latency for a time series. -type AzureReachabilityReportLatencyInfo struct { - // TimeStamp - The time stamp. - TimeStamp *date.Time `json:"timeStamp,omitempty"` - // Score - The relative latency score between 1 and 100, higher values indicating a faster connection. - Score *int32 `json:"score,omitempty"` -} - -// AzureReachabilityReportLocation parameters that define a geographic location. -type AzureReachabilityReportLocation struct { - // Country - The name of the country. - Country *string `json:"country,omitempty"` - // State - The name of the state. - State *string `json:"state,omitempty"` - // City - The name of the city or town. - City *string `json:"city,omitempty"` -} - -// AzureReachabilityReportParameters geographic and time constraints for Azure reachability report. -type AzureReachabilityReportParameters struct { - // ProviderLocation - Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - // Providers - List of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // AzureLocations - Optional Azure regions to scope the query to. - AzureLocations *[]string `json:"azureLocations,omitempty"` - // StartTime - The start time for the Azure reachability report. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time for the Azure reachability report. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// BackendAddressPool pool of backend IP addresses. -type BackendAddressPool struct { - autorest.Response `json:"-"` - // BackendAddressPoolPropertiesFormat - Properties of load balancer backend address pool. - *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackendAddressPool. -func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bap.BackendAddressPoolPropertiesFormat != nil { - objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat - } - if bap.Name != nil { - objectMap["name"] = bap.Name - } - if bap.ID != nil { - objectMap["id"] = bap.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. -func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat - err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) - if err != nil { - return err - } - bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bap.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bap.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bap.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bap.ID = &ID - } - } - } - - return nil -} - -// BackendAddressPoolPropertiesFormat properties of the backend address pool. -type BackendAddressPoolPropertiesFormat struct { - // LoadBalancerBackendAddresses - An array of backend addresses. - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - // BackendIPConfigurations - READ-ONLY; An array of references to IP addresses defined in network interfaces. - BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - // LoadBalancingRules - READ-ONLY; An array of references to load balancing rules that use this backend address pool. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // OutboundRule - READ-ONLY; A reference to an outbound rule that uses this backend address pool. - OutboundRule *SubResource `json:"outboundRule,omitempty"` - // OutboundRules - READ-ONLY; An array of references to outbound rules that use this backend address pool. - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. -func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bappf.LoadBalancerBackendAddresses != nil { - objectMap["loadBalancerBackendAddresses"] = bappf.LoadBalancerBackendAddresses - } - return json.Marshal(objectMap) -} - -// BastionActiveSession the session detail for a target. -type BastionActiveSession struct { - // SessionID - READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty"` - // StartTime - READ-ONLY; The time when the session started. - StartTime interface{} `json:"startTime,omitempty"` - // TargetSubscriptionID - READ-ONLY; The subscription id for the target virtual machine. - TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"` - // ResourceType - READ-ONLY; The type of the resource. - ResourceType *string `json:"resourceType,omitempty"` - // TargetHostName - READ-ONLY; The host name of the target. - TargetHostName *string `json:"targetHostName,omitempty"` - // TargetResourceGroup - READ-ONLY; The resource group of the target. - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` - // UserName - READ-ONLY; The user name who is active on this session. - UserName *string `json:"userName,omitempty"` - // TargetIPAddress - READ-ONLY; The IP Address of the target. - TargetIPAddress *string `json:"targetIpAddress,omitempty"` - // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'SSH', 'RDP' - Protocol BastionConnectProtocol `json:"protocol,omitempty"` - // TargetResourceID - READ-ONLY; The resource id of the target. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // SessionDurationInMins - READ-ONLY; Duration in mins the session has been active. - SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"` -} - -// BastionActiveSessionListResult response for GetActiveSessions. -type BastionActiveSessionListResult struct { - autorest.Response `json:"-"` - // Value - List of active sessions on the bastion. - Value *[]BastionActiveSession `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionActiveSessionListResultIterator provides access to a complete listing of BastionActiveSession -// values. -type BastionActiveSessionListResultIterator struct { - i int - page BastionActiveSessionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionActiveSessionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionActiveSessionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionActiveSessionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionActiveSessionListResultIterator) Response() BastionActiveSessionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionActiveSessionListResultIterator) Value() BastionActiveSession { - if !iter.page.NotDone() { - return BastionActiveSession{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionActiveSessionListResultIterator type. -func NewBastionActiveSessionListResultIterator(page BastionActiveSessionListResultPage) BastionActiveSessionListResultIterator { - return BastionActiveSessionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (baslr BastionActiveSessionListResult) IsEmpty() bool { - return baslr.Value == nil || len(*baslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (baslr BastionActiveSessionListResult) hasNextLink() bool { - return baslr.NextLink != nil && len(*baslr.NextLink) != 0 -} - -// bastionActiveSessionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (baslr BastionActiveSessionListResult) bastionActiveSessionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !baslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(baslr.NextLink))) -} - -// BastionActiveSessionListResultPage contains a page of BastionActiveSession values. -type BastionActiveSessionListResultPage struct { - fn func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error) - baslr BastionActiveSessionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionActiveSessionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.baslr) - if err != nil { - return err - } - page.baslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionActiveSessionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionActiveSessionListResultPage) NotDone() bool { - return !page.baslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionActiveSessionListResultPage) Response() BastionActiveSessionListResult { - return page.baslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionActiveSessionListResultPage) Values() []BastionActiveSession { - if page.baslr.IsEmpty() { - return nil - } - return *page.baslr.Value -} - -// Creates a new instance of the BastionActiveSessionListResultPage type. -func NewBastionActiveSessionListResultPage(cur BastionActiveSessionListResult, getNextPage func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error)) BastionActiveSessionListResultPage { - return BastionActiveSessionListResultPage{ - fn: getNextPage, - baslr: cur, - } -} - -// BastionHost bastion Host resource. -type BastionHost struct { - autorest.Response `json:"-"` - // BastionHostPropertiesFormat - Represents the bastion host resource. - *BastionHostPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for BastionHost. -func (bh BastionHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bh.BastionHostPropertiesFormat != nil { - objectMap["properties"] = bh.BastionHostPropertiesFormat - } - if bh.ID != nil { - objectMap["id"] = bh.ID - } - if bh.Location != nil { - objectMap["location"] = bh.Location - } - if bh.Tags != nil { - objectMap["tags"] = bh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BastionHost struct. -func (bh *BastionHost) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bastionHostPropertiesFormat BastionHostPropertiesFormat - err = json.Unmarshal(*v, &bastionHostPropertiesFormat) - if err != nil { - return err - } - bh.BastionHostPropertiesFormat = &bastionHostPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bh.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bh.Tags = tags - } - } - } - - return nil -} - -// BastionHostIPConfiguration IP configuration of an Bastion Host. -type BastionHostIPConfiguration struct { - // BastionHostIPConfigurationPropertiesFormat - Represents the ip configuration associated with the resource. - *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Ip configuration type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostIPConfiguration. -func (bhic BastionHostIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhic.BastionHostIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = bhic.BastionHostIPConfigurationPropertiesFormat - } - if bhic.Name != nil { - objectMap["name"] = bhic.Name - } - if bhic.ID != nil { - objectMap["id"] = bhic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BastionHostIPConfiguration struct. -func (bhic *BastionHostIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bastionHostIPConfigurationPropertiesFormat BastionHostIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &bastionHostIPConfigurationPropertiesFormat) - if err != nil { - return err - } - bhic.BastionHostIPConfigurationPropertiesFormat = &bastionHostIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bhic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bhic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bhic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bhic.ID = &ID - } - } - } - - return nil -} - -// BastionHostIPConfigurationPropertiesFormat properties of IP configuration of an Bastion Host. -type BastionHostIPConfigurationPropertiesFormat struct { - // Subnet - Reference of the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference of the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostIPConfigurationPropertiesFormat. -func (bhicpf BastionHostIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhicpf.Subnet != nil { - objectMap["subnet"] = bhicpf.Subnet - } - if bhicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = bhicpf.PublicIPAddress - } - if bhicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = bhicpf.PrivateIPAllocationMethod - } - return json.Marshal(objectMap) -} - -// BastionHostListResult response for ListBastionHosts API service call. -type BastionHostListResult struct { - autorest.Response `json:"-"` - // Value - List of Bastion Hosts in a resource group. - Value *[]BastionHost `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionHostListResultIterator provides access to a complete listing of BastionHost values. -type BastionHostListResultIterator struct { - i int - page BastionHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionHostListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionHostListResultIterator) Response() BastionHostListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionHostListResultIterator) Value() BastionHost { - if !iter.page.NotDone() { - return BastionHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionHostListResultIterator type. -func NewBastionHostListResultIterator(page BastionHostListResultPage) BastionHostListResultIterator { - return BastionHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bhlr BastionHostListResult) IsEmpty() bool { - return bhlr.Value == nil || len(*bhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bhlr BastionHostListResult) hasNextLink() bool { - return bhlr.NextLink != nil && len(*bhlr.NextLink) != 0 -} - -// bastionHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bhlr BastionHostListResult) bastionHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bhlr.NextLink))) -} - -// BastionHostListResultPage contains a page of BastionHost values. -type BastionHostListResultPage struct { - fn func(context.Context, BastionHostListResult) (BastionHostListResult, error) - bhlr BastionHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bhlr) - if err != nil { - return err - } - page.bhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionHostListResultPage) NotDone() bool { - return !page.bhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionHostListResultPage) Response() BastionHostListResult { - return page.bhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionHostListResultPage) Values() []BastionHost { - if page.bhlr.IsEmpty() { - return nil - } - return *page.bhlr.Value -} - -// Creates a new instance of the BastionHostListResultPage type. -func NewBastionHostListResultPage(cur BastionHostListResult, getNextPage func(context.Context, BastionHostListResult) (BastionHostListResult, error)) BastionHostListResultPage { - return BastionHostListResultPage{ - fn: getNextPage, - bhlr: cur, - } -} - -// BastionHostPropertiesFormat properties of the Bastion Host. -type BastionHostPropertiesFormat struct { - // IPConfigurations - IP configuration of the Bastion Host resource. - IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - // DNSName - FQDN for the endpoint on which bastion host is accessible. - DNSName *string `json:"dnsName,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostPropertiesFormat. -func (bhpf BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = bhpf.IPConfigurations - } - if bhpf.DNSName != nil { - objectMap["dnsName"] = bhpf.DNSName - } - return json.Marshal(objectMap) -} - -// BastionHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type BastionHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BastionHostsClient) (BastionHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BastionHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BastionHostsCreateOrUpdateFuture.Result. -func (future *BastionHostsCreateOrUpdateFuture) result(client BastionHostsClient) (bh BastionHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.BastionHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bh.Response.Response, err = future.GetResult(sender); err == nil && bh.Response.Response.StatusCode != http.StatusNoContent { - bh, err = client.CreateOrUpdateResponder(bh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", bh.Response.Response, "Failure responding to request") - } - } - return -} - -// BastionHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BastionHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BastionHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BastionHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BastionHostsDeleteFuture.Result. -func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.BastionHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// BastionSessionDeleteResult response for DisconnectActiveSessions. -type BastionSessionDeleteResult struct { - autorest.Response `json:"-"` - // Value - List of sessions with their corresponding state. - Value *[]BastionSessionState `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionSessionDeleteResultIterator provides access to a complete listing of BastionSessionState values. -type BastionSessionDeleteResultIterator struct { - i int - page BastionSessionDeleteResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionSessionDeleteResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionSessionDeleteResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionSessionDeleteResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionSessionDeleteResultIterator) Response() BastionSessionDeleteResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionSessionDeleteResultIterator) Value() BastionSessionState { - if !iter.page.NotDone() { - return BastionSessionState{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionSessionDeleteResultIterator type. -func NewBastionSessionDeleteResultIterator(page BastionSessionDeleteResultPage) BastionSessionDeleteResultIterator { - return BastionSessionDeleteResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsdr BastionSessionDeleteResult) IsEmpty() bool { - return bsdr.Value == nil || len(*bsdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsdr BastionSessionDeleteResult) hasNextLink() bool { - return bsdr.NextLink != nil && len(*bsdr.NextLink) != 0 -} - -// bastionSessionDeleteResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsdr BastionSessionDeleteResult) bastionSessionDeleteResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsdr.NextLink))) -} - -// BastionSessionDeleteResultPage contains a page of BastionSessionState values. -type BastionSessionDeleteResultPage struct { - fn func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error) - bsdr BastionSessionDeleteResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionSessionDeleteResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsdr) - if err != nil { - return err - } - page.bsdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionSessionDeleteResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionSessionDeleteResultPage) NotDone() bool { - return !page.bsdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionSessionDeleteResultPage) Response() BastionSessionDeleteResult { - return page.bsdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionSessionDeleteResultPage) Values() []BastionSessionState { - if page.bsdr.IsEmpty() { - return nil - } - return *page.bsdr.Value -} - -// Creates a new instance of the BastionSessionDeleteResultPage type. -func NewBastionSessionDeleteResultPage(cur BastionSessionDeleteResult, getNextPage func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error)) BastionSessionDeleteResultPage { - return BastionSessionDeleteResultPage{ - fn: getNextPage, - bsdr: cur, - } -} - -// BastionSessionState the session state detail for a target. -type BastionSessionState struct { - // SessionID - READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty"` - // Message - READ-ONLY; Used for extra information. - Message *string `json:"message,omitempty"` - // State - READ-ONLY; The state of the session. Disconnected/Failed/NotFound. - State *string `json:"state,omitempty"` -} - -// BastionShareableLink bastion Shareable Link. -type BastionShareableLink struct { - // VM - Reference of the virtual machine resource. - VM *VM `json:"vm,omitempty"` - // Bsl - READ-ONLY; The unique Bastion Shareable Link to the virtual machine. - Bsl *string `json:"bsl,omitempty"` - // CreatedAt - READ-ONLY; The time when the link was created. - CreatedAt *string `json:"createdAt,omitempty"` - // Message - READ-ONLY; Optional field indicating the warning or error message related to the vm in case of partial failure. - Message *string `json:"message,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionShareableLink. -func (bsl BastionShareableLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bsl.VM != nil { - objectMap["vm"] = bsl.VM - } - return json.Marshal(objectMap) -} - -// BastionShareableLinkListRequest post request for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListRequest struct { - // Vms - List of VM references. - Vms *[]BastionShareableLink `json:"vms,omitempty"` -} - -// BastionShareableLinkListResult response for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListResult struct { - autorest.Response `json:"-"` - // Value - List of Bastion Shareable Links for the request. - Value *[]BastionShareableLink `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionShareableLinkListResultIterator provides access to a complete listing of BastionShareableLink -// values. -type BastionShareableLinkListResultIterator struct { - i int - page BastionShareableLinkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionShareableLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionShareableLinkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionShareableLinkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionShareableLinkListResultIterator) Response() BastionShareableLinkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionShareableLinkListResultIterator) Value() BastionShareableLink { - if !iter.page.NotDone() { - return BastionShareableLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionShareableLinkListResultIterator type. -func NewBastionShareableLinkListResultIterator(page BastionShareableLinkListResultPage) BastionShareableLinkListResultIterator { - return BastionShareableLinkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsllr BastionShareableLinkListResult) IsEmpty() bool { - return bsllr.Value == nil || len(*bsllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsllr BastionShareableLinkListResult) hasNextLink() bool { - return bsllr.NextLink != nil && len(*bsllr.NextLink) != 0 -} - -// bastionShareableLinkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsllr BastionShareableLinkListResult) bastionShareableLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsllr.NextLink))) -} - -// BastionShareableLinkListResultPage contains a page of BastionShareableLink values. -type BastionShareableLinkListResultPage struct { - fn func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error) - bsllr BastionShareableLinkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionShareableLinkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsllr) - if err != nil { - return err - } - page.bsllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionShareableLinkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionShareableLinkListResultPage) NotDone() bool { - return !page.bsllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionShareableLinkListResultPage) Response() BastionShareableLinkListResult { - return page.bsllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionShareableLinkListResultPage) Values() []BastionShareableLink { - if page.bsllr.IsEmpty() { - return nil - } - return *page.bsllr.Value -} - -// Creates a new instance of the BastionShareableLinkListResultPage type. -func NewBastionShareableLinkListResultPage(cur BastionShareableLinkListResult, getNextPage func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error)) BastionShareableLinkListResultPage { - return BastionShareableLinkListResultPage{ - fn: getNextPage, - bsllr: cur, - } -} - -// BGPCommunity contains bgp community information offered in Service Community resources. -type BGPCommunity struct { - // ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global. - ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` - // CommunityName - The name of the bgp community. e.g. Skype. - CommunityName *string `json:"communityName,omitempty"` - // CommunityValue - The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - CommunityValue *string `json:"communityValue,omitempty"` - // CommunityPrefixes - The prefixes that the bgp community contains. - CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` - // IsAuthorizedToUse - Customer is authorized to use bgp community or not. - IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` - // ServiceGroup - The service group of the bgp community contains. - ServiceGroup *string `json:"serviceGroup,omitempty"` -} - -// BgpConnection virtual Appliance Site resource. -type BgpConnection struct { - autorest.Response `json:"-"` - // BgpConnectionProperties - The properties of the Bgp connections. - *BgpConnectionProperties `json:"properties,omitempty"` - // Name - Name of the connection. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Connection type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BgpConnection. -func (bc BgpConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bc.BgpConnectionProperties != nil { - objectMap["properties"] = bc.BgpConnectionProperties - } - if bc.Name != nil { - objectMap["name"] = bc.Name - } - if bc.ID != nil { - objectMap["id"] = bc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BgpConnection struct. -func (bc *BgpConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bgpConnectionProperties BgpConnectionProperties - err = json.Unmarshal(*v, &bgpConnectionProperties) - if err != nil { - return err - } - bc.BgpConnectionProperties = &bgpConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bc.ID = &ID - } - } - } - - return nil -} - -// BgpConnectionProperties properties of the bgp connection. -type BgpConnectionProperties struct { - // PeerAsn - Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - // PeerIP - Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ConnectionState - READ-ONLY; The current state of the VirtualHub to Peer. Possible values include: 'HubBgpConnectionStatusUnknown', 'HubBgpConnectionStatusConnecting', 'HubBgpConnectionStatusConnected', 'HubBgpConnectionStatusNotConnected' - ConnectionState HubBgpConnectionStatus `json:"connectionState,omitempty"` -} - -// MarshalJSON is the custom marshaler for BgpConnectionProperties. -func (bcp BgpConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bcp.PeerAsn != nil { - objectMap["peerAsn"] = bcp.PeerAsn - } - if bcp.PeerIP != nil { - objectMap["peerIp"] = bcp.PeerIP - } - return json.Marshal(objectMap) -} - -// BgpPeerStatus BGP peer status details. -type BgpPeerStatus struct { - // LocalAddress - READ-ONLY; The virtual network gateway's local address. - LocalAddress *string `json:"localAddress,omitempty"` - // Neighbor - READ-ONLY; The remote BGP peer. - Neighbor *string `json:"neighbor,omitempty"` - // Asn - READ-ONLY; The autonomous system number of the remote BGP peer. - Asn *int64 `json:"asn,omitempty"` - // State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected' - State BgpPeerState `json:"state,omitempty"` - // ConnectedDuration - READ-ONLY; For how long the peering has been up. - ConnectedDuration *string `json:"connectedDuration,omitempty"` - // RoutesReceived - READ-ONLY; The number of routes learned from this peer. - RoutesReceived *int64 `json:"routesReceived,omitempty"` - // MessagesSent - READ-ONLY; The number of BGP messages sent. - MessagesSent *int64 `json:"messagesSent,omitempty"` - // MessagesReceived - READ-ONLY; The number of BGP messages received. - MessagesReceived *int64 `json:"messagesReceived,omitempty"` -} - -// BgpPeerStatusListResult response for list BGP peer status API service call. -type BgpPeerStatusListResult struct { - autorest.Response `json:"-"` - // Value - List of BGP peers. - Value *[]BgpPeerStatus `json:"value,omitempty"` -} - -// BgpServiceCommunity service Community Properties. -type BgpServiceCommunity struct { - // BgpServiceCommunityPropertiesFormat - Properties of the BGP service community. - *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for BgpServiceCommunity. -func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bsc.BgpServiceCommunityPropertiesFormat != nil { - objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat - } - if bsc.ID != nil { - objectMap["id"] = bsc.ID - } - if bsc.Location != nil { - objectMap["location"] = bsc.Location - } - if bsc.Tags != nil { - objectMap["tags"] = bsc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. -func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat - err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat) - if err != nil { - return err - } - bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bsc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bsc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bsc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bsc.Tags = tags - } - } - } - - return nil -} - -// BgpServiceCommunityListResult response for the ListServiceCommunity API service call. -type BgpServiceCommunityListResult struct { - autorest.Response `json:"-"` - // Value - A list of service community resources. - Value *[]BgpServiceCommunity `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity -// values. -type BgpServiceCommunityListResultIterator struct { - i int - page BgpServiceCommunityListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BgpServiceCommunityListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BgpServiceCommunityListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BgpServiceCommunityListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity { - if !iter.page.NotDone() { - return BgpServiceCommunity{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BgpServiceCommunityListResultIterator type. -func NewBgpServiceCommunityListResultIterator(page BgpServiceCommunityListResultPage) BgpServiceCommunityListResultIterator { - return BgpServiceCommunityListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { - return bsclr.Value == nil || len(*bsclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsclr BgpServiceCommunityListResult) hasNextLink() bool { - return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0 -} - -// bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsclr.NextLink))) -} - -// BgpServiceCommunityListResultPage contains a page of BgpServiceCommunity values. -type BgpServiceCommunityListResultPage struct { - fn func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error) - bsclr BgpServiceCommunityListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsclr) - if err != nil { - return err - } - page.bsclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BgpServiceCommunityListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BgpServiceCommunityListResultPage) NotDone() bool { - return !page.bsclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult { - return page.bsclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity { - if page.bsclr.IsEmpty() { - return nil - } - return *page.bsclr.Value -} - -// Creates a new instance of the BgpServiceCommunityListResultPage type. -func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage { - return BgpServiceCommunityListResultPage{ - fn: getNextPage, - bsclr: cur, - } -} - -// BgpServiceCommunityPropertiesFormat properties of Service Community. -type BgpServiceCommunityPropertiesFormat struct { - // ServiceName - The name of the bgp community. e.g. Skype. - ServiceName *string `json:"serviceName,omitempty"` - // BgpCommunities - A list of bgp communities. - BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` -} - -// BgpSettings BGP settings details. -type BgpSettings struct { - // Asn - The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - // PeerWeight - The weight added to routes learned from this BGP speaker. - PeerWeight *int32 `json:"peerWeight,omitempty"` - // BgpPeeringAddresses - BGP peering address with IP configuration ID for virtual network gateway. - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` -} - -// BreakOutCategoryPolicies network Virtual Appliance Sku Properties. -type BreakOutCategoryPolicies struct { - // Allow - Flag to control breakout of o365 allow category. - Allow *bool `json:"allow,omitempty"` - // Optimize - Flag to control breakout of o365 optimize category. - Optimize *bool `json:"optimize,omitempty"` - // Default - Flag to control breakout of o365 default category. - Default *bool `json:"default,omitempty"` -} - -// CheckPrivateLinkServiceVisibilityRequest request body of the CheckPrivateLinkServiceVisibility API -// service call. -type CheckPrivateLinkServiceVisibilityRequest struct { - // PrivateLinkServiceAlias - The alias of the private link service. - PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` -} - -// CloudError an error response from the service. -type CloudError struct { - // Error - Cloud error body. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody an error response from the service. -type CloudErrorBody struct { - // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Target - The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` - // Details - A list of additional details about the error. - Details *[]CloudErrorBody `json:"details,omitempty"` -} - -// ConfigurationDiagnosticParameters parameters to get network configuration diagnostic. -type ConfigurationDiagnosticParameters struct { - // TargetResourceID - The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // VerbosityLevel - Verbosity level. Possible values include: 'Normal', 'Minimum', 'Full' - VerbosityLevel VerbosityLevel `json:"verbosityLevel,omitempty"` - // Profiles - List of network configuration diagnostic profiles. - Profiles *[]ConfigurationDiagnosticProfile `json:"profiles,omitempty"` -} - -// ConfigurationDiagnosticProfile parameters to compare with network configuration. -type ConfigurationDiagnosticProfile struct { - // Direction - The direction of the traffic. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // Protocol - Protocol to be verified on. Accepted values are '*', TCP, UDP. - Protocol *string `json:"protocol,omitempty"` - // Source - Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - Source *string `json:"source,omitempty"` - // Destination - Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. - Destination *string `json:"destination,omitempty"` - // DestinationPort - Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). - DestinationPort *string `json:"destinationPort,omitempty"` -} - -// ConfigurationDiagnosticResponse results of network configuration diagnostic on the target resource. -type ConfigurationDiagnosticResponse struct { - autorest.Response `json:"-"` - // Results - READ-ONLY; List of network configuration diagnostic results. - Results *[]ConfigurationDiagnosticResult `json:"results,omitempty"` -} - -// ConfigurationDiagnosticResult network configuration diagnostic result corresponded to provided traffic -// query. -type ConfigurationDiagnosticResult struct { - // Profile - Network configuration diagnostic profile. - Profile *ConfigurationDiagnosticProfile `json:"profile,omitempty"` - // NetworkSecurityGroupResult - Network security group result. - NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` -} - -// ConnectionMonitor parameters that define the operation to create a connection monitor. -type ConnectionMonitor struct { - // Location - Connection monitor location. - Location *string `json:"location,omitempty"` - // Tags - Connection monitor tags. - Tags map[string]*string `json:"tags"` - // ConnectionMonitorParameters - Properties of the connection monitor. - *ConnectionMonitorParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitor. -func (cm ConnectionMonitor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cm.Location != nil { - objectMap["location"] = cm.Location - } - if cm.Tags != nil { - objectMap["tags"] = cm.Tags - } - if cm.ConnectionMonitorParameters != nil { - objectMap["properties"] = cm.ConnectionMonitorParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionMonitor struct. -func (cm *ConnectionMonitor) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cm.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cm.Tags = tags - } - case "properties": - if v != nil { - var connectionMonitorParameters ConnectionMonitorParameters - err = json.Unmarshal(*v, &connectionMonitorParameters) - if err != nil { - return err - } - cm.ConnectionMonitorParameters = &connectionMonitorParameters - } - } - } - - return nil -} - -// ConnectionMonitorDestination describes the destination of connection monitor. -type ConnectionMonitorDestination struct { - // ResourceID - The ID of the resource used as the destination by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` - // Address - Address of the connection monitor destination (IP or domain name). - Address *string `json:"address,omitempty"` - // Port - The destination port used by connection monitor. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorEndpoint describes the connection monitor endpoint. -type ConnectionMonitorEndpoint struct { - // Name - The name of the connection monitor endpoint. - Name *string `json:"name,omitempty"` - // ResourceID - Resource ID of the connection monitor endpoint. - ResourceID *string `json:"resourceId,omitempty"` - // Address - Address of the connection monitor endpoint (IP or domain name). - Address *string `json:"address,omitempty"` - // Filter - Filter for sub-items within the endpoint. - Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` -} - -// ConnectionMonitorEndpointFilter describes the connection monitor endpoint filter. -type ConnectionMonitorEndpointFilter struct { - // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'Include' - Type ConnectionMonitorEndpointFilterType `json:"type,omitempty"` - // Items - List of items in the filter. - Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` -} - -// ConnectionMonitorEndpointFilterItem describes the connection monitor endpoint filter item. -type ConnectionMonitorEndpointFilterItem struct { - // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'AgentAddress' - Type ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` - // Address - The address of the filter item. - Address *string `json:"address,omitempty"` -} - -// ConnectionMonitorHTTPConfiguration describes the HTTP configuration. -type ConnectionMonitorHTTPConfiguration struct { - // Port - The port to connect to. - Port *int32 `json:"port,omitempty"` - // Method - The HTTP method to use. Possible values include: 'Get', 'Post' - Method HTTPConfigurationMethod `json:"method,omitempty"` - // Path - The path component of the URI. For instance, "/dir1/dir2". - Path *string `json:"path,omitempty"` - // RequestHeaders - The HTTP headers to transmit with the request. - RequestHeaders *[]HTTPHeader `json:"requestHeaders,omitempty"` - // ValidStatusCodeRanges - HTTP status codes to consider successful. For instance, "2xx,301-304,418". - ValidStatusCodeRanges *[]string `json:"validStatusCodeRanges,omitempty"` - // PreferHTTPS - Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. - PreferHTTPS *bool `json:"preferHTTPS,omitempty"` -} - -// ConnectionMonitorIcmpConfiguration describes the ICMP configuration. -type ConnectionMonitorIcmpConfiguration struct { - // DisableTraceRoute - Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} - -// ConnectionMonitorListResult list of connection monitors. -type ConnectionMonitorListResult struct { - autorest.Response `json:"-"` - // Value - Information about connection monitors. - Value *[]ConnectionMonitorResult `json:"value,omitempty"` -} - -// ConnectionMonitorOutput describes a connection monitor output destination. -type ConnectionMonitorOutput struct { - // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'Workspace' - Type OutputType `json:"type,omitempty"` - // WorkspaceSettings - Describes the settings for producing output into a log analytics workspace. - WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` -} - -// ConnectionMonitorParameters parameters that define the operation to create a connection monitor. -type ConnectionMonitorParameters struct { - // Source - Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - // Destination - Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - // AutoStart - Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - // MonitoringIntervalInSeconds - Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - // Endpoints - List of connection monitor endpoints. - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - // TestConfigurations - List of connection monitor test configurations. - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - // TestGroups - List of connection monitor test groups. - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` - // Outputs - List of connection monitor outputs. - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - // Notes - Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` -} - -// ConnectionMonitorQueryResult list of connection states snapshots. -type ConnectionMonitorQueryResult struct { - autorest.Response `json:"-"` - // SourceStatus - Status of connection monitor source. Possible values include: 'ConnectionMonitorSourceStatusUnknown', 'ConnectionMonitorSourceStatusActive', 'ConnectionMonitorSourceStatusInactive' - SourceStatus ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` - // States - Information about connection states. - States *[]ConnectionStateSnapshot `json:"states,omitempty"` -} - -// ConnectionMonitorResult information about the connection monitor. -type ConnectionMonitorResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the connection monitor. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; ID of the connection monitor. - ID *string `json:"id,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Connection monitor type. - Type *string `json:"type,omitempty"` - // Location - Connection monitor location. - Location *string `json:"location,omitempty"` - // Tags - Connection monitor tags. - Tags map[string]*string `json:"tags"` - // ConnectionMonitorResultProperties - Properties of the connection monitor result. - *ConnectionMonitorResultProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitorResult. -func (cmr ConnectionMonitorResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cmr.Location != nil { - objectMap["location"] = cmr.Location - } - if cmr.Tags != nil { - objectMap["tags"] = cmr.Tags - } - if cmr.ConnectionMonitorResultProperties != nil { - objectMap["properties"] = cmr.ConnectionMonitorResultProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionMonitorResult struct. -func (cmr *ConnectionMonitorResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cmr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cmr.ID = &ID - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cmr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cmr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cmr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cmr.Tags = tags - } - case "properties": - if v != nil { - var connectionMonitorResultProperties ConnectionMonitorResultProperties - err = json.Unmarshal(*v, &connectionMonitorResultProperties) - if err != nil { - return err - } - cmr.ConnectionMonitorResultProperties = &connectionMonitorResultProperties - } - } - } - - return nil -} - -// ConnectionMonitorResultProperties describes the properties of a connection monitor. -type ConnectionMonitorResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // StartTime - READ-ONLY; The date and time when the connection monitor was started. - StartTime *date.Time `json:"startTime,omitempty"` - // MonitoringStatus - READ-ONLY; The monitoring status of the connection monitor. - MonitoringStatus *string `json:"monitoringStatus,omitempty"` - // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' - ConnectionMonitorType ConnectionMonitorType `json:"connectionMonitorType,omitempty"` - // Source - Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - // Destination - Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - // AutoStart - Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - // MonitoringIntervalInSeconds - Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - // Endpoints - List of connection monitor endpoints. - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - // TestConfigurations - List of connection monitor test configurations. - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - // TestGroups - List of connection monitor test groups. - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` - // Outputs - List of connection monitor outputs. - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - // Notes - Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitorResultProperties. -func (cmrp ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cmrp.Source != nil { - objectMap["source"] = cmrp.Source - } - if cmrp.Destination != nil { - objectMap["destination"] = cmrp.Destination - } - if cmrp.AutoStart != nil { - objectMap["autoStart"] = cmrp.AutoStart - } - if cmrp.MonitoringIntervalInSeconds != nil { - objectMap["monitoringIntervalInSeconds"] = cmrp.MonitoringIntervalInSeconds - } - if cmrp.Endpoints != nil { - objectMap["endpoints"] = cmrp.Endpoints - } - if cmrp.TestConfigurations != nil { - objectMap["testConfigurations"] = cmrp.TestConfigurations - } - if cmrp.TestGroups != nil { - objectMap["testGroups"] = cmrp.TestGroups - } - if cmrp.Outputs != nil { - objectMap["outputs"] = cmrp.Outputs - } - if cmrp.Notes != nil { - objectMap["notes"] = cmrp.Notes - } - return json.Marshal(objectMap) -} - -// ConnectionMonitorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConnectionMonitorsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (ConnectionMonitorResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsCreateOrUpdateFuture.Result. -func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cmr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cmr.Response.Response, err = future.GetResult(sender); err == nil && cmr.Response.Response.StatusCode != http.StatusNoContent { - cmr, err = client.CreateOrUpdateResponder(cmr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", cmr.Response.Response, "Failure responding to request") - } - } - return -} - -// ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConnectionMonitorsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsDeleteFuture.Result. -func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorSource describes the source of connection monitor. -type ConnectionMonitorSource struct { - // ResourceID - The ID of the resource used as the source by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` - // Port - The source port used by connection monitor. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorsQueryFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsQueryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (ConnectionMonitorQueryResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsQueryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsQueryFuture.Result. -func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cmqr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsQueryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cmqr.Response.Response, err = future.GetResult(sender); err == nil && cmqr.Response.Response.StatusCode != http.StatusNoContent { - cmqr, err = client.QueryResponder(cmqr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", cmqr.Response.Response, "Failure responding to request") - } - } - return -} - -// ConnectionMonitorsStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsStartFuture.Result. -func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorsStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsStopFuture.Result. -func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStopFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorSuccessThreshold describes the threshold for declaring a test successful. -type ConnectionMonitorSuccessThreshold struct { - // ChecksFailedPercent - The maximum percentage of failed checks permitted for a test to evaluate as successful. - ChecksFailedPercent *int32 `json:"checksFailedPercent,omitempty"` - // RoundTripTimeMs - The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. - RoundTripTimeMs *float64 `json:"roundTripTimeMs,omitempty"` -} - -// ConnectionMonitorTCPConfiguration describes the TCP configuration. -type ConnectionMonitorTCPConfiguration struct { - // Port - The port to connect to. - Port *int32 `json:"port,omitempty"` - // DisableTraceRoute - Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} - -// ConnectionMonitorTestConfiguration describes a connection monitor test configuration. -type ConnectionMonitorTestConfiguration struct { - // Name - The name of the connection monitor test configuration. - Name *string `json:"name,omitempty"` - // TestFrequencySec - The frequency of test evaluation, in seconds. - TestFrequencySec *int32 `json:"testFrequencySec,omitempty"` - // Protocol - The protocol to use in test evaluation. Possible values include: 'ConnectionMonitorTestConfigurationProtocolTCP', 'ConnectionMonitorTestConfigurationProtocolHTTP', 'ConnectionMonitorTestConfigurationProtocolIcmp' - Protocol ConnectionMonitorTestConfigurationProtocol `json:"protocol,omitempty"` - // PreferredIPVersion - The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending on other parameters. Possible values include: 'PreferredIPVersionIPv4', 'PreferredIPVersionIPv6' - PreferredIPVersion PreferredIPVersion `json:"preferredIPVersion,omitempty"` - // HTTPConfiguration - The parameters used to perform test evaluation over HTTP. - HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"` - // TCPConfiguration - The parameters used to perform test evaluation over TCP. - TCPConfiguration *ConnectionMonitorTCPConfiguration `json:"tcpConfiguration,omitempty"` - // IcmpConfiguration - The parameters used to perform test evaluation over ICMP. - IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"` - // SuccessThreshold - The threshold for declaring a test successful. - SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"` -} - -// ConnectionMonitorTestGroup describes the connection monitor test group. -type ConnectionMonitorTestGroup struct { - // Name - The name of the connection monitor test group. - Name *string `json:"name,omitempty"` - // Disable - Value indicating whether test group is disabled. - Disable *bool `json:"disable,omitempty"` - // TestConfigurations - List of test configuration names. - TestConfigurations *[]string `json:"testConfigurations,omitempty"` - // Sources - List of source endpoint names. - Sources *[]string `json:"sources,omitempty"` - // Destinations - List of destination endpoint names. - Destinations *[]string `json:"destinations,omitempty"` -} - -// ConnectionMonitorWorkspaceSettings describes the settings for producing output into a log analytics -// workspace. -type ConnectionMonitorWorkspaceSettings struct { - // WorkspaceResourceID - Log analytics workspace resource ID. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` -} - -// ConnectionResetSharedKey the virtual network connection reset shared key. -type ConnectionResetSharedKey struct { - autorest.Response `json:"-"` - // KeyLength - The virtual network connection reset shared key length, should between 1 and 128. - KeyLength *int32 `json:"keyLength,omitempty"` -} - -// ConnectionSharedKey response for GetConnectionSharedKey API service call. -type ConnectionSharedKey struct { - autorest.Response `json:"-"` - // Value - The virtual network connection shared key value. - Value *string `json:"value,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// ConnectionStateSnapshot connection state snapshot. -type ConnectionStateSnapshot struct { - // ConnectionState - The connection state. Possible values include: 'ConnectionStateReachable', 'ConnectionStateUnreachable', 'ConnectionStateUnknown' - ConnectionState ConnectionState `json:"connectionState,omitempty"` - // StartTime - The start time of the connection snapshot. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time of the connection snapshot. - EndTime *date.Time `json:"endTime,omitempty"` - // EvaluationState - Connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed' - EvaluationState EvaluationState `json:"evaluationState,omitempty"` - // AvgLatencyInMs - Average latency in ms. - AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` - // MinLatencyInMs - Minimum latency in ms. - MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` - // MaxLatencyInMs - Maximum latency in ms. - MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` - // ProbesSent - The number of sent probes. - ProbesSent *int32 `json:"probesSent,omitempty"` - // ProbesFailed - The number of failed probes. - ProbesFailed *int32 `json:"probesFailed,omitempty"` - // Hops - READ-ONLY; List of hops between the source and the destination. - Hops *[]ConnectivityHop `json:"hops,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionStateSnapshot. -func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if CSS.ConnectionState != "" { - objectMap["connectionState"] = CSS.ConnectionState - } - if CSS.StartTime != nil { - objectMap["startTime"] = CSS.StartTime - } - if CSS.EndTime != nil { - objectMap["endTime"] = CSS.EndTime - } - if CSS.EvaluationState != "" { - objectMap["evaluationState"] = CSS.EvaluationState - } - if CSS.AvgLatencyInMs != nil { - objectMap["avgLatencyInMs"] = CSS.AvgLatencyInMs - } - if CSS.MinLatencyInMs != nil { - objectMap["minLatencyInMs"] = CSS.MinLatencyInMs - } - if CSS.MaxLatencyInMs != nil { - objectMap["maxLatencyInMs"] = CSS.MaxLatencyInMs - } - if CSS.ProbesSent != nil { - objectMap["probesSent"] = CSS.ProbesSent - } - if CSS.ProbesFailed != nil { - objectMap["probesFailed"] = CSS.ProbesFailed - } - return json.Marshal(objectMap) -} - -// ConnectivityDestination parameters that define destination of connection. -type ConnectivityDestination struct { - // ResourceID - The ID of the resource to which a connection attempt will be made. - ResourceID *string `json:"resourceId,omitempty"` - // Address - The IP address or URI the resource to which a connection attempt will be made. - Address *string `json:"address,omitempty"` - // Port - Port on which check connectivity will be performed. - Port *int32 `json:"port,omitempty"` -} - -// ConnectivityHop information about a hop between the source and the destination. -type ConnectivityHop struct { - // Type - READ-ONLY; The type of the hop. - Type *string `json:"type,omitempty"` - // ID - READ-ONLY; The ID of the hop. - ID *string `json:"id,omitempty"` - // Address - READ-ONLY; The IP address of the hop. - Address *string `json:"address,omitempty"` - // ResourceID - READ-ONLY; The ID of the resource corresponding to this hop. - ResourceID *string `json:"resourceId,omitempty"` - // NextHopIds - READ-ONLY; List of next hop identifiers. - NextHopIds *[]string `json:"nextHopIds,omitempty"` - // PreviousHopIds - READ-ONLY; List of previous hop identifiers. - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - // Links - READ-ONLY; List of hop links. - Links *[]HopLink `json:"links,omitempty"` - // PreviousLinks - READ-ONLY; List of previous hop links. - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - // Issues - READ-ONLY; List of issues. - Issues *[]ConnectivityIssue `json:"issues,omitempty"` -} - -// ConnectivityInformation information on the connectivity status. -type ConnectivityInformation struct { - autorest.Response `json:"-"` - // Hops - READ-ONLY; List of hops between the source and the destination. - Hops *[]ConnectivityHop `json:"hops,omitempty"` - // ConnectionStatus - READ-ONLY; The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded' - ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"` - // AvgLatencyInMs - READ-ONLY; Average latency in milliseconds. - AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` - // MinLatencyInMs - READ-ONLY; Minimum latency in milliseconds. - MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` - // MaxLatencyInMs - READ-ONLY; Maximum latency in milliseconds. - MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` - // ProbesSent - READ-ONLY; Total number of probes sent. - ProbesSent *int32 `json:"probesSent,omitempty"` - // ProbesFailed - READ-ONLY; Number of failed probes. - ProbesFailed *int32 `json:"probesFailed,omitempty"` -} - -// ConnectivityIssue information about an issue encountered in the process of checking for connectivity. -type ConnectivityIssue struct { - // Origin - READ-ONLY; The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound' - Origin Origin `json:"origin,omitempty"` - // Severity - READ-ONLY; The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning' - Severity Severity `json:"severity,omitempty"` - // Type - READ-ONLY; The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform' - Type IssueType `json:"type,omitempty"` - // Context - READ-ONLY; Provides additional context on the issue. - Context *[]map[string]*string `json:"context,omitempty"` -} - -// ConnectivityParameters parameters that determine how the connectivity check will be performed. -type ConnectivityParameters struct { - // Source - The source of the connection. - Source *ConnectivitySource `json:"source,omitempty"` - // Destination - The destination of connection. - Destination *ConnectivityDestination `json:"destination,omitempty"` - // Protocol - Network protocol. Possible values include: 'ProtocolTCP', 'ProtocolHTTP', 'ProtocolHTTPS', 'ProtocolIcmp' - Protocol Protocol `json:"protocol,omitempty"` - // ProtocolConfiguration - Configuration of the protocol. - ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPv4', 'IPv6' - PreferredIPVersion IPVersion `json:"preferredIPVersion,omitempty"` -} - -// ConnectivitySource parameters that define the source of the connection. -type ConnectivitySource struct { - // ResourceID - The ID of the resource from which a connectivity check will be initiated. - ResourceID *string `json:"resourceId,omitempty"` - // Port - The source port from which a connectivity check will be performed. - Port *int32 `json:"port,omitempty"` -} - -// Container reference to container resource in remote resource provider. -type Container struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// ContainerNetworkInterface container network interface child resource. -type ContainerNetworkInterface struct { - // ContainerNetworkInterfacePropertiesFormat - Container network interface properties. - *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterface. -func (cni ContainerNetworkInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cni.ContainerNetworkInterfacePropertiesFormat != nil { - objectMap["properties"] = cni.ContainerNetworkInterfacePropertiesFormat - } - if cni.Name != nil { - objectMap["name"] = cni.Name - } - if cni.ID != nil { - objectMap["id"] = cni.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterface struct. -func (cni *ContainerNetworkInterface) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfacePropertiesFormat ContainerNetworkInterfacePropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfacePropertiesFormat) - if err != nil { - return err - } - cni.ContainerNetworkInterfacePropertiesFormat = &containerNetworkInterfacePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cni.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cni.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cni.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cni.ID = &ID - } - } - } - - return nil -} - -// ContainerNetworkInterfaceConfiguration container network interface configuration child resource. -type ContainerNetworkInterfaceConfiguration struct { - // ContainerNetworkInterfaceConfigurationPropertiesFormat - Container network interface configuration properties. - *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfiguration. -func (cnic ContainerNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat != nil { - objectMap["properties"] = cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat - } - if cnic.Name != nil { - objectMap["name"] = cnic.Name - } - if cnic.ID != nil { - objectMap["id"] = cnic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterfaceConfiguration struct. -func (cnic *ContainerNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfaceConfigurationPropertiesFormat ContainerNetworkInterfaceConfigurationPropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfaceConfigurationPropertiesFormat) - if err != nil { - return err - } - cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat = &containerNetworkInterfaceConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cnic.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cnic.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cnic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cnic.ID = &ID - } - } - } - - return nil -} - -// ContainerNetworkInterfaceConfigurationPropertiesFormat container network interface configuration -// properties. -type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { - // IPConfigurations - A list of ip configurations of the container network interface configuration. - IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` - // ContainerNetworkInterfaces - A list of container network interfaces created from this container network interface configuration. - ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfigurationPropertiesFormat. -func (cnicpf ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnicpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = cnicpf.IPConfigurations - } - if cnicpf.ContainerNetworkInterfaces != nil { - objectMap["containerNetworkInterfaces"] = cnicpf.ContainerNetworkInterfaces - } - return json.Marshal(objectMap) -} - -// ContainerNetworkInterfaceIPConfiguration the ip configuration for a container network interface. -type ContainerNetworkInterfaceIPConfiguration struct { - // ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. - *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceIPConfiguration. -func (cniic ContainerNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat - } - if cniic.Name != nil { - objectMap["name"] = cniic.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterfaceIPConfiguration struct. -func (cniic *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfaceIPConfigurationPropertiesFormat ContainerNetworkInterfaceIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfaceIPConfigurationPropertiesFormat) - if err != nil { - return err - } - cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat = &containerNetworkInterfaceIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cniic.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cniic.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cniic.Etag = &etag - } - } - } - - return nil -} - -// ContainerNetworkInterfaceIPConfigurationPropertiesFormat properties of the container network interface -// IP configuration. -type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// ContainerNetworkInterfacePropertiesFormat properties of container network interface. -type ContainerNetworkInterfacePropertiesFormat struct { - // ContainerNetworkInterfaceConfiguration - READ-ONLY; Container network interface configuration from which this container network interface is created. - ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty"` - // Container - Reference to the container to which this container network interface is attached. - Container *Container `json:"container,omitempty"` - // IPConfigurations - READ-ONLY; Reference to the ip configuration on this container nic. - IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfacePropertiesFormat. -func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnipf.Container != nil { - objectMap["container"] = cnipf.Container - } - return json.Marshal(objectMap) -} - -// CustomDNSConfigPropertiesFormat contains custom Dns resolution configuration from customer. -type CustomDNSConfigPropertiesFormat struct { - // Fqdn - Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - // IPAddresses - A list of private ip addresses of the private endpoint. - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - -// DdosCustomPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosCustomPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosCustomPoliciesClient) (DdosCustomPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosCustomPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosCustomPoliciesCreateOrUpdateFuture.Result. -func (future *DdosCustomPoliciesCreateOrUpdateFuture) result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dcp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dcp.Response.Response, err = future.GetResult(sender); err == nil && dcp.Response.Response.StatusCode != http.StatusNoContent { - dcp, err = client.CreateOrUpdateResponder(dcp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", dcp.Response.Response, "Failure responding to request") - } - } - return -} - -// DdosCustomPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosCustomPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosCustomPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosCustomPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosCustomPoliciesDeleteFuture.Result. -func (future *DdosCustomPoliciesDeleteFuture) result(client DdosCustomPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DdosCustomPolicy a DDoS custom policy in a resource group. -type DdosCustomPolicy struct { - autorest.Response `json:"-"` - // DdosCustomPolicyPropertiesFormat - Properties of the DDoS custom policy. - *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DdosCustomPolicy. -func (dcp DdosCustomPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcp.DdosCustomPolicyPropertiesFormat != nil { - objectMap["properties"] = dcp.DdosCustomPolicyPropertiesFormat - } - if dcp.ID != nil { - objectMap["id"] = dcp.ID - } - if dcp.Location != nil { - objectMap["location"] = dcp.Location - } - if dcp.Tags != nil { - objectMap["tags"] = dcp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DdosCustomPolicy struct. -func (dcp *DdosCustomPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var ddosCustomPolicyPropertiesFormat DdosCustomPolicyPropertiesFormat - err = json.Unmarshal(*v, &ddosCustomPolicyPropertiesFormat) - if err != nil { - return err - } - dcp.DdosCustomPolicyPropertiesFormat = &ddosCustomPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dcp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dcp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dcp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dcp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dcp.Tags = tags - } - } - } - - return nil -} - -// DdosCustomPolicyPropertiesFormat dDoS custom policy properties. -type DdosCustomPolicyPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS custom policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PublicIPAddresses - READ-ONLY; The list of public IPs associated with the DDoS custom policy resource. This list is read-only. - PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` - // ProtocolCustomSettings - The protocol-specific DDoS policy customization parameters. - ProtocolCustomSettings *[]ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosCustomPolicyPropertiesFormat. -func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcppf.ProtocolCustomSettings != nil { - objectMap["protocolCustomSettings"] = dcppf.ProtocolCustomSettings - } - return json.Marshal(objectMap) -} - -// DdosProtectionPlan a DDoS protection plan in a resource group. -type DdosProtectionPlan struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // DdosProtectionPlanPropertiesFormat - Properties of the DDoS protection plan. - *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosProtectionPlan. -func (dpp DdosProtectionPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpp.Location != nil { - objectMap["location"] = dpp.Location - } - if dpp.Tags != nil { - objectMap["tags"] = dpp.Tags - } - if dpp.DdosProtectionPlanPropertiesFormat != nil { - objectMap["properties"] = dpp.DdosProtectionPlanPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DdosProtectionPlan struct. -func (dpp *DdosProtectionPlan) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dpp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dpp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dpp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dpp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dpp.Tags = tags - } - case "properties": - if v != nil { - var ddosProtectionPlanPropertiesFormat DdosProtectionPlanPropertiesFormat - err = json.Unmarshal(*v, &ddosProtectionPlanPropertiesFormat) - if err != nil { - return err - } - dpp.DdosProtectionPlanPropertiesFormat = &ddosProtectionPlanPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dpp.Etag = &etag - } - } - } - - return nil -} - -// DdosProtectionPlanListResult a list of DDoS protection plans. -type DdosProtectionPlanListResult struct { - autorest.Response `json:"-"` - // Value - A list of DDoS protection plans. - Value *[]DdosProtectionPlan `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosProtectionPlanListResult. -func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpplr.Value != nil { - objectMap["value"] = dpplr.Value - } - return json.Marshal(objectMap) -} - -// DdosProtectionPlanListResultIterator provides access to a complete listing of DdosProtectionPlan values. -type DdosProtectionPlanListResultIterator struct { - i int - page DdosProtectionPlanListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DdosProtectionPlanListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DdosProtectionPlanListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DdosProtectionPlanListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DdosProtectionPlanListResultIterator) Response() DdosProtectionPlanListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DdosProtectionPlanListResultIterator) Value() DdosProtectionPlan { - if !iter.page.NotDone() { - return DdosProtectionPlan{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DdosProtectionPlanListResultIterator type. -func NewDdosProtectionPlanListResultIterator(page DdosProtectionPlanListResultPage) DdosProtectionPlanListResultIterator { - return DdosProtectionPlanListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dpplr DdosProtectionPlanListResult) IsEmpty() bool { - return dpplr.Value == nil || len(*dpplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dpplr DdosProtectionPlanListResult) hasNextLink() bool { - return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0 -} - -// ddosProtectionPlanListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dpplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dpplr.NextLink))) -} - -// DdosProtectionPlanListResultPage contains a page of DdosProtectionPlan values. -type DdosProtectionPlanListResultPage struct { - fn func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error) - dpplr DdosProtectionPlanListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dpplr) - if err != nil { - return err - } - page.dpplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DdosProtectionPlanListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DdosProtectionPlanListResultPage) NotDone() bool { - return !page.dpplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DdosProtectionPlanListResultPage) Response() DdosProtectionPlanListResult { - return page.dpplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DdosProtectionPlanListResultPage) Values() []DdosProtectionPlan { - if page.dpplr.IsEmpty() { - return nil - } - return *page.dpplr.Value -} - -// Creates a new instance of the DdosProtectionPlanListResultPage type. -func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage { - return DdosProtectionPlanListResultPage{ - fn: getNextPage, - dpplr: cur, - } -} - -// DdosProtectionPlanPropertiesFormat dDoS protection plan properties. -type DdosProtectionPlanPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VirtualNetworks - READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. - VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` -} - -// DdosProtectionPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosProtectionPlansCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosProtectionPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosProtectionPlansCreateOrUpdateFuture.Result. -func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dpp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dpp.Response.Response, err = future.GetResult(sender); err == nil && dpp.Response.Response.StatusCode != http.StatusNoContent { - dpp, err = client.CreateOrUpdateResponder(dpp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", dpp.Response.Response, "Failure responding to request") - } - } - return -} - -// DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosProtectionPlansDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosProtectionPlansClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosProtectionPlansDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosProtectionPlansDeleteFuture.Result. -func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DdosSettings contains the DDoS protection settings of the public IP. -type DdosSettings struct { - // DdosCustomPolicy - The DDoS custom policy associated with the public IP. - DdosCustomPolicy *SubResource `json:"ddosCustomPolicy,omitempty"` - // ProtectionCoverage - The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized. Possible values include: 'DdosSettingsProtectionCoverageBasic', 'DdosSettingsProtectionCoverageStandard' - ProtectionCoverage DdosSettingsProtectionCoverage `json:"protectionCoverage,omitempty"` - // ProtectedIP - Enables DDoS protection on the public IP. - ProtectedIP *bool `json:"protectedIP,omitempty"` -} - -// Delegation details the service to which the subnet is delegated. -type Delegation struct { - // ServiceDelegationPropertiesFormat - Properties of the subnet. - *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a subnet. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Delegation. -func (d Delegation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.ServiceDelegationPropertiesFormat != nil { - objectMap["properties"] = d.ServiceDelegationPropertiesFormat - } - if d.Name != nil { - objectMap["name"] = d.Name - } - if d.ID != nil { - objectMap["id"] = d.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Delegation struct. -func (d *Delegation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceDelegationPropertiesFormat ServiceDelegationPropertiesFormat - err = json.Unmarshal(*v, &serviceDelegationPropertiesFormat) - if err != nil { - return err - } - d.ServiceDelegationPropertiesFormat = &serviceDelegationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - d.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - } - } - - return nil -} - -// DeleteBastionShareableLinkFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DeleteBastionShareableLinkFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DeleteBastionShareableLinkFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DeleteBastionShareableLinkFuture.Result. -func (future *DeleteBastionShareableLinkFuture) result(client BaseClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DeleteBastionShareableLinkFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DeleteBastionShareableLinkFuture") - return - } - ar.Response = future.Response() - return -} - -// DeviceProperties list of properties of the device. -type DeviceProperties struct { - // DeviceVendor - Name of the device Vendor. - DeviceVendor *string `json:"deviceVendor,omitempty"` - // DeviceModel - Model of the device. - DeviceModel *string `json:"deviceModel,omitempty"` - // LinkSpeedInMbps - Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual -// network. Standard DHCP option for a subnet overrides VNET DHCP options. -type DhcpOptions struct { - // DNSServers - The list of DNS servers IP addresses. - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// Dimension dimension of the metric. -type Dimension struct { - // Name - The name of the dimension. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the dimension. - DisplayName *string `json:"displayName,omitempty"` - // InternalName - The internal name of the dimension. - InternalName *string `json:"internalName,omitempty"` -} - -// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call. -type DNSNameAvailabilityResult struct { - autorest.Response `json:"-"` - // Available - Domain availability (True/False). - Available *bool `json:"available,omitempty"` -} - -// DNSSettings DNS Proxy Settings in Firewall Policy. -type DNSSettings struct { - // Servers - List of Custom DNS Servers. - Servers *[]string `json:"servers,omitempty"` - // EnableProxy - Enable DNS Proxy on Firewalls attached to the Firewall Policy. - EnableProxy *bool `json:"enableProxy,omitempty"` - // RequireProxyForNetworkRules - FQDNs in Network Rules are supported when set to true. - RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` -} - -// EffectiveNetworkSecurityGroup effective network security group. -type EffectiveNetworkSecurityGroup struct { - // NetworkSecurityGroup - The ID of network security group that is applied. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // Association - Associated resources. - Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` - // EffectiveSecurityRules - A collection of effective security rules. - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - // TagMap - Mapping of tags to list of IP Addresses included within the tag. - TagMap map[string][]string `json:"tagMap"` -} - -// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroup. -func (ensg EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensg.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = ensg.NetworkSecurityGroup - } - if ensg.Association != nil { - objectMap["association"] = ensg.Association - } - if ensg.EffectiveSecurityRules != nil { - objectMap["effectiveSecurityRules"] = ensg.EffectiveSecurityRules - } - if ensg.TagMap != nil { - objectMap["tagMap"] = ensg.TagMap - } - return json.Marshal(objectMap) -} - -// EffectiveNetworkSecurityGroupAssociation the effective network security group association. -type EffectiveNetworkSecurityGroupAssociation struct { - // Subnet - The ID of the subnet if assigned. - Subnet *SubResource `json:"subnet,omitempty"` - // NetworkInterface - The ID of the network interface if assigned. - NetworkInterface *SubResource `json:"networkInterface,omitempty"` -} - -// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service -// call. -type EffectiveNetworkSecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of effective network security groups. - Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroupListResult. -func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensglr.Value != nil { - objectMap["value"] = ensglr.Value - } - return json.Marshal(objectMap) -} - -// EffectiveNetworkSecurityRule effective network security rules. -type EffectiveNetworkSecurityRule struct { - // Name - The name of the security rule specified by the user (if created by the user). - Name *string `json:"name,omitempty"` - // Protocol - The network protocol this rule applies to. Possible values include: 'EffectiveSecurityRuleProtocolTCP', 'EffectiveSecurityRuleProtocolUDP', 'EffectiveSecurityRuleProtocolAll' - Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - // SourcePortRange - The source port or range. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - // DestinationPortRange - The destination port or range. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - // SourcePortRanges - The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // SourceAddressPrefix - The source address prefix. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - // DestinationAddressPrefix - The destination address prefix. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - // SourceAddressPrefixes - The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - // DestinationAddressPrefixes - The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - // ExpandedSourceAddressPrefix - The expanded source address prefix. - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - // ExpandedDestinationAddressPrefix - Expanded destination address prefix. - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - // Access - Whether network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - Access SecurityRuleAccess `json:"access,omitempty"` - // Priority - The priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - The direction of the rule. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' - Direction SecurityRuleDirection `json:"direction,omitempty"` -} - -// EffectiveRoute effective Route. -type EffectiveRoute struct { - // Name - The name of the user defined route. This is optional. - Name *string `json:"name,omitempty"` - // DisableBgpRoutePropagation - If true, on-premises routes are not propagated to the network interfaces in the subnet. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - // Source - Who created the route. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' - Source EffectiveRouteSource `json:"source,omitempty"` - // State - The value of effective route. Possible values include: 'Active', 'Invalid' - State EffectiveRouteState `json:"state,omitempty"` - // AddressPrefix - The address prefixes of the effective routes in CIDR notation. - AddressPrefix *[]string `json:"addressPrefix,omitempty"` - // NextHopIPAddress - The IP address of the next hop of the effective route. - NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` - // NextHopType - The type of Azure hop the packet should be sent to. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' - NextHopType RouteNextHopType `json:"nextHopType,omitempty"` -} - -// EffectiveRouteListResult response for list effective route API service call. -type EffectiveRouteListResult struct { - autorest.Response `json:"-"` - // Value - A list of effective routes. - Value *[]EffectiveRoute `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveRouteListResult. -func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erlr.Value != nil { - objectMap["value"] = erlr.Value - } - return json.Marshal(objectMap) -} - -// EffectiveRoutesParameters the parameters specifying the resource whose effective routes are being -// requested. -type EffectiveRoutesParameters struct { - // ResourceID - The resource whose effective routes are being requested. - ResourceID *Resource `json:"resourceId,omitempty"` - // VirtualWanResourceType - The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. - VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` -} - -// EndpointServiceResult endpoint service. -type EndpointServiceResult struct { - // Name - READ-ONLY; Name of the endpoint service. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Type of the endpoint service. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for EndpointServiceResult. -func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esr.ID != nil { - objectMap["id"] = esr.ID - } - return json.Marshal(objectMap) -} - -// EndpointServicesListResult response for the ListAvailableEndpointServices API service call. -type EndpointServicesListResult struct { - autorest.Response `json:"-"` - // Value - List of available endpoint services in a region. - Value *[]EndpointServiceResult `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// EndpointServicesListResultIterator provides access to a complete listing of EndpointServiceResult -// values. -type EndpointServicesListResultIterator struct { - i int - page EndpointServicesListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EndpointServicesListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EndpointServicesListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EndpointServicesListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter EndpointServicesListResultIterator) Response() EndpointServicesListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter EndpointServicesListResultIterator) Value() EndpointServiceResult { - if !iter.page.NotDone() { - return EndpointServiceResult{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EndpointServicesListResultIterator type. -func NewEndpointServicesListResultIterator(page EndpointServicesListResultPage) EndpointServicesListResultIterator { - return EndpointServicesListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (eslr EndpointServicesListResult) IsEmpty() bool { - return eslr.Value == nil || len(*eslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (eslr EndpointServicesListResult) hasNextLink() bool { - return eslr.NextLink != nil && len(*eslr.NextLink) != 0 -} - -// endpointServicesListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) { - if !eslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(eslr.NextLink))) -} - -// EndpointServicesListResultPage contains a page of EndpointServiceResult values. -type EndpointServicesListResultPage struct { - fn func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error) - eslr EndpointServicesListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.eslr) - if err != nil { - return err - } - page.eslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *EndpointServicesListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EndpointServicesListResultPage) NotDone() bool { - return !page.eslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EndpointServicesListResultPage) Response() EndpointServicesListResult { - return page.eslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EndpointServicesListResultPage) Values() []EndpointServiceResult { - if page.eslr.IsEmpty() { - return nil - } - return *page.eslr.Value -} - -// Creates a new instance of the EndpointServicesListResultPage type. -func NewEndpointServicesListResultPage(cur EndpointServicesListResult, getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage { - return EndpointServicesListResultPage{ - fn: getNextPage, - eslr: cur, - } -} - -// Error common error representation. -type Error struct { - // Code - Error code. - Code *string `json:"code,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` - // Target - Error target. - Target *string `json:"target,omitempty"` - // Details - Error details. - Details *[]ErrorDetails `json:"details,omitempty"` - // InnerError - Inner error message. - InnerError *string `json:"innerError,omitempty"` -} - -// ErrorDetails common error details representation. -type ErrorDetails struct { - // Code - Error code. - Code *string `json:"code,omitempty"` - // Target - Error target. - Target *string `json:"target,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` -} - -// ErrorResponse the error object. -type ErrorResponse struct { - // Error - The error details object. - Error *ErrorDetails `json:"error,omitempty"` -} - -// EvaluatedNetworkSecurityGroup results of network security group evaluation. -type EvaluatedNetworkSecurityGroup struct { - // NetworkSecurityGroupID - Network security group ID. - NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"` - // AppliedTo - Resource ID of nic or subnet to which network security group is applied. - AppliedTo *string `json:"appliedTo,omitempty"` - // MatchedRule - Matched network security rule. - MatchedRule *MatchedRule `json:"matchedRule,omitempty"` - // RulesEvaluationResult - READ-ONLY; List of network security rules evaluation results. - RulesEvaluationResult *[]SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` -} - -// MarshalJSON is the custom marshaler for EvaluatedNetworkSecurityGroup. -func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensg.NetworkSecurityGroupID != nil { - objectMap["networkSecurityGroupId"] = ensg.NetworkSecurityGroupID - } - if ensg.AppliedTo != nil { - objectMap["appliedTo"] = ensg.AppliedTo - } - if ensg.MatchedRule != nil { - objectMap["matchedRule"] = ensg.MatchedRule - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuit expressRouteCircuit resource. -type ExpressRouteCircuit struct { - autorest.Response `json:"-"` - // Sku - The SKU. - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - // ExpressRouteCircuitPropertiesFormat - Properties of the express route circuit. - *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuit. -func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erc.Sku != nil { - objectMap["sku"] = erc.Sku - } - if erc.ExpressRouteCircuitPropertiesFormat != nil { - objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat - } - if erc.ID != nil { - objectMap["id"] = erc.ID - } - if erc.Location != nil { - objectMap["location"] = erc.Location - } - if erc.Tags != nil { - objectMap["tags"] = erc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. -func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku ExpressRouteCircuitSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - erc.Sku = &sku - } - case "properties": - if v != nil { - var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) - if err != nil { - return err - } - erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erc.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitArpTable struct { - // Age - Entry age in minutes. - Age *int32 `json:"age,omitempty"` - // Interface - Interface address. - Interface *string `json:"interface,omitempty"` - // IPAddress - The IP address. - IPAddress *string `json:"ipAddress,omitempty"` - // MacAddress - The MAC address. - MacAddress *string `json:"macAddress,omitempty"` -} - -// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. -type ExpressRouteCircuitAuthorization struct { - autorest.Response `json:"-"` - // AuthorizationPropertiesFormat - Properties of the express route circuit authorization. - *AuthorizationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. -func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erca.AuthorizationPropertiesFormat != nil { - objectMap["properties"] = erca.AuthorizationPropertiesFormat - } - if erca.Name != nil { - objectMap["name"] = erca.Name - } - if erca.ID != nil { - objectMap["id"] = erca.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. -func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var authorizationPropertiesFormat AuthorizationPropertiesFormat - err = json.Unmarshal(*v, &authorizationPropertiesFormat) - if err != nil { - return err - } - erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erca.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erca.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erca.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erca.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erca.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent { - erca, err = client.CreateOrUpdateResponder(erca.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCircuitAuthorizationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. -func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitConnection express Route Circuit Connection in an ExpressRouteCircuitPeering -// resource. -type ExpressRouteCircuitConnection struct { - autorest.Response `json:"-"` - // ExpressRouteCircuitConnectionPropertiesFormat - Properties of the express route circuit connection. - *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnection. -func (ercc ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercc.ExpressRouteCircuitConnectionPropertiesFormat != nil { - objectMap["properties"] = ercc.ExpressRouteCircuitConnectionPropertiesFormat - } - if ercc.Name != nil { - objectMap["name"] = ercc.Name - } - if ercc.ID != nil { - objectMap["id"] = ercc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitConnection struct. -func (ercc *ExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCircuitConnectionPropertiesFormat ExpressRouteCircuitConnectionPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitConnectionPropertiesFormat) - if err != nil { - return err - } - ercc.ExpressRouteCircuitConnectionPropertiesFormat = &expressRouteCircuitConnectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercc.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitConnectionListResult response for ListConnections API service call retrieves all -// global reach connections that belongs to a Private Peering for an ExpressRouteCircuit. -type ExpressRouteCircuitConnectionListResult struct { - autorest.Response `json:"-"` - // Value - The global reach connection associated with Private Peering in an ExpressRoute Circuit. - Value *[]ExpressRouteCircuitConnection `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitConnectionListResultIterator provides access to a complete listing of -// ExpressRouteCircuitConnection values. -type ExpressRouteCircuitConnectionListResultIterator struct { - i int - page ExpressRouteCircuitConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitConnectionListResultIterator) Response() ExpressRouteCircuitConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitConnectionListResultIterator) Value() ExpressRouteCircuitConnection { - if !iter.page.NotDone() { - return ExpressRouteCircuitConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitConnectionListResultIterator type. -func NewExpressRouteCircuitConnectionListResultIterator(page ExpressRouteCircuitConnectionListResultPage) ExpressRouteCircuitConnectionListResultIterator { - return ExpressRouteCircuitConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercclr ExpressRouteCircuitConnectionListResult) IsEmpty() bool { - return ercclr.Value == nil || len(*ercclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercclr ExpressRouteCircuitConnectionListResult) hasNextLink() bool { - return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 -} - -// expressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercclr ExpressRouteCircuitConnectionListResult) expressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercclr.NextLink))) -} - -// ExpressRouteCircuitConnectionListResultPage contains a page of ExpressRouteCircuitConnection values. -type ExpressRouteCircuitConnectionListResultPage struct { - fn func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error) - ercclr ExpressRouteCircuitConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err - } - page.ercclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitConnectionListResultPage) NotDone() bool { - return !page.ercclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitConnectionListResultPage) Response() ExpressRouteCircuitConnectionListResult { - return page.ercclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitConnectionListResultPage) Values() []ExpressRouteCircuitConnection { - if page.ercclr.IsEmpty() { - return nil - } - return *page.ercclr.Value -} - -// Creates a new instance of the ExpressRouteCircuitConnectionListResultPage type. -func NewExpressRouteCircuitConnectionListResultPage(cur ExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)) ExpressRouteCircuitConnectionListResultPage { - return ExpressRouteCircuitConnectionListResultPage{ - fn: getNextPage, - ercclr: cur, - } -} - -// ExpressRouteCircuitConnectionPropertiesFormat properties of the express route circuit connection. -type ExpressRouteCircuitConnectionPropertiesFormat struct { - // ExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - // PeerExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // AuthorizationKey - The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // Ipv6CircuitConnectionConfig - IPv6 Address PrefixProperties of the express route circuit connection. - Ipv6CircuitConnectionConfig *Ipv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnectionPropertiesFormat. -func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpf.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering - } - if erccpf.PeerExpressRouteCircuitPeering != nil { - objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering - } - if erccpf.AddressPrefix != nil { - objectMap["addressPrefix"] = erccpf.AddressPrefix - } - if erccpf.AuthorizationKey != nil { - objectMap["authorizationKey"] = erccpf.AuthorizationKey - } - if erccpf.Ipv6CircuitConnectionConfig != nil { - objectMap["ipv6CircuitConnectionConfig"] = erccpf.Ipv6CircuitConnectionConfig - } - if erccpf.CircuitConnectionStatus != "" { - objectMap["circuitConnectionStatus"] = erccpf.CircuitConnectionStatus - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitConnectionsClient) (ExpressRouteCircuitConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { - ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitConnectionsDeleteFuture.Result. -func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call. -type ExpressRouteCircuitListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteCircuits in a resource group. - Value *[]ExpressRouteCircuit `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit -// values. -type ExpressRouteCircuitListResultIterator struct { - i int - page ExpressRouteCircuitListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { - if !iter.page.NotDone() { - return ExpressRouteCircuit{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitListResultIterator type. -func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator { - return ExpressRouteCircuitListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { - return erclr.Value == nil || len(*erclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { - return erclr.NextLink != nil && len(*erclr.NextLink) != 0 -} - -// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erclr.NextLink))) -} - -// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. -type ExpressRouteCircuitListResultPage struct { - fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) - erclr ExpressRouteCircuitListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erclr) - if err != nil { - return err - } - page.erclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitListResultPage) NotDone() bool { - return !page.erclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { - return page.erclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { - if page.erclr.IsEmpty() { - return nil - } - return *page.erclr.Value -} - -// Creates a new instance of the ExpressRouteCircuitListResultPage type. -func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { - return ExpressRouteCircuitListResultPage{ - fn: getNextPage, - erclr: cur, - } -} - -// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. -type ExpressRouteCircuitPeering struct { - autorest.Response `json:"-"` - // ExpressRouteCircuitPeeringPropertiesFormat - Properties of the express route circuit peering. - *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. -func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { - objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat - } - if ercp.Name != nil { - objectMap["name"] = ercp.Name - } - if ercp.ID != nil { - objectMap["id"] = ercp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. -func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) - if err != nil { - return err - } - ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercp.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitPeeringConfig specifies the peering configuration. -type ExpressRouteCircuitPeeringConfig struct { - // AdvertisedPublicPrefixes - The reference to AdvertisedPublicPrefixes. - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - // AdvertisedCommunities - The communities of bgp peering. Specified for microsoft peering. - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' - AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - // LegacyMode - The legacy mode of the peering. - LegacyMode *int32 `json:"legacyMode,omitempty"` - // CustomerASN - The CustomerASN of the peering. - CustomerASN *int32 `json:"customerASN,omitempty"` - // RoutingRegistryName - The RoutingRegistryName of the configuration. - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringConfig. -func (ercpc ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercpc.AdvertisedPublicPrefixes != nil { - objectMap["advertisedPublicPrefixes"] = ercpc.AdvertisedPublicPrefixes - } - if ercpc.AdvertisedCommunities != nil { - objectMap["advertisedCommunities"] = ercpc.AdvertisedCommunities - } - if ercpc.LegacyMode != nil { - objectMap["legacyMode"] = ercpc.LegacyMode - } - if ercpc.CustomerASN != nil { - objectMap["customerASN"] = ercpc.CustomerASN - } - if ercpc.RoutingRegistryName != nil { - objectMap["routingRegistryName"] = ercpc.RoutingRegistryName - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitPeeringID expressRoute circuit peering identifier. -type ExpressRouteCircuitPeeringID struct { - // ID - The ID of the ExpressRoute circuit peering. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCircuit. -type ExpressRouteCircuitPeeringListResult struct { - autorest.Response `json:"-"` - // Value - The peerings in an express route circuit. - Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of -// ExpressRouteCircuitPeering values. -type ExpressRouteCircuitPeeringListResultIterator struct { - i int - page ExpressRouteCircuitPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { - if !iter.page.NotDone() { - return ExpressRouteCircuitPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type. -func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator { - return ExpressRouteCircuitPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { - return ercplr.Value == nil || len(*ercplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { - return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 -} - -// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercplr.NextLink))) -} - -// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. -type ExpressRouteCircuitPeeringListResultPage struct { - fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) - ercplr ExpressRouteCircuitPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercplr) - if err != nil { - return err - } - page.ercplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { - return !page.ercplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { - return page.ercplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { - if page.ercplr.IsEmpty() { - return nil - } - return *page.ercplr.Value -} - -// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. -func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { - return ExpressRouteCircuitPeeringListResultPage{ - fn: getNextPage, - ercplr: cur, - } -} - -// ExpressRouteCircuitPeeringPropertiesFormat properties of the express route circuit peering. -type ExpressRouteCircuitPeeringPropertiesFormat struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` - // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' - State ExpressRoutePeeringState `json:"state,omitempty"` - // AzureASN - The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty"` - // PeerASN - The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // PrimaryAzurePort - The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // SharedKey - The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // VlanID - The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // Stats - The peering stats of express route circuit. - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // LastModifiedBy - READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // RouteFilter - The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - // Ipv6PeeringConfig - The IPv6 peering configuration. - Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - // ExpressRouteConnection - The ExpressRoute connection. - ExpressRouteConnection *ExpressRouteConnectionID `json:"expressRouteConnection,omitempty"` - // Connections - The list of circuit connections associated with Azure Private Peering for this circuit. - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - // PeeredConnections - READ-ONLY; The list of peered circuit connections associated with Azure Private Peering for this circuit. - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringPropertiesFormat. -func (ercppf ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercppf.PeeringType != "" { - objectMap["peeringType"] = ercppf.PeeringType - } - if ercppf.State != "" { - objectMap["state"] = ercppf.State - } - if ercppf.AzureASN != nil { - objectMap["azureASN"] = ercppf.AzureASN - } - if ercppf.PeerASN != nil { - objectMap["peerASN"] = ercppf.PeerASN - } - if ercppf.PrimaryPeerAddressPrefix != nil { - objectMap["primaryPeerAddressPrefix"] = ercppf.PrimaryPeerAddressPrefix - } - if ercppf.SecondaryPeerAddressPrefix != nil { - objectMap["secondaryPeerAddressPrefix"] = ercppf.SecondaryPeerAddressPrefix - } - if ercppf.PrimaryAzurePort != nil { - objectMap["primaryAzurePort"] = ercppf.PrimaryAzurePort - } - if ercppf.SecondaryAzurePort != nil { - objectMap["secondaryAzurePort"] = ercppf.SecondaryAzurePort - } - if ercppf.SharedKey != nil { - objectMap["sharedKey"] = ercppf.SharedKey - } - if ercppf.VlanID != nil { - objectMap["vlanId"] = ercppf.VlanID - } - if ercppf.MicrosoftPeeringConfig != nil { - objectMap["microsoftPeeringConfig"] = ercppf.MicrosoftPeeringConfig - } - if ercppf.Stats != nil { - objectMap["stats"] = ercppf.Stats - } - if ercppf.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = ercppf.GatewayManagerEtag - } - if ercppf.RouteFilter != nil { - objectMap["routeFilter"] = ercppf.RouteFilter - } - if ercppf.Ipv6PeeringConfig != nil { - objectMap["ipv6PeeringConfig"] = ercppf.Ipv6PeeringConfig - } - if ercppf.ExpressRouteConnection != nil { - objectMap["expressRouteConnection"] = ercppf.ExpressRouteConnection - } - if ercppf.Connections != nil { - objectMap["connections"] = ercppf.Connections - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent { - ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. -func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit. -type ExpressRouteCircuitPropertiesFormat struct { - // AllowClassicOperations - Allow classic operations. - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - // CircuitProvisioningState - The CircuitProvisioningState state of the resource. - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - // ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' - ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - // Authorizations - The list of authorizations. - Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - // Peerings - The list of peerings. - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - // ServiceKey - The ServiceKey. - ServiceKey *string `json:"serviceKey,omitempty"` - // ServiceProviderNotes - The ServiceProviderNotes. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - // ServiceProviderProperties - The ServiceProviderProperties. - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - // ExpressRoutePort - The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - // BandwidthInGbps - The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. - BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` - // Stag - READ-ONLY; The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - Stag *int32 `json:"stag,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // GlobalReachEnabled - Flag denoting global reach status. - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPropertiesFormat. -func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercpf.AllowClassicOperations != nil { - objectMap["allowClassicOperations"] = ercpf.AllowClassicOperations - } - if ercpf.CircuitProvisioningState != nil { - objectMap["circuitProvisioningState"] = ercpf.CircuitProvisioningState - } - if ercpf.ServiceProviderProvisioningState != "" { - objectMap["serviceProviderProvisioningState"] = ercpf.ServiceProviderProvisioningState - } - if ercpf.Authorizations != nil { - objectMap["authorizations"] = ercpf.Authorizations - } - if ercpf.Peerings != nil { - objectMap["peerings"] = ercpf.Peerings - } - if ercpf.ServiceKey != nil { - objectMap["serviceKey"] = ercpf.ServiceKey - } - if ercpf.ServiceProviderNotes != nil { - objectMap["serviceProviderNotes"] = ercpf.ServiceProviderNotes - } - if ercpf.ServiceProviderProperties != nil { - objectMap["serviceProviderProperties"] = ercpf.ServiceProviderProperties - } - if ercpf.ExpressRoutePort != nil { - objectMap["expressRoutePort"] = ercpf.ExpressRoutePort - } - if ercpf.BandwidthInGbps != nil { - objectMap["bandwidthInGbps"] = ercpf.BandwidthInGbps - } - if ercpf.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = ercpf.GatewayManagerEtag - } - if ercpf.GlobalReachEnabled != nil { - objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitReference reference to an express route circuit. -type ExpressRouteCircuitReference struct { - // ID - Corresponding Express Route Circuit Id. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTable struct { - // NetworkProperty - IP address of a network entity. - NetworkProperty *string `json:"network,omitempty"` - // NextHop - NextHop address. - NextHop *string `json:"nextHop,omitempty"` - // LocPrf - Local preference value as set with the set local-preference route-map configuration command. - LocPrf *string `json:"locPrf,omitempty"` - // Weight - Route Weight. - Weight *int32 `json:"weight,omitempty"` - // Path - Autonomous system paths to the destination network. - Path *string `json:"path,omitempty"` -} - -// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTableSummary struct { - // Neighbor - IP address of the neighbor. - Neighbor *string `json:"neighbor,omitempty"` - // V - BGP version number spoken to the neighbor. - V *int32 `json:"v,omitempty"` - // As - Autonomous system number. - As *int32 `json:"as,omitempty"` - // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. - UpDown *string `json:"upDown,omitempty"` - // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StatePfxRcd *string `json:"statePfxRcd,omitempty"` -} - -// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route -// Circuits API. -type ExpressRouteCircuitsArpTableListResult struct { - autorest.Response `json:"-"` - // Value - A list of the ARP tables. - Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { - erc, err = client.CreateOrUpdateResponder(erc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. -func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an -// ExpressRouteCircuit. -type ExpressRouteCircuitServiceProviderProperties struct { - // ServiceProviderName - The serviceProviderName. - ServiceProviderName *string `json:"serviceProviderName,omitempty"` - // PeeringLocation - The peering location. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInMbps - The BandwidthInMbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` -} - -// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit. -type ExpressRouteCircuitSku struct { - // Name - The name of the SKU. - Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium', 'ExpressRouteCircuitSkuTierBasic', 'ExpressRouteCircuitSkuTierLocal' - Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` - // Family - The family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData' - Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` -} - -// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsListArpTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. -func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercatlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { - ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsListRoutesTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. -func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { - ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. -func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent { - ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route -// Circuits API. -type ExpressRouteCircuitsRoutesTableListResult struct { - autorest.Response `json:"-"` - // Value - The list of routes table. - Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the -// Express Route Circuits API. -type ExpressRouteCircuitsRoutesTableSummaryListResult struct { - autorest.Response `json:"-"` - // Value - A list of the routes table. - Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitStats contains stats associated with the peering. -type ExpressRouteCircuitStats struct { - autorest.Response `json:"-"` - // PrimarybytesIn - The Primary BytesIn of the peering. - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - // PrimarybytesOut - The primary BytesOut of the peering. - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - // SecondarybytesIn - The secondary BytesIn of the peering. - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - // SecondarybytesOut - The secondary BytesOut of the peering. - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} - -// ExpressRouteConnection expressRouteConnection resource. -type ExpressRouteConnection struct { - autorest.Response `json:"-"` - // ExpressRouteConnectionProperties - Properties of the express route connection. - *ExpressRouteConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteConnection. -func (erc ExpressRouteConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erc.ExpressRouteConnectionProperties != nil { - objectMap["properties"] = erc.ExpressRouteConnectionProperties - } - if erc.Name != nil { - objectMap["name"] = erc.Name - } - if erc.ID != nil { - objectMap["id"] = erc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteConnection struct. -func (erc *ExpressRouteConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteConnectionProperties ExpressRouteConnectionProperties - err = json.Unmarshal(*v, &expressRouteConnectionProperties) - if err != nil { - return err - } - erc.ExpressRouteConnectionProperties = &expressRouteConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erc.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erc.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteConnectionID the ID of the ExpressRouteConnection. -type ExpressRouteConnectionID struct { - // ID - READ-ONLY; The ID of the ExpressRouteConnection. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteConnectionList expressRouteConnection list. -type ExpressRouteConnectionList struct { - autorest.Response `json:"-"` - // Value - The list of ExpressRoute connections. - Value *[]ExpressRouteConnection `json:"value,omitempty"` -} - -// ExpressRouteConnectionProperties properties of the ExpressRouteConnection subresource. -type ExpressRouteConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the express route connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteCircuitPeering - The ExpressRoute circuit peering. - ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID `json:"expressRouteCircuitPeering,omitempty"` - // AuthorizationKey - Authorization key to establish the connection. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // RoutingWeight - The routing weight associated to the connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteConnectionProperties. -func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercp.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = ercp.ExpressRouteCircuitPeering - } - if ercp.AuthorizationKey != nil { - objectMap["authorizationKey"] = ercp.AuthorizationKey - } - if ercp.RoutingWeight != nil { - objectMap["routingWeight"] = ercp.RoutingWeight - } - if ercp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = ercp.EnableInternetSecurity - } - if ercp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = ercp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// ExpressRouteConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ExpressRouteConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteConnectionsClient) (ExpressRouteConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteConnectionsCreateOrUpdateFuture) result(client ExpressRouteConnectionsClient) (erc ExpressRouteConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { - erc, err = client.CreateOrUpdateResponder(erc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteConnectionsDeleteFuture.Result. -func (future *ExpressRouteConnectionsDeleteFuture) result(client ExpressRouteConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCrossConnection expressRouteCrossConnection resource. -type ExpressRouteCrossConnection struct { - autorest.Response `json:"-"` - // ExpressRouteCrossConnectionProperties - Properties of the express route cross connection. - *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnection. -func (ercc ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercc.ExpressRouteCrossConnectionProperties != nil { - objectMap["properties"] = ercc.ExpressRouteCrossConnectionProperties - } - if ercc.ID != nil { - objectMap["id"] = ercc.ID - } - if ercc.Location != nil { - objectMap["location"] = ercc.Location - } - if ercc.Tags != nil { - objectMap["tags"] = ercc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnection struct. -func (ercc *ExpressRouteCrossConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCrossConnectionProperties ExpressRouteCrossConnectionProperties - err = json.Unmarshal(*v, &expressRouteCrossConnectionProperties) - if err != nil { - return err - } - ercc.ExpressRouteCrossConnectionProperties = &expressRouteCrossConnectionProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ercc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ercc.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteCrossConnectionListResult response for ListExpressRouteCrossConnection API service call. -type ExpressRouteCrossConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteCrossConnection resources. - Value *[]ExpressRouteCrossConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionListResult. -func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercclr.Value != nil { - objectMap["value"] = ercclr.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionListResultIterator provides access to a complete listing of -// ExpressRouteCrossConnection values. -type ExpressRouteCrossConnectionListResultIterator struct { - i int - page ExpressRouteCrossConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCrossConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCrossConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCrossConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCrossConnectionListResultIterator) Response() ExpressRouteCrossConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCrossConnectionListResultIterator) Value() ExpressRouteCrossConnection { - if !iter.page.NotDone() { - return ExpressRouteCrossConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCrossConnectionListResultIterator type. -func NewExpressRouteCrossConnectionListResultIterator(page ExpressRouteCrossConnectionListResultPage) ExpressRouteCrossConnectionListResultIterator { - return ExpressRouteCrossConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool { - return ercclr.Value == nil || len(*ercclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool { - return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 -} - -// expressRouteCrossConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercclr.NextLink))) -} - -// ExpressRouteCrossConnectionListResultPage contains a page of ExpressRouteCrossConnection values. -type ExpressRouteCrossConnectionListResultPage struct { - fn func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error) - ercclr ExpressRouteCrossConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err - } - page.ercclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCrossConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCrossConnectionListResultPage) NotDone() bool { - return !page.ercclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCrossConnectionListResultPage) Response() ExpressRouteCrossConnectionListResult { - return page.ercclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCrossConnectionListResultPage) Values() []ExpressRouteCrossConnection { - if page.ercclr.IsEmpty() { - return nil - } - return *page.ercclr.Value -} - -// Creates a new instance of the ExpressRouteCrossConnectionListResultPage type. -func NewExpressRouteCrossConnectionListResultPage(cur ExpressRouteCrossConnectionListResult, getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage { - return ExpressRouteCrossConnectionListResultPage{ - fn: getNextPage, - ercclr: cur, - } -} - -// ExpressRouteCrossConnectionPeering peering in an ExpressRoute Cross Connection resource. -type ExpressRouteCrossConnectionPeering struct { - autorest.Response `json:"-"` - // ExpressRouteCrossConnectionPeeringProperties - Properties of the express route cross connection peering. - *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeering. -func (erccp ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccp.ExpressRouteCrossConnectionPeeringProperties != nil { - objectMap["properties"] = erccp.ExpressRouteCrossConnectionPeeringProperties - } - if erccp.Name != nil { - objectMap["name"] = erccp.Name - } - if erccp.ID != nil { - objectMap["id"] = erccp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnectionPeering struct. -func (erccp *ExpressRouteCrossConnectionPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCrossConnectionPeeringProperties ExpressRouteCrossConnectionPeeringProperties - err = json.Unmarshal(*v, &expressRouteCrossConnectionPeeringProperties) - if err != nil { - return err - } - erccp.ExpressRouteCrossConnectionPeeringProperties = &expressRouteCrossConnectionPeeringProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erccp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erccp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erccp.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCrossConnectionPeeringList response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionPeeringList struct { - autorest.Response `json:"-"` - // Value - The peerings in an express route cross connection. - Value *[]ExpressRouteCrossConnectionPeering `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringList. -func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpl.Value != nil { - objectMap["value"] = erccpl.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionPeeringListIterator provides access to a complete listing of -// ExpressRouteCrossConnectionPeering values. -type ExpressRouteCrossConnectionPeeringListIterator struct { - i int - page ExpressRouteCrossConnectionPeeringListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCrossConnectionPeeringListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCrossConnectionPeeringListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCrossConnectionPeeringListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCrossConnectionPeeringListIterator) Response() ExpressRouteCrossConnectionPeeringList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCrossConnectionPeeringListIterator) Value() ExpressRouteCrossConnectionPeering { - if !iter.page.NotDone() { - return ExpressRouteCrossConnectionPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCrossConnectionPeeringListIterator type. -func NewExpressRouteCrossConnectionPeeringListIterator(page ExpressRouteCrossConnectionPeeringListPage) ExpressRouteCrossConnectionPeeringListIterator { - return ExpressRouteCrossConnectionPeeringListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool { - return erccpl.Value == nil || len(*erccpl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool { - return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0 -} - -// expressRouteCrossConnectionPeeringListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) { - if !erccpl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erccpl.NextLink))) -} - -// ExpressRouteCrossConnectionPeeringListPage contains a page of ExpressRouteCrossConnectionPeering values. -type ExpressRouteCrossConnectionPeeringListPage struct { - fn func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error) - erccpl ExpressRouteCrossConnectionPeeringList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erccpl) - if err != nil { - return err - } - page.erccpl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCrossConnectionPeeringListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCrossConnectionPeeringListPage) NotDone() bool { - return !page.erccpl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCrossConnectionPeeringListPage) Response() ExpressRouteCrossConnectionPeeringList { - return page.erccpl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCrossConnectionPeeringListPage) Values() []ExpressRouteCrossConnectionPeering { - if page.erccpl.IsEmpty() { - return nil - } - return *page.erccpl.Value -} - -// Creates a new instance of the ExpressRouteCrossConnectionPeeringListPage type. -func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnectionPeeringList, getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage { - return ExpressRouteCrossConnectionPeeringListPage{ - fn: getNextPage, - erccpl: cur, - } -} - -// ExpressRouteCrossConnectionPeeringProperties properties of express route cross connection peering. -type ExpressRouteCrossConnectionPeeringProperties struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` - // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' - State ExpressRoutePeeringState `json:"state,omitempty"` - // AzureASN - READ-ONLY; The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty"` - // PeerASN - The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // PrimaryAzurePort - READ-ONLY; The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - READ-ONLY; The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // SharedKey - The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // VlanID - The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // LastModifiedBy - READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Ipv6PeeringConfig - The IPv6 peering configuration. - Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringProperties. -func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpp.PeeringType != "" { - objectMap["peeringType"] = erccpp.PeeringType - } - if erccpp.State != "" { - objectMap["state"] = erccpp.State - } - if erccpp.PeerASN != nil { - objectMap["peerASN"] = erccpp.PeerASN - } - if erccpp.PrimaryPeerAddressPrefix != nil { - objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix - } - if erccpp.SecondaryPeerAddressPrefix != nil { - objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix - } - if erccpp.SharedKey != nil { - objectMap["sharedKey"] = erccpp.SharedKey - } - if erccpp.VlanID != nil { - objectMap["vlanId"] = erccpp.VlanID - } - if erccpp.MicrosoftPeeringConfig != nil { - objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig - } - if erccpp.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag - } - if erccpp.Ipv6PeeringConfig != nil { - objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionPeeringsClient) (ExpressRouteCrossConnectionPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erccp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erccp.Response.Response, err = future.GetResult(sender); err == nil && erccp.Response.Response.StatusCode != http.StatusNoContent { - erccp, err = client.CreateOrUpdateResponder(erccp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", erccp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCrossConnectionPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionPeeringsDeleteFuture.Result. -func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCrossConnectionProperties properties of ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionProperties struct { - // PrimaryAzurePort - READ-ONLY; The name of the primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - READ-ONLY; The name of the secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // STag - READ-ONLY; The identifier of the circuit traffic. - STag *int32 `json:"sTag,omitempty"` - // PeeringLocation - The peering location of the ExpressRoute circuit. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInMbps - The circuit bandwidth In Mbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` - // ExpressRouteCircuit - The ExpressRouteCircuit. - ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` - // ServiceProviderProvisioningState - The provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' - ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - // ServiceProviderNotes - Additional read only notes set by the connectivity provider. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Peerings - The list of peerings. - Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionProperties. -func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccp.PeeringLocation != nil { - objectMap["peeringLocation"] = erccp.PeeringLocation - } - if erccp.BandwidthInMbps != nil { - objectMap["bandwidthInMbps"] = erccp.BandwidthInMbps - } - if erccp.ExpressRouteCircuit != nil { - objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit - } - if erccp.ServiceProviderProvisioningState != "" { - objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState - } - if erccp.ServiceProviderNotes != nil { - objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes - } - if erccp.Peerings != nil { - objectMap["peerings"] = erccp.Peerings - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionRoutesTableSummary the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCrossConnectionRoutesTableSummary struct { - // Neighbor - IP address of Neighbor router. - Neighbor *string `json:"neighbor,omitempty"` - // Asn - Autonomous system number. - Asn *int32 `json:"asn,omitempty"` - // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. - UpDown *string `json:"upDown,omitempty"` - // StateOrPrefixesReceived - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` -} - -// ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { - ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCrossConnectionsListArpTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsArpTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListArpTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListArpTableFuture.Result. -func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercatlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListArpTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { - ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionsListRoutesTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsRoutesTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableFuture.Result. -func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { - ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnectionsRoutesTableSummaryListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.Result. -func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erccrtslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erccrtslr.Response.Response, err = future.GetResult(sender); err == nil && erccrtslr.Response.Response.StatusCode != http.StatusNoContent { - erccrtslr, err = client.ListRoutesTableSummaryResponder(erccrtslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", erccrtslr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsRoutesTableSummaryListResult response for ListRoutesTable associated with -// the Express Route Cross Connections. -type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { - autorest.Response `json:"-"` - // Value - A list of the routes table. - Value *[]ExpressRouteCrossConnectionRoutesTableSummary `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionsRoutesTableSummaryListResult. -func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccrtslr.Value != nil { - objectMap["value"] = erccrtslr.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteGateway expressRoute gateway resource. -type ExpressRouteGateway struct { - autorest.Response `json:"-"` - // ExpressRouteGatewayProperties - Properties of the express route gateway. - *ExpressRouteGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteGateway. -func (erg ExpressRouteGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erg.ExpressRouteGatewayProperties != nil { - objectMap["properties"] = erg.ExpressRouteGatewayProperties - } - if erg.ID != nil { - objectMap["id"] = erg.ID - } - if erg.Location != nil { - objectMap["location"] = erg.Location - } - if erg.Tags != nil { - objectMap["tags"] = erg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteGateway struct. -func (erg *ExpressRouteGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteGatewayProperties ExpressRouteGatewayProperties - err = json.Unmarshal(*v, &expressRouteGatewayProperties) - if err != nil { - return err - } - erg.ExpressRouteGatewayProperties = &expressRouteGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erg.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteGatewayList list of ExpressRoute gateways. -type ExpressRouteGatewayList struct { - autorest.Response `json:"-"` - // Value - List of ExpressRoute gateways. - Value *[]ExpressRouteGateway `json:"value,omitempty"` -} - -// ExpressRouteGatewayProperties expressRoute gateway resource properties. -type ExpressRouteGatewayProperties struct { - // AutoScaleConfiguration - Configuration for auto scaling. - AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - // ExpressRouteConnections - READ-ONLY; List of ExpressRoute connections to the ExpressRoute gateway. - ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VirtualHub - The Virtual Hub where the ExpressRoute gateway is or will be deployed. - VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteGatewayProperties. -func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ergp.AutoScaleConfiguration != nil { - objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration - } - if ergp.VirtualHub != nil { - objectMap["virtualHub"] = ergp.VirtualHub - } - return json.Marshal(objectMap) -} - -// ExpressRouteGatewayPropertiesAutoScaleConfiguration configuration for auto scaling. -type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { - // Bounds - Minimum and maximum number of scale units to deploy. - Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"` -} - -// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds minimum and maximum number of scale units to -// deploy. -type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { - // Min - Minimum number of scale units deployed for ExpressRoute gateway. - Min *int32 `json:"min,omitempty"` - // Max - Maximum number of scale units deployed for ExpressRoute gateway. - Max *int32 `json:"max,omitempty"` -} - -// ExpressRouteGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteGatewaysCreateOrUpdateFuture.Result. -func (future *ExpressRouteGatewaysCreateOrUpdateFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erg.Response.Response, err = future.GetResult(sender); err == nil && erg.Response.Response.StatusCode != http.StatusNoContent { - erg, err = client.CreateOrUpdateResponder(erg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", erg.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteGatewaysDeleteFuture.Result. -func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteLink expressRouteLink child resource definition. -type ExpressRouteLink struct { - autorest.Response `json:"-"` - // ExpressRouteLinkPropertiesFormat - ExpressRouteLink properties. - *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` - // Name - Name of child port resource that is unique among child port resources of the parent. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteLink. -func (erl ExpressRouteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erl.ExpressRouteLinkPropertiesFormat != nil { - objectMap["properties"] = erl.ExpressRouteLinkPropertiesFormat - } - if erl.Name != nil { - objectMap["name"] = erl.Name - } - if erl.ID != nil { - objectMap["id"] = erl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteLink struct. -func (erl *ExpressRouteLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteLinkPropertiesFormat ExpressRouteLinkPropertiesFormat - err = json.Unmarshal(*v, &expressRouteLinkPropertiesFormat) - if err != nil { - return err - } - erl.ExpressRouteLinkPropertiesFormat = &expressRouteLinkPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erl.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erl.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteLinkListResult response for ListExpressRouteLinks API service call. -type ExpressRouteLinkListResult struct { - autorest.Response `json:"-"` - // Value - The list of ExpressRouteLink sub-resources. - Value *[]ExpressRouteLink `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteLinkListResultIterator provides access to a complete listing of ExpressRouteLink values. -type ExpressRouteLinkListResultIterator struct { - i int - page ExpressRouteLinkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteLinkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteLinkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteLinkListResultIterator) Response() ExpressRouteLinkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteLinkListResultIterator) Value() ExpressRouteLink { - if !iter.page.NotDone() { - return ExpressRouteLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteLinkListResultIterator type. -func NewExpressRouteLinkListResultIterator(page ExpressRouteLinkListResultPage) ExpressRouteLinkListResultIterator { - return ExpressRouteLinkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erllr ExpressRouteLinkListResult) IsEmpty() bool { - return erllr.Value == nil || len(*erllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erllr ExpressRouteLinkListResult) hasNextLink() bool { - return erllr.NextLink != nil && len(*erllr.NextLink) != 0 -} - -// expressRouteLinkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erllr ExpressRouteLinkListResult) expressRouteLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erllr.NextLink))) -} - -// ExpressRouteLinkListResultPage contains a page of ExpressRouteLink values. -type ExpressRouteLinkListResultPage struct { - fn func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error) - erllr ExpressRouteLinkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteLinkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erllr) - if err != nil { - return err - } - page.erllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteLinkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteLinkListResultPage) NotDone() bool { - return !page.erllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteLinkListResultPage) Response() ExpressRouteLinkListResult { - return page.erllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteLinkListResultPage) Values() []ExpressRouteLink { - if page.erllr.IsEmpty() { - return nil - } - return *page.erllr.Value -} - -// Creates a new instance of the ExpressRouteLinkListResultPage type. -func NewExpressRouteLinkListResultPage(cur ExpressRouteLinkListResult, getNextPage func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)) ExpressRouteLinkListResultPage { - return ExpressRouteLinkListResultPage{ - fn: getNextPage, - erllr: cur, - } -} - -// ExpressRouteLinkMacSecConfig expressRouteLink Mac Security Configuration. -type ExpressRouteLinkMacSecConfig struct { - // CknSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CKN key. - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - // CakSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CAK key. - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - // Cipher - Mac security cipher. Possible values include: 'GcmAes128', 'GcmAes256' - Cipher ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` -} - -// ExpressRouteLinkPropertiesFormat properties specific to ExpressRouteLink resources. -type ExpressRouteLinkPropertiesFormat struct { - // RouterName - READ-ONLY; Name of Azure router associated with physical port. - RouterName *string `json:"routerName,omitempty"` - // InterfaceName - READ-ONLY; Name of Azure router interface. - InterfaceName *string `json:"interfaceName,omitempty"` - // PatchPanelID - READ-ONLY; Mapping between physical port to patch panel port. - PatchPanelID *string `json:"patchPanelId,omitempty"` - // RackID - READ-ONLY; Mapping of physical patch panel to rack. - RackID *string `json:"rackId,omitempty"` - // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'LC', 'SC' - ConnectorType ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - // AdminState - Administrative state of the physical port. Possible values include: 'ExpressRouteLinkAdminStateEnabled', 'ExpressRouteLinkAdminStateDisabled' - AdminState ExpressRouteLinkAdminState `json:"adminState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // MacSecConfig - MacSec configuration. - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteLinkPropertiesFormat. -func (erlpf ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erlpf.AdminState != "" { - objectMap["adminState"] = erlpf.AdminState - } - if erlpf.MacSecConfig != nil { - objectMap["macSecConfig"] = erlpf.MacSecConfig - } - return json.Marshal(objectMap) -} - -// ExpressRoutePort expressRoutePort resource definition. -type ExpressRoutePort struct { - autorest.Response `json:"-"` - // ExpressRoutePortPropertiesFormat - ExpressRoutePort properties. - *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Identity - The identity of ExpressRoutePort, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePort. -func (erp ExpressRoutePort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erp.ExpressRoutePortPropertiesFormat != nil { - objectMap["properties"] = erp.ExpressRoutePortPropertiesFormat - } - if erp.Identity != nil { - objectMap["identity"] = erp.Identity - } - if erp.ID != nil { - objectMap["id"] = erp.ID - } - if erp.Location != nil { - objectMap["location"] = erp.Location - } - if erp.Tags != nil { - objectMap["tags"] = erp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRoutePort struct. -func (erp *ExpressRoutePort) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRoutePortPropertiesFormat ExpressRoutePortPropertiesFormat - err = json.Unmarshal(*v, &expressRoutePortPropertiesFormat) - if err != nil { - return err - } - erp.ExpressRoutePortPropertiesFormat = &expressRoutePortPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erp.Etag = &etag - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - erp.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erp.Tags = tags - } - } - } - - return nil -} - -// ExpressRoutePortListResult response for ListExpressRoutePorts API service call. -type ExpressRoutePortListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRoutePort resources. - Value *[]ExpressRoutePort `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRoutePortListResultIterator provides access to a complete listing of ExpressRoutePort values. -type ExpressRoutePortListResultIterator struct { - i int - page ExpressRoutePortListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRoutePortListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRoutePortListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRoutePortListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRoutePortListResultIterator) Response() ExpressRoutePortListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRoutePortListResultIterator) Value() ExpressRoutePort { - if !iter.page.NotDone() { - return ExpressRoutePort{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRoutePortListResultIterator type. -func NewExpressRoutePortListResultIterator(page ExpressRoutePortListResultPage) ExpressRoutePortListResultIterator { - return ExpressRoutePortListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erplr ExpressRoutePortListResult) IsEmpty() bool { - return erplr.Value == nil || len(*erplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erplr ExpressRoutePortListResult) hasNextLink() bool { - return erplr.NextLink != nil && len(*erplr.NextLink) != 0 -} - -// expressRoutePortListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erplr ExpressRoutePortListResult) expressRoutePortListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erplr.NextLink))) -} - -// ExpressRoutePortListResultPage contains a page of ExpressRoutePort values. -type ExpressRoutePortListResultPage struct { - fn func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error) - erplr ExpressRoutePortListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRoutePortListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erplr) - if err != nil { - return err - } - page.erplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRoutePortListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRoutePortListResultPage) NotDone() bool { - return !page.erplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRoutePortListResultPage) Response() ExpressRoutePortListResult { - return page.erplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRoutePortListResultPage) Values() []ExpressRoutePort { - if page.erplr.IsEmpty() { - return nil - } - return *page.erplr.Value -} - -// Creates a new instance of the ExpressRoutePortListResultPage type. -func NewExpressRoutePortListResultPage(cur ExpressRoutePortListResult, getNextPage func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)) ExpressRoutePortListResultPage { - return ExpressRoutePortListResultPage{ - fn: getNextPage, - erplr: cur, - } -} - -// ExpressRoutePortPropertiesFormat properties specific to ExpressRoutePort resources. -type ExpressRoutePortPropertiesFormat struct { - // PeeringLocation - The name of the peering location that the ExpressRoutePort is mapped to physically. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInGbps - Bandwidth of procured ports in Gbps. - BandwidthInGbps *int32 `json:"bandwidthInGbps,omitempty"` - // ProvisionedBandwidthInGbps - READ-ONLY; Aggregate Gbps of associated circuit bandwidths. - ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` - // Mtu - READ-ONLY; Maximum transmission unit of the physical port pair(s). - Mtu *string `json:"mtu,omitempty"` - // Encapsulation - Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' - Encapsulation ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` - // EtherType - READ-ONLY; Ether type of the physical port. - EtherType *string `json:"etherType,omitempty"` - // AllocationDate - READ-ONLY; Date of the physical port allocation to be used in Letter of Authorization. - AllocationDate *string `json:"allocationDate,omitempty"` - // Links - The set of physical links of the ExpressRoutePort resource. - Links *[]ExpressRouteLink `json:"links,omitempty"` - // Circuits - READ-ONLY; Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. - Circuits *[]SubResource `json:"circuits,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the express route port resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortPropertiesFormat. -func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erppf.PeeringLocation != nil { - objectMap["peeringLocation"] = erppf.PeeringLocation - } - if erppf.BandwidthInGbps != nil { - objectMap["bandwidthInGbps"] = erppf.BandwidthInGbps - } - if erppf.Encapsulation != "" { - objectMap["encapsulation"] = erppf.Encapsulation - } - if erppf.Links != nil { - objectMap["links"] = erppf.Links - } - return json.Marshal(objectMap) -} - -// ExpressRoutePortsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRoutePortsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortsClient) (ExpressRoutePort, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortsCreateOrUpdateFuture.Result. -func (future *ExpressRoutePortsCreateOrUpdateFuture) result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erp.Response.Response, err = future.GetResult(sender); err == nil && erp.Response.Response.StatusCode != http.StatusNoContent { - erp, err = client.CreateOrUpdateResponder(erp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", erp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRoutePortsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ExpressRoutePortsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortsDeleteFuture.Result. -func (future *ExpressRoutePortsDeleteFuture) result(client ExpressRoutePortsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRoutePortsLocation definition of the ExpressRoutePorts peering location resource. -type ExpressRoutePortsLocation struct { - autorest.Response `json:"-"` - // ExpressRoutePortsLocationPropertiesFormat - ExpressRoutePort peering location properties. - *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortsLocation. -func (erpl ExpressRoutePortsLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erpl.ExpressRoutePortsLocationPropertiesFormat != nil { - objectMap["properties"] = erpl.ExpressRoutePortsLocationPropertiesFormat - } - if erpl.ID != nil { - objectMap["id"] = erpl.ID - } - if erpl.Location != nil { - objectMap["location"] = erpl.Location - } - if erpl.Tags != nil { - objectMap["tags"] = erpl.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRoutePortsLocation struct. -func (erpl *ExpressRoutePortsLocation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRoutePortsLocationPropertiesFormat ExpressRoutePortsLocationPropertiesFormat - err = json.Unmarshal(*v, &expressRoutePortsLocationPropertiesFormat) - if err != nil { - return err - } - erpl.ExpressRoutePortsLocationPropertiesFormat = &expressRoutePortsLocationPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erpl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erpl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erpl.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erpl.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erpl.Tags = tags - } - } - } - - return nil -} - -// ExpressRoutePortsLocationBandwidths real-time inventory of available ExpressRoute port bandwidths. -type ExpressRoutePortsLocationBandwidths struct { - // OfferName - READ-ONLY; Bandwidth descriptive name. - OfferName *string `json:"offerName,omitempty"` - // ValueInGbps - READ-ONLY; Bandwidth value in Gbps. - ValueInGbps *int32 `json:"valueInGbps,omitempty"` -} - -// ExpressRoutePortsLocationListResult response for ListExpressRoutePortsLocations API service call. -type ExpressRoutePortsLocationListResult struct { - autorest.Response `json:"-"` - // Value - The list of all ExpressRoutePort peering locations. - Value *[]ExpressRoutePortsLocation `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRoutePortsLocationListResultIterator provides access to a complete listing of -// ExpressRoutePortsLocation values. -type ExpressRoutePortsLocationListResultIterator struct { - i int - page ExpressRoutePortsLocationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRoutePortsLocationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRoutePortsLocationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRoutePortsLocationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRoutePortsLocationListResultIterator) Response() ExpressRoutePortsLocationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRoutePortsLocationListResultIterator) Value() ExpressRoutePortsLocation { - if !iter.page.NotDone() { - return ExpressRoutePortsLocation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRoutePortsLocationListResultIterator type. -func NewExpressRoutePortsLocationListResultIterator(page ExpressRoutePortsLocationListResultPage) ExpressRoutePortsLocationListResultIterator { - return ExpressRoutePortsLocationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erpllr ExpressRoutePortsLocationListResult) IsEmpty() bool { - return erpllr.Value == nil || len(*erpllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erpllr ExpressRoutePortsLocationListResult) hasNextLink() bool { - return erpllr.NextLink != nil && len(*erpllr.NextLink) != 0 -} - -// expressRoutePortsLocationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erpllr ExpressRoutePortsLocationListResult) expressRoutePortsLocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erpllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erpllr.NextLink))) -} - -// ExpressRoutePortsLocationListResultPage contains a page of ExpressRoutePortsLocation values. -type ExpressRoutePortsLocationListResultPage struct { - fn func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error) - erpllr ExpressRoutePortsLocationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRoutePortsLocationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erpllr) - if err != nil { - return err - } - page.erpllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRoutePortsLocationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRoutePortsLocationListResultPage) NotDone() bool { - return !page.erpllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRoutePortsLocationListResultPage) Response() ExpressRoutePortsLocationListResult { - return page.erpllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRoutePortsLocationListResultPage) Values() []ExpressRoutePortsLocation { - if page.erpllr.IsEmpty() { - return nil - } - return *page.erpllr.Value -} - -// Creates a new instance of the ExpressRoutePortsLocationListResultPage type. -func NewExpressRoutePortsLocationListResultPage(cur ExpressRoutePortsLocationListResult, getNextPage func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)) ExpressRoutePortsLocationListResultPage { - return ExpressRoutePortsLocationListResultPage{ - fn: getNextPage, - erpllr: cur, - } -} - -// ExpressRoutePortsLocationPropertiesFormat properties specific to ExpressRoutePorts peering location -// resources. -type ExpressRoutePortsLocationPropertiesFormat struct { - // Address - READ-ONLY; Address of peering location. - Address *string `json:"address,omitempty"` - // Contact - READ-ONLY; Contact details of peering locations. - Contact *string `json:"contact,omitempty"` - // AvailableBandwidths - The inventory of available ExpressRoutePort bandwidths. - AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port location resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationPropertiesFormat. -func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erplpf.AvailableBandwidths != nil { - objectMap["availableBandwidths"] = erplpf.AvailableBandwidths - } - return json.Marshal(objectMap) -} - -// ExpressRouteServiceProvider a ExpressRouteResourceProvider object. -type ExpressRouteServiceProvider struct { - // ExpressRouteServiceProviderPropertiesFormat - Properties of the express route service provider. - *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. -func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { - objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat - } - if ersp.ID != nil { - objectMap["id"] = ersp.ID - } - if ersp.Location != nil { - objectMap["location"] = ersp.Location - } - if ersp.Tags != nil { - objectMap["tags"] = ersp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. -func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat - err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) - if err != nil { - return err - } - ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ersp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ersp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ersp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ersp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ersp.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider -// resources. -type ExpressRouteServiceProviderBandwidthsOffered struct { - // OfferName - The OfferName. - OfferName *string `json:"offerName,omitempty"` - // ValueInMbps - The ValueInMbps. - ValueInMbps *int32 `json:"valueInMbps,omitempty"` -} - -// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call. -type ExpressRouteServiceProviderListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteResourceProvider resources. - Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of -// ExpressRouteServiceProvider values. -type ExpressRouteServiceProviderListResultIterator struct { - i int - page ExpressRouteServiceProviderListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { - if !iter.page.NotDone() { - return ExpressRouteServiceProvider{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type. -func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator { - return ExpressRouteServiceProviderListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { - return ersplr.Value == nil || len(*ersplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { - return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 -} - -// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ersplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ersplr.NextLink))) -} - -// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. -type ExpressRouteServiceProviderListResultPage struct { - fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) - ersplr ExpressRouteServiceProviderListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ersplr) - if err != nil { - return err - } - page.ersplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteServiceProviderListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { - return !page.ersplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { - return page.ersplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { - if page.ersplr.IsEmpty() { - return nil - } - return *page.ersplr.Value -} - -// Creates a new instance of the ExpressRouteServiceProviderListResultPage type. -func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { - return ExpressRouteServiceProviderListResultPage{ - fn: getNextPage, - ersplr: cur, - } -} - -// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. -type ExpressRouteServiceProviderPropertiesFormat struct { - // PeeringLocations - A list of peering locations. - PeeringLocations *[]string `json:"peeringLocations,omitempty"` - // BandwidthsOffered - A list of bandwidths offered. - BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route service provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteServiceProviderPropertiesFormat. -func (ersppf ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ersppf.PeeringLocations != nil { - objectMap["peeringLocations"] = ersppf.PeeringLocations - } - if ersppf.BandwidthsOffered != nil { - objectMap["bandwidthsOffered"] = ersppf.BandwidthsOffered - } - return json.Marshal(objectMap) -} - -// FirewallPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FirewallPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPoliciesClient) (FirewallPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPoliciesCreateOrUpdateFuture.Result. -func (future *FirewallPoliciesCreateOrUpdateFuture) result(client FirewallPoliciesClient) (fp FirewallPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fp.Response.Response, err = future.GetResult(sender); err == nil && fp.Response.Response.StatusCode != http.StatusNoContent { - fp, err = client.CreateOrUpdateResponder(fp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", fp.Response.Response, "Failure responding to request") - } - } - return -} - -// FirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FirewallPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPoliciesDeleteFuture.Result. -func (future *FirewallPoliciesDeleteFuture) result(client FirewallPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FirewallPolicy firewallPolicy Resource. -type FirewallPolicy struct { - autorest.Response `json:"-"` - // FirewallPolicyPropertiesFormat - Properties of the firewall policy. - *FirewallPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicy. -func (fp FirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fp.FirewallPolicyPropertiesFormat != nil { - objectMap["properties"] = fp.FirewallPolicyPropertiesFormat - } - if fp.ID != nil { - objectMap["id"] = fp.ID - } - if fp.Location != nil { - objectMap["location"] = fp.Location - } - if fp.Tags != nil { - objectMap["tags"] = fp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicy struct. -func (fp *FirewallPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var firewallPolicyPropertiesFormat FirewallPolicyPropertiesFormat - err = json.Unmarshal(*v, &firewallPolicyPropertiesFormat) - if err != nil { - return err - } - fp.FirewallPolicyPropertiesFormat = &firewallPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fp.Tags = tags - } - } - } - - return nil -} - -// FirewallPolicyFilterRuleCollection firewall Policy Filter Rule Collection. -type FirewallPolicyFilterRuleCollection struct { - // Action - The action type of a Filter rule collection. - Action *FirewallPolicyFilterRuleCollectionAction `json:"action,omitempty"` - // Rules - List of rules included in a rule collection. - Rules *[]BasicFirewallPolicyRule `json:"rules,omitempty"` - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - fpfrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyFilterRuleCollection - objectMap := make(map[string]interface{}) - if fpfrc.Action != nil { - objectMap["action"] = fpfrc.Action - } - if fpfrc.Rules != nil { - objectMap["rules"] = fpfrc.Rules - } - if fpfrc.Name != nil { - objectMap["name"] = fpfrc.Name - } - if fpfrc.Priority != nil { - objectMap["priority"] = fpfrc.Priority - } - if fpfrc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fpfrc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return &fpfrc, true -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fpfrc, true -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyFilterRuleCollection struct. -func (fpfrc *FirewallPolicyFilterRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "action": - if v != nil { - var action FirewallPolicyFilterRuleCollectionAction - err = json.Unmarshal(*v, &action) - if err != nil { - return err - } - fpfrc.Action = &action - } - case "rules": - if v != nil { - rules, err := unmarshalBasicFirewallPolicyRuleArray(*v) - if err != nil { - return err - } - fpfrc.Rules = &rules - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fpfrc.Name = &name - } - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fpfrc.Priority = &priority - } - case "ruleCollectionType": - if v != nil { - var ruleCollectionType RuleCollectionType - err = json.Unmarshal(*v, &ruleCollectionType) - if err != nil { - return err - } - fpfrc.RuleCollectionType = ruleCollectionType - } - } - } - - return nil -} - -// FirewallPolicyFilterRuleCollectionAction properties of the FirewallPolicyFilterRuleCollectionAction. -type FirewallPolicyFilterRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'FirewallPolicyFilterRuleCollectionActionTypeAllow', 'FirewallPolicyFilterRuleCollectionActionTypeDeny' - Type FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyListResult response for ListFirewallPolicies API service call. -type FirewallPolicyListResult struct { - autorest.Response `json:"-"` - // Value - List of Firewall Policies in a resource group. - Value *[]FirewallPolicy `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// FirewallPolicyListResultIterator provides access to a complete listing of FirewallPolicy values. -type FirewallPolicyListResultIterator struct { - i int - page FirewallPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FirewallPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FirewallPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FirewallPolicyListResultIterator) Response() FirewallPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FirewallPolicyListResultIterator) Value() FirewallPolicy { - if !iter.page.NotDone() { - return FirewallPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FirewallPolicyListResultIterator type. -func NewFirewallPolicyListResultIterator(page FirewallPolicyListResultPage) FirewallPolicyListResultIterator { - return FirewallPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fplr FirewallPolicyListResult) IsEmpty() bool { - return fplr.Value == nil || len(*fplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fplr FirewallPolicyListResult) hasNextLink() bool { - return fplr.NextLink != nil && len(*fplr.NextLink) != 0 -} - -// firewallPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fplr FirewallPolicyListResult) firewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fplr.NextLink))) -} - -// FirewallPolicyListResultPage contains a page of FirewallPolicy values. -type FirewallPolicyListResultPage struct { - fn func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error) - fplr FirewallPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fplr) - if err != nil { - return err - } - page.fplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FirewallPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FirewallPolicyListResultPage) NotDone() bool { - return !page.fplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FirewallPolicyListResultPage) Response() FirewallPolicyListResult { - return page.fplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FirewallPolicyListResultPage) Values() []FirewallPolicy { - if page.fplr.IsEmpty() { - return nil - } - return *page.fplr.Value -} - -// Creates a new instance of the FirewallPolicyListResultPage type. -func NewFirewallPolicyListResultPage(cur FirewallPolicyListResult, getNextPage func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)) FirewallPolicyListResultPage { - return FirewallPolicyListResultPage{ - fn: getNextPage, - fplr: cur, - } -} - -// FirewallPolicyNatRuleCollection firewall Policy NAT Rule Collection. -type FirewallPolicyNatRuleCollection struct { - // Action - The action type of a Nat rule collection. - Action *FirewallPolicyNatRuleCollectionAction `json:"action,omitempty"` - // Rules - List of rules included in a rule collection. - Rules *[]BasicFirewallPolicyRule `json:"rules,omitempty"` - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - fpnrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyNatRuleCollection - objectMap := make(map[string]interface{}) - if fpnrc.Action != nil { - objectMap["action"] = fpnrc.Action - } - if fpnrc.Rules != nil { - objectMap["rules"] = fpnrc.Rules - } - if fpnrc.Name != nil { - objectMap["name"] = fpnrc.Name - } - if fpnrc.Priority != nil { - objectMap["priority"] = fpnrc.Priority - } - if fpnrc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fpnrc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return &fpnrc, true -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fpnrc, true -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyNatRuleCollection struct. -func (fpnrc *FirewallPolicyNatRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "action": - if v != nil { - var action FirewallPolicyNatRuleCollectionAction - err = json.Unmarshal(*v, &action) - if err != nil { - return err - } - fpnrc.Action = &action - } - case "rules": - if v != nil { - rules, err := unmarshalBasicFirewallPolicyRuleArray(*v) - if err != nil { - return err - } - fpnrc.Rules = &rules - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fpnrc.Name = &name - } - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fpnrc.Priority = &priority - } - case "ruleCollectionType": - if v != nil { - var ruleCollectionType RuleCollectionType - err = json.Unmarshal(*v, &ruleCollectionType) - if err != nil { - return err - } - fpnrc.RuleCollectionType = ruleCollectionType - } - } - } - - return nil -} - -// FirewallPolicyNatRuleCollectionAction properties of the FirewallPolicyNatRuleCollectionAction. -type FirewallPolicyNatRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'DNAT' - Type FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyPropertiesFormat firewall Policy definition. -type FirewallPolicyPropertiesFormat struct { - // RuleCollectionGroups - READ-ONLY; List of references to FirewallPolicyRuleCollectionGroups. - RuleCollectionGroups *[]SubResource `json:"ruleCollectionGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // BasePolicy - The parent firewall policy from which rules are inherited. - BasePolicy *SubResource `json:"basePolicy,omitempty"` - // Firewalls - READ-ONLY; List of references to Azure Firewalls that this Firewall Policy is associated with. - Firewalls *[]SubResource `json:"firewalls,omitempty"` - // ChildPolicies - READ-ONLY; List of references to Child Firewall Policies. - ChildPolicies *[]SubResource `json:"childPolicies,omitempty"` - // ThreatIntelMode - The operation mode for Threat Intelligence. Possible values include: 'AzureFirewallThreatIntelModeAlert', 'AzureFirewallThreatIntelModeDeny', 'AzureFirewallThreatIntelModeOff' - ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - // ThreatIntelWhitelist - ThreatIntel Whitelist for Firewall Policy. - ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` - // DNSSettings - DNS Proxy Settings definition. - DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyPropertiesFormat. -func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fppf.BasePolicy != nil { - objectMap["basePolicy"] = fppf.BasePolicy - } - if fppf.ThreatIntelMode != "" { - objectMap["threatIntelMode"] = fppf.ThreatIntelMode - } - if fppf.ThreatIntelWhitelist != nil { - objectMap["threatIntelWhitelist"] = fppf.ThreatIntelWhitelist - } - if fppf.DNSSettings != nil { - objectMap["dnsSettings"] = fppf.DNSSettings - } - return json.Marshal(objectMap) -} - -// BasicFirewallPolicyRule properties of a rule. -type BasicFirewallPolicyRule interface { - AsApplicationRule() (*ApplicationRule, bool) - AsNatRule() (*NatRule, bool) - AsRule() (*Rule, bool) - AsFirewallPolicyRule() (*FirewallPolicyRule, bool) -} - -// FirewallPolicyRule properties of a rule. -type FirewallPolicyRule struct { - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -func unmarshalBasicFirewallPolicyRule(body []byte) (BasicFirewallPolicyRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["ruleType"] { - case string(RuleTypeApplicationRule): - var ar ApplicationRule - err := json.Unmarshal(body, &ar) - return ar, err - case string(RuleTypeNatRule): - var nr NatRule - err := json.Unmarshal(body, &nr) - return nr, err - case string(RuleTypeNetworkRule): - var r Rule - err := json.Unmarshal(body, &r) - return r, err - default: - var fpr FirewallPolicyRule - err := json.Unmarshal(body, &fpr) - return fpr, err - } -} -func unmarshalBasicFirewallPolicyRuleArray(body []byte) ([]BasicFirewallPolicyRule, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fprArray := make([]BasicFirewallPolicyRule, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fpr, err := unmarshalBasicFirewallPolicyRule(*rawMessage) - if err != nil { - return nil, err - } - fprArray[index] = fpr - } - return fprArray, nil -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRule. -func (fpr FirewallPolicyRule) MarshalJSON() ([]byte, error) { - fpr.RuleType = RuleTypeFirewallPolicyRule - objectMap := make(map[string]interface{}) - if fpr.Name != nil { - objectMap["name"] = fpr.Name - } - if fpr.Description != nil { - objectMap["description"] = fpr.Description - } - if fpr.RuleType != "" { - objectMap["ruleType"] = fpr.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return &fpr, true -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &fpr, true -} - -// FirewallPolicyRuleApplicationProtocol properties of the application rule protocol. -type FirewallPolicyRuleApplicationProtocol struct { - // ProtocolType - Protocol type. Possible values include: 'FirewallPolicyRuleApplicationProtocolTypeHTTP', 'FirewallPolicyRuleApplicationProtocolTypeHTTPS' - ProtocolType FirewallPolicyRuleApplicationProtocolType `json:"protocolType,omitempty"` - // Port - Port number for the protocol, cannot be greater than 64000. - Port *int32 `json:"port,omitempty"` -} - -// BasicFirewallPolicyRuleCollection properties of the rule collection. -type BasicFirewallPolicyRuleCollection interface { - AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) - AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) - AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) -} - -// FirewallPolicyRuleCollection properties of the rule collection. -type FirewallPolicyRuleCollection struct { - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -func unmarshalBasicFirewallPolicyRuleCollection(body []byte) (BasicFirewallPolicyRuleCollection, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["ruleCollectionType"] { - case string(RuleCollectionTypeFirewallPolicyNatRuleCollection): - var fpnrc FirewallPolicyNatRuleCollection - err := json.Unmarshal(body, &fpnrc) - return fpnrc, err - case string(RuleCollectionTypeFirewallPolicyFilterRuleCollection): - var fpfrc FirewallPolicyFilterRuleCollection - err := json.Unmarshal(body, &fpfrc) - return fpfrc, err - default: - var fprc FirewallPolicyRuleCollection - err := json.Unmarshal(body, &fprc) - return fprc, err - } -} -func unmarshalBasicFirewallPolicyRuleCollectionArray(body []byte) ([]BasicFirewallPolicyRuleCollection, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fprcArray := make([]BasicFirewallPolicyRuleCollection, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fprc, err := unmarshalBasicFirewallPolicyRuleCollection(*rawMessage) - if err != nil { - return nil, err - } - fprcArray[index] = fprc - } - return fprcArray, nil -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { - fprc.RuleCollectionType = RuleCollectionTypeFirewallPolicyRuleCollection - objectMap := make(map[string]interface{}) - if fprc.Name != nil { - objectMap["name"] = fprc.Name - } - if fprc.Priority != nil { - objectMap["priority"] = fprc.Priority - } - if fprc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fprc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return &fprc, true -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fprc, true -} - -// FirewallPolicyRuleCollectionGroup rule Collection Group resource. -type FirewallPolicyRuleCollectionGroup struct { - autorest.Response `json:"-"` - // FirewallPolicyRuleCollectionGroupProperties - The properties of the firewall policy rule collection group. - *FirewallPolicyRuleCollectionGroupProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Rule Group type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollectionGroup. -func (fprcg FirewallPolicyRuleCollectionGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fprcg.FirewallPolicyRuleCollectionGroupProperties != nil { - objectMap["properties"] = fprcg.FirewallPolicyRuleCollectionGroupProperties - } - if fprcg.Name != nil { - objectMap["name"] = fprcg.Name - } - if fprcg.ID != nil { - objectMap["id"] = fprcg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyRuleCollectionGroup struct. -func (fprcg *FirewallPolicyRuleCollectionGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var firewallPolicyRuleCollectionGroupProperties FirewallPolicyRuleCollectionGroupProperties - err = json.Unmarshal(*v, &firewallPolicyRuleCollectionGroupProperties) - if err != nil { - return err - } - fprcg.FirewallPolicyRuleCollectionGroupProperties = &firewallPolicyRuleCollectionGroupProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fprcg.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fprcg.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fprcg.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fprcg.ID = &ID - } - } - } - - return nil -} - -// FirewallPolicyRuleCollectionGroupListResult response for ListFirewallPolicyRuleCollectionGroups API -// service call. -type FirewallPolicyRuleCollectionGroupListResult struct { - autorest.Response `json:"-"` - // Value - List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. - Value *[]FirewallPolicyRuleCollectionGroup `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// FirewallPolicyRuleCollectionGroupListResultIterator provides access to a complete listing of -// FirewallPolicyRuleCollectionGroup values. -type FirewallPolicyRuleCollectionGroupListResultIterator struct { - i int - page FirewallPolicyRuleCollectionGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FirewallPolicyRuleCollectionGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FirewallPolicyRuleCollectionGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) Response() FirewallPolicyRuleCollectionGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) Value() FirewallPolicyRuleCollectionGroup { - if !iter.page.NotDone() { - return FirewallPolicyRuleCollectionGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FirewallPolicyRuleCollectionGroupListResultIterator type. -func NewFirewallPolicyRuleCollectionGroupListResultIterator(page FirewallPolicyRuleCollectionGroupListResultPage) FirewallPolicyRuleCollectionGroupListResultIterator { - return FirewallPolicyRuleCollectionGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) IsEmpty() bool { - return fprcglr.Value == nil || len(*fprcglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) hasNextLink() bool { - return fprcglr.NextLink != nil && len(*fprcglr.NextLink) != 0 -} - -// firewallPolicyRuleCollectionGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) firewallPolicyRuleCollectionGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fprcglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fprcglr.NextLink))) -} - -// FirewallPolicyRuleCollectionGroupListResultPage contains a page of FirewallPolicyRuleCollectionGroup -// values. -type FirewallPolicyRuleCollectionGroupListResultPage struct { - fn func(context.Context, FirewallPolicyRuleCollectionGroupListResult) (FirewallPolicyRuleCollectionGroupListResult, error) - fprcglr FirewallPolicyRuleCollectionGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FirewallPolicyRuleCollectionGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fprcglr) - if err != nil { - return err - } - page.fprcglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FirewallPolicyRuleCollectionGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FirewallPolicyRuleCollectionGroupListResultPage) NotDone() bool { - return !page.fprcglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FirewallPolicyRuleCollectionGroupListResultPage) Response() FirewallPolicyRuleCollectionGroupListResult { - return page.fprcglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FirewallPolicyRuleCollectionGroupListResultPage) Values() []FirewallPolicyRuleCollectionGroup { - if page.fprcglr.IsEmpty() { - return nil - } - return *page.fprcglr.Value -} - -// Creates a new instance of the FirewallPolicyRuleCollectionGroupListResultPage type. -func NewFirewallPolicyRuleCollectionGroupListResultPage(cur FirewallPolicyRuleCollectionGroupListResult, getNextPage func(context.Context, FirewallPolicyRuleCollectionGroupListResult) (FirewallPolicyRuleCollectionGroupListResult, error)) FirewallPolicyRuleCollectionGroupListResultPage { - return FirewallPolicyRuleCollectionGroupListResultPage{ - fn: getNextPage, - fprcglr: cur, - } -} - -// FirewallPolicyRuleCollectionGroupProperties properties of the rule collection group. -type FirewallPolicyRuleCollectionGroupProperties struct { - // Priority - Priority of the Firewall Policy Rule Collection Group resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollections - Group of Firewall Policy rule collections. - RuleCollections *[]BasicFirewallPolicyRuleCollection `json:"ruleCollections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy rule collection group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollectionGroupProperties. -func (fprcgp FirewallPolicyRuleCollectionGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fprcgp.Priority != nil { - objectMap["priority"] = fprcgp.Priority - } - if fprcgp.RuleCollections != nil { - objectMap["ruleCollections"] = fprcgp.RuleCollections - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyRuleCollectionGroupProperties struct. -func (fprcgp *FirewallPolicyRuleCollectionGroupProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fprcgp.Priority = &priority - } - case "ruleCollections": - if v != nil { - ruleCollections, err := unmarshalBasicFirewallPolicyRuleCollectionArray(*v) - if err != nil { - return err - } - fprcgp.RuleCollections = &ruleCollections - } - case "provisioningState": - if v != nil { - var provisioningState ProvisioningState - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - fprcgp.ProvisioningState = provisioningState - } - } - } - - return nil -} - -// FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPolicyRuleCollectionGroupsClient) (FirewallPolicyRuleCollectionGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture.Result. -func (future *FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture) result(client FirewallPolicyRuleCollectionGroupsClient) (fprcg FirewallPolicyRuleCollectionGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fprcg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fprcg.Response.Response, err = future.GetResult(sender); err == nil && fprcg.Response.Response.StatusCode != http.StatusNoContent { - fprcg, err = client.CreateOrUpdateResponder(fprcg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture", "Result", fprcg.Response.Response, "Failure responding to request") - } - } - return -} - -// FirewallPolicyRuleCollectionGroupsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type FirewallPolicyRuleCollectionGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPolicyRuleCollectionGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPolicyRuleCollectionGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPolicyRuleCollectionGroupsDeleteFuture.Result. -func (future *FirewallPolicyRuleCollectionGroupsDeleteFuture) result(client FirewallPolicyRuleCollectionGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleCollectionGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FirewallPolicyThreatIntelWhitelist threatIntel Whitelist for Firewall Policy. -type FirewallPolicyThreatIntelWhitelist struct { - // IPAddresses - List of IP addresses for the ThreatIntel Whitelist. - IPAddresses *[]string `json:"ipAddresses,omitempty"` - // Fqdns - List of FQDNs for the ThreatIntel Whitelist. - Fqdns *[]string `json:"fqdns,omitempty"` -} - -// FlowLog a flow log resource. -type FlowLog struct { - autorest.Response `json:"-"` - // FlowLogPropertiesFormat - Properties of the flow log. - *FlowLogPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for FlowLog. -func (fl FlowLog) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fl.FlowLogPropertiesFormat != nil { - objectMap["properties"] = fl.FlowLogPropertiesFormat - } - if fl.ID != nil { - objectMap["id"] = fl.ID - } - if fl.Location != nil { - objectMap["location"] = fl.Location - } - if fl.Tags != nil { - objectMap["tags"] = fl.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FlowLog struct. -func (fl *FlowLog) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var flowLogPropertiesFormat FlowLogPropertiesFormat - err = json.Unmarshal(*v, &flowLogPropertiesFormat) - if err != nil { - return err - } - fl.FlowLogPropertiesFormat = &flowLogPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fl.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fl.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fl.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fl.Tags = tags - } - } - } - - return nil -} - -// FlowLogFormatParameters parameters that define the flow log format. -type FlowLogFormatParameters struct { - // Type - The file type of flow log. Possible values include: 'JSON' - Type FlowLogFormatType `json:"type,omitempty"` - // Version - The version (revision) of the flow log. - Version *int32 `json:"version,omitempty"` -} - -// FlowLogInformation information on the configuration of flow log and traffic analytics (optional) . -type FlowLogInformation struct { - autorest.Response `json:"-"` - // TargetResourceID - The ID of the resource to configure for flow log and traffic analytics (optional) . - TargetResourceID *string `json:"targetResourceId,omitempty"` - // FlowLogProperties - Properties of the flow log. - *FlowLogProperties `json:"properties,omitempty"` - // FlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogInformation. -func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fli.TargetResourceID != nil { - objectMap["targetResourceId"] = fli.TargetResourceID - } - if fli.FlowLogProperties != nil { - objectMap["properties"] = fli.FlowLogProperties - } - if fli.FlowAnalyticsConfiguration != nil { - objectMap["flowAnalyticsConfiguration"] = fli.FlowAnalyticsConfiguration - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. -func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "targetResourceId": - if v != nil { - var targetResourceID string - err = json.Unmarshal(*v, &targetResourceID) - if err != nil { - return err - } - fli.TargetResourceID = &targetResourceID - } - case "properties": - if v != nil { - var flowLogProperties FlowLogProperties - err = json.Unmarshal(*v, &flowLogProperties) - if err != nil { - return err - } - fli.FlowLogProperties = &flowLogProperties - } - case "flowAnalyticsConfiguration": - if v != nil { - var flowAnalyticsConfiguration TrafficAnalyticsProperties - err = json.Unmarshal(*v, &flowAnalyticsConfiguration) - if err != nil { - return err - } - fli.FlowAnalyticsConfiguration = &flowAnalyticsConfiguration - } - } - } - - return nil -} - -// FlowLogListResult list of flow logs. -type FlowLogListResult struct { - autorest.Response `json:"-"` - // Value - Information about flow log resource. - Value *[]FlowLog `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogListResult. -func (fllr FlowLogListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fllr.Value != nil { - objectMap["value"] = fllr.Value - } - return json.Marshal(objectMap) -} - -// FlowLogListResultIterator provides access to a complete listing of FlowLog values. -type FlowLogListResultIterator struct { - i int - page FlowLogListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FlowLogListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FlowLogListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FlowLogListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FlowLogListResultIterator) Response() FlowLogListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FlowLogListResultIterator) Value() FlowLog { - if !iter.page.NotDone() { - return FlowLog{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FlowLogListResultIterator type. -func NewFlowLogListResultIterator(page FlowLogListResultPage) FlowLogListResultIterator { - return FlowLogListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fllr FlowLogListResult) IsEmpty() bool { - return fllr.Value == nil || len(*fllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fllr FlowLogListResult) hasNextLink() bool { - return fllr.NextLink != nil && len(*fllr.NextLink) != 0 -} - -// flowLogListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fllr FlowLogListResult) flowLogListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fllr.NextLink))) -} - -// FlowLogListResultPage contains a page of FlowLog values. -type FlowLogListResultPage struct { - fn func(context.Context, FlowLogListResult) (FlowLogListResult, error) - fllr FlowLogListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FlowLogListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fllr) - if err != nil { - return err - } - page.fllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FlowLogListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FlowLogListResultPage) NotDone() bool { - return !page.fllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FlowLogListResultPage) Response() FlowLogListResult { - return page.fllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FlowLogListResultPage) Values() []FlowLog { - if page.fllr.IsEmpty() { - return nil - } - return *page.fllr.Value -} - -// Creates a new instance of the FlowLogListResultPage type. -func NewFlowLogListResultPage(cur FlowLogListResult, getNextPage func(context.Context, FlowLogListResult) (FlowLogListResult, error)) FlowLogListResultPage { - return FlowLogListResultPage{ - fn: getNextPage, - fllr: cur, - } -} - -// FlowLogProperties parameters that define the configuration of flow log. -type FlowLogProperties struct { - // StorageID - ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - // Enabled - Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - // RetentionPolicy - Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - // Format - Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` -} - -// FlowLogPropertiesFormat parameters that define the configuration of flow log. -type FlowLogPropertiesFormat struct { - // TargetResourceID - ID of network security group to which flow log will be applied. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // TargetResourceGUID - READ-ONLY; Guid of network security group to which flow log will be applied. - TargetResourceGUID *string `json:"targetResourceGuid,omitempty"` - // StorageID - ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - // Enabled - Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - // RetentionPolicy - Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - // Format - Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` - // FlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the flow log. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogPropertiesFormat. -func (flpf FlowLogPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if flpf.TargetResourceID != nil { - objectMap["targetResourceId"] = flpf.TargetResourceID - } - if flpf.StorageID != nil { - objectMap["storageId"] = flpf.StorageID - } - if flpf.Enabled != nil { - objectMap["enabled"] = flpf.Enabled - } - if flpf.RetentionPolicy != nil { - objectMap["retentionPolicy"] = flpf.RetentionPolicy - } - if flpf.Format != nil { - objectMap["format"] = flpf.Format - } - if flpf.FlowAnalyticsConfiguration != nil { - objectMap["flowAnalyticsConfiguration"] = flpf.FlowAnalyticsConfiguration - } - return json.Marshal(objectMap) -} - -// FlowLogsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FlowLogsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FlowLogsClient) (FlowLog, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FlowLogsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FlowLogsCreateOrUpdateFuture.Result. -func (future *FlowLogsCreateOrUpdateFuture) result(client FlowLogsClient) (fl FlowLog, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FlowLogsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fl.Response.Response, err = future.GetResult(sender); err == nil && fl.Response.Response.StatusCode != http.StatusNoContent { - fl, err = client.CreateOrUpdateResponder(fl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", fl.Response.Response, "Failure responding to request") - } - } - return -} - -// FlowLogsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FlowLogsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FlowLogsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FlowLogsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FlowLogsDeleteFuture.Result. -func (future *FlowLogsDeleteFuture) result(client FlowLogsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FlowLogsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics -// (optional) status. -type FlowLogStatusParameters struct { - // TargetResourceID - The target resource where getting the flow log and traffic analytics (optional) status. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// FrontendIPConfiguration frontend IP address of the load balancer. -type FrontendIPConfiguration struct { - autorest.Response `json:"-"` - // FrontendIPConfigurationPropertiesFormat - Properties of the load balancer probe. - *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for FrontendIPConfiguration. -func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fic.FrontendIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat - } - if fic.Name != nil { - objectMap["name"] = fic.Name - } - if fic.Zones != nil { - objectMap["zones"] = fic.Zones - } - if fic.ID != nil { - objectMap["id"] = fic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. -func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) - if err != nil { - return err - } - fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fic.Type = &typeVar - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - fic.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fic.ID = &ID - } - } - } - - return nil -} - -// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer. -type FrontendIPConfigurationPropertiesFormat struct { - // InboundNatRules - READ-ONLY; An array of references to inbound rules that use this frontend IP. - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - // InboundNatPools - READ-ONLY; An array of references to inbound pools that use this frontend IP. - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - // OutboundRules - READ-ONLY; An array of references to outbound rules that use this frontend IP. - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - // LoadBalancingRules - READ-ONLY; An array of references to load balancing rules that use this frontend IP. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the Public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // PublicIPPrefix - The reference to the Public IP Prefix resource. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. -func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ficpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = ficpf.PrivateIPAddress - } - if ficpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod - } - if ficpf.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = ficpf.PrivateIPAddressVersion - } - if ficpf.Subnet != nil { - objectMap["subnet"] = ficpf.Subnet - } - if ficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = ficpf.PublicIPAddress - } - if ficpf.PublicIPPrefix != nil { - objectMap["publicIPPrefix"] = ficpf.PublicIPPrefix - } - return json.Marshal(objectMap) -} - -// GatewayRoute gateway routing details. -type GatewayRoute struct { - // LocalAddress - READ-ONLY; The gateway's local address. - LocalAddress *string `json:"localAddress,omitempty"` - // NetworkProperty - READ-ONLY; The route's network prefix. - NetworkProperty *string `json:"network,omitempty"` - // NextHop - READ-ONLY; The route's next hop. - NextHop *string `json:"nextHop,omitempty"` - // SourcePeer - READ-ONLY; The peer this route was learned from. - SourcePeer *string `json:"sourcePeer,omitempty"` - // Origin - READ-ONLY; The source this route was learned from. - Origin *string `json:"origin,omitempty"` - // AsPath - READ-ONLY; The route's AS path sequence. - AsPath *string `json:"asPath,omitempty"` - // Weight - READ-ONLY; The route's weight. - Weight *int32 `json:"weight,omitempty"` -} - -// GatewayRouteListResult list of virtual network gateway routes. -type GatewayRouteListResult struct { - autorest.Response `json:"-"` - // Value - List of gateway routes. - Value *[]GatewayRoute `json:"value,omitempty"` -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type GeneratevirtualwanvpnserverconfigurationvpnprofileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (VpnProfileResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GeneratevirtualwanvpnserverconfigurationvpnprofileFuture.Result. -func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) result(client BaseClient) (vpr VpnProfileResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vpr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent { - vpr, err = client.GeneratevirtualwanvpnserverconfigurationvpnprofileResponder(vpr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", vpr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetActiveSessionsAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GetActiveSessionsAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionActiveSessionListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GetActiveSessionsAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GetActiveSessionsAllFuture.Result. -func (future *GetActiveSessionsAllFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - baslrp.baslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent { - baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetActiveSessionsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GetActiveSessionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionActiveSessionListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GetActiveSessionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GetActiveSessionsFuture.Result. -func (future *GetActiveSessionsFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - baslrp.baslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent { - baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetVpnSitesConfigurationRequest list of Vpn-Sites. -type GetVpnSitesConfigurationRequest struct { - // VpnSites - List of resource-ids of the vpn-sites for which config is to be downloaded. - VpnSites *[]string `json:"vpnSites,omitempty"` - // OutputBlobSasURL - The sas-url to download the configurations for vpn-sites. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` -} - -// HopLink hop link. -type HopLink struct { - // NextHopID - READ-ONLY; The ID of the next hop. - NextHopID *string `json:"nextHopId,omitempty"` - // LinkType - READ-ONLY; Link type. - LinkType *string `json:"linkType,omitempty"` - // HopLinkProperties - Hop link properties. - *HopLinkProperties `json:"properties,omitempty"` - // Issues - READ-ONLY; List of issues. - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - // Context - READ-ONLY; Provides additional context on links. - Context map[string]*string `json:"context"` - // ResourceID - READ-ONLY; Resource ID. - ResourceID *string `json:"resourceId,omitempty"` -} - -// MarshalJSON is the custom marshaler for HopLink. -func (hl HopLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hl.HopLinkProperties != nil { - objectMap["properties"] = hl.HopLinkProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HopLink struct. -func (hl *HopLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "nextHopId": - if v != nil { - var nextHopID string - err = json.Unmarshal(*v, &nextHopID) - if err != nil { - return err - } - hl.NextHopID = &nextHopID - } - case "linkType": - if v != nil { - var linkType string - err = json.Unmarshal(*v, &linkType) - if err != nil { - return err - } - hl.LinkType = &linkType - } - case "properties": - if v != nil { - var hopLinkProperties HopLinkProperties - err = json.Unmarshal(*v, &hopLinkProperties) - if err != nil { - return err - } - hl.HopLinkProperties = &hopLinkProperties - } - case "issues": - if v != nil { - var issues []ConnectivityIssue - err = json.Unmarshal(*v, &issues) - if err != nil { - return err - } - hl.Issues = &issues - } - case "context": - if v != nil { - var context map[string]*string - err = json.Unmarshal(*v, &context) - if err != nil { - return err - } - hl.Context = context - } - case "resourceId": - if v != nil { - var resourceID string - err = json.Unmarshal(*v, &resourceID) - if err != nil { - return err - } - hl.ResourceID = &resourceID - } - } - } - - return nil -} - -// HopLinkProperties hop link properties. -type HopLinkProperties struct { - // RoundTripTimeMin - READ-ONLY; Minimum roundtrip time in milliseconds. - RoundTripTimeMin *int32 `json:"roundTripTimeMin,omitempty"` - // RoundTripTimeAvg - READ-ONLY; Average roundtrip time in milliseconds. - RoundTripTimeAvg *int32 `json:"roundTripTimeAvg,omitempty"` - // RoundTripTimeMax - READ-ONLY; Maximum roundtrip time in milliseconds. - RoundTripTimeMax *int32 `json:"roundTripTimeMax,omitempty"` -} - -// HTTPConfiguration HTTP configuration of the connectivity check. -type HTTPConfiguration struct { - // Method - HTTP method. Possible values include: 'HTTPMethodGet' - Method HTTPMethod `json:"method,omitempty"` - // Headers - List of HTTP headers. - Headers *[]HTTPHeader `json:"headers,omitempty"` - // ValidStatusCodes - Valid status codes. - ValidStatusCodes *[]int32 `json:"validStatusCodes,omitempty"` -} - -// HTTPHeader the HTTP header. -type HTTPHeader struct { - // Name - The name in HTTP header. - Name *string `json:"name,omitempty"` - // Value - The value in HTTP header. - Value *string `json:"value,omitempty"` -} - -// HubIPAddresses IP addresses associated with azure firewall. -type HubIPAddresses struct { - // PublicIPs - Public IP addresses associated with azure firewall. - PublicIPs *HubPublicIPAddresses `json:"publicIPs,omitempty"` - // PrivateIPAddress - Private IP Address associated with azure firewall. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// HubIPConfiguration ipConfigurations. -type HubIPConfiguration struct { - autorest.Response `json:"-"` - // HubIPConfigurationPropertiesFormat - The properties of the Virtual Hub IPConfigurations. - *HubIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the Ip Configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Ipconfiguration type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubIPConfiguration. -func (hic HubIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hic.HubIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = hic.HubIPConfigurationPropertiesFormat - } - if hic.Name != nil { - objectMap["name"] = hic.Name - } - if hic.ID != nil { - objectMap["id"] = hic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubIPConfiguration struct. -func (hic *HubIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubIPConfigurationPropertiesFormat HubIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &hubIPConfigurationPropertiesFormat) - if err != nil { - return err - } - hic.HubIPConfigurationPropertiesFormat = &hubIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hic.ID = &ID - } - } - } - - return nil -} - -// HubIPConfigurationPropertiesFormat properties of IP configuration. -type HubIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubIPConfigurationPropertiesFormat. -func (hicpf HubIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hicpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = hicpf.PrivateIPAddress - } - if hicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = hicpf.PrivateIPAllocationMethod - } - if hicpf.Subnet != nil { - objectMap["subnet"] = hicpf.Subnet - } - if hicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = hicpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// HubPublicIPAddresses public IP addresses associated with azure firewall. -type HubPublicIPAddresses struct { - // Addresses - The list of Public IP addresses associated with azure firewall or IP addresses to be retained. - Addresses *[]AzureFirewallPublicIPAddress `json:"addresses,omitempty"` - // Count - The number of Public IP addresses associated with azure firewall. - Count *int32 `json:"count,omitempty"` -} - -// HubRoute routeTable route. -type HubRoute struct { - // Name - The name of the Route that is unique within a RouteTable. This name can be used to access this route. - Name *string `json:"name,omitempty"` - // DestinationType - The type of destinations (eg: CIDR, ResourceId, Service). - DestinationType *string `json:"destinationType,omitempty"` - // Destinations - List of all destinations. - Destinations *[]string `json:"destinations,omitempty"` - // NextHopType - The type of next hop (eg: ResourceId). - NextHopType *string `json:"nextHopType,omitempty"` - // NextHop - NextHop resource ID. - NextHop *string `json:"nextHop,omitempty"` -} - -// HubRouteTable routeTable resource in a virtual hub. -type HubRouteTable struct { - autorest.Response `json:"-"` - // HubRouteTableProperties - Properties of the RouteTable resource. - *HubRouteTableProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubRouteTable. -func (hrt HubRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hrt.HubRouteTableProperties != nil { - objectMap["properties"] = hrt.HubRouteTableProperties - } - if hrt.Name != nil { - objectMap["name"] = hrt.Name - } - if hrt.ID != nil { - objectMap["id"] = hrt.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubRouteTable struct. -func (hrt *HubRouteTable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubRouteTableProperties HubRouteTableProperties - err = json.Unmarshal(*v, &hubRouteTableProperties) - if err != nil { - return err - } - hrt.HubRouteTableProperties = &hubRouteTableProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hrt.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hrt.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hrt.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hrt.ID = &ID - } - } - } - - return nil -} - -// HubRouteTableProperties parameters for RouteTable. -type HubRouteTableProperties struct { - // Routes - List of all routes. - Routes *[]HubRoute `json:"routes,omitempty"` - // Labels - List of labels associated with this route table. - Labels *[]string `json:"labels,omitempty"` - // AssociatedConnections - READ-ONLY; List of all connections associated with this route table. - AssociatedConnections *[]string `json:"associatedConnections,omitempty"` - // PropagatingConnections - READ-ONLY; List of all connections that advertise to this route table. - PropagatingConnections *[]string `json:"propagatingConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the RouteTable resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubRouteTableProperties. -func (hrtp HubRouteTableProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hrtp.Routes != nil { - objectMap["routes"] = hrtp.Routes - } - if hrtp.Labels != nil { - objectMap["labels"] = hrtp.Labels - } - return json.Marshal(objectMap) -} - -// HubRouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HubRouteTablesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubRouteTablesClient) (HubRouteTable, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubRouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubRouteTablesCreateOrUpdateFuture.Result. -func (future *HubRouteTablesCreateOrUpdateFuture) result(client HubRouteTablesClient) (hrt HubRouteTable, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hrt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hrt.Response.Response, err = future.GetResult(sender); err == nil && hrt.Response.Response.StatusCode != http.StatusNoContent { - hrt, err = client.CreateOrUpdateResponder(hrt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", hrt.Response.Response, "Failure responding to request") - } - } - return -} - -// HubRouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type HubRouteTablesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubRouteTablesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubRouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubRouteTablesDeleteFuture.Result. -func (future *HubRouteTablesDeleteFuture) result(client HubRouteTablesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// HubVirtualNetworkConnection hubVirtualNetworkConnection Resource. -type HubVirtualNetworkConnection struct { - autorest.Response `json:"-"` - // HubVirtualNetworkConnectionProperties - Properties of the hub virtual network connection. - *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubVirtualNetworkConnection. -func (hvnc HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hvnc.HubVirtualNetworkConnectionProperties != nil { - objectMap["properties"] = hvnc.HubVirtualNetworkConnectionProperties - } - if hvnc.Name != nil { - objectMap["name"] = hvnc.Name - } - if hvnc.ID != nil { - objectMap["id"] = hvnc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubVirtualNetworkConnection struct. -func (hvnc *HubVirtualNetworkConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubVirtualNetworkConnectionProperties HubVirtualNetworkConnectionProperties - err = json.Unmarshal(*v, &hubVirtualNetworkConnectionProperties) - if err != nil { - return err - } - hvnc.HubVirtualNetworkConnectionProperties = &hubVirtualNetworkConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hvnc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hvnc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hvnc.ID = &ID - } - } - } - - return nil -} - -// HubVirtualNetworkConnectionProperties parameters for HubVirtualNetworkConnection. -type HubVirtualNetworkConnectionProperties struct { - // RemoteVirtualNetwork - Reference to the remote virtual network. - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - // AllowHubToRemoteVnetTransit - Deprecated: VirtualHub to RemoteVnet transit to enabled or not. - AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` - // AllowRemoteVnetToUseHubVnetGateways - Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. - AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the hub virtual network connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubVirtualNetworkConnectionProperties. -func (hvncp HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hvncp.RemoteVirtualNetwork != nil { - objectMap["remoteVirtualNetwork"] = hvncp.RemoteVirtualNetwork - } - if hvncp.AllowHubToRemoteVnetTransit != nil { - objectMap["allowHubToRemoteVnetTransit"] = hvncp.AllowHubToRemoteVnetTransit - } - if hvncp.AllowRemoteVnetToUseHubVnetGateways != nil { - objectMap["allowRemoteVnetToUseHubVnetGateways"] = hvncp.AllowRemoteVnetToUseHubVnetGateways - } - if hvncp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = hvncp.EnableInternetSecurity - } - if hvncp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = hvncp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// HubVirtualNetworkConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type HubVirtualNetworkConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubVirtualNetworkConnectionsClient) (HubVirtualNetworkConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubVirtualNetworkConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubVirtualNetworkConnectionsCreateOrUpdateFuture.Result. -func (future *HubVirtualNetworkConnectionsCreateOrUpdateFuture) result(client HubVirtualNetworkConnectionsClient) (hvnc HubVirtualNetworkConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hvnc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubVirtualNetworkConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hvnc.Response.Response, err = future.GetResult(sender); err == nil && hvnc.Response.Response.StatusCode != http.StatusNoContent { - hvnc, err = client.CreateOrUpdateResponder(hvnc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsCreateOrUpdateFuture", "Result", hvnc.Response.Response, "Failure responding to request") - } - } - return -} - -// HubVirtualNetworkConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HubVirtualNetworkConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubVirtualNetworkConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubVirtualNetworkConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubVirtualNetworkConnectionsDeleteFuture.Result. -func (future *HubVirtualNetworkConnectionsDeleteFuture) result(client HubVirtualNetworkConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubVirtualNetworkConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InboundNatPool inbound NAT pool of the load balancer. -type InboundNatPool struct { - // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. - *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatPool. -func (inp InboundNatPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inp.InboundNatPoolPropertiesFormat != nil { - objectMap["properties"] = inp.InboundNatPoolPropertiesFormat - } - if inp.Name != nil { - objectMap["name"] = inp.Name - } - if inp.ID != nil { - objectMap["id"] = inp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. -func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat - err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) - if err != nil { - return err - } - inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - inp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - inp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - inp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - inp.ID = &ID - } - } - } - - return nil -} - -// InboundNatPoolPropertiesFormat properties of Inbound NAT pool. -type InboundNatPoolPropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // Protocol - The reference to the transport protocol used by the inbound NAT pool. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // FrontendPortRangeStart - The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - // FrontendPortRangeEnd - The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatPoolPropertiesFormat. -func (inppf InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inppf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = inppf.FrontendIPConfiguration - } - if inppf.Protocol != "" { - objectMap["protocol"] = inppf.Protocol - } - if inppf.FrontendPortRangeStart != nil { - objectMap["frontendPortRangeStart"] = inppf.FrontendPortRangeStart - } - if inppf.FrontendPortRangeEnd != nil { - objectMap["frontendPortRangeEnd"] = inppf.FrontendPortRangeEnd - } - if inppf.BackendPort != nil { - objectMap["backendPort"] = inppf.BackendPort - } - if inppf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = inppf.IdleTimeoutInMinutes - } - if inppf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = inppf.EnableFloatingIP - } - if inppf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = inppf.EnableTCPReset - } - return json.Marshal(objectMap) -} - -// InboundNatRule inbound NAT rule of the load balancer. -type InboundNatRule struct { - autorest.Response `json:"-"` - // InboundNatRulePropertiesFormat - Properties of load balancer inbound nat rule. - *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRule. -func (inr InboundNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inr.InboundNatRulePropertiesFormat != nil { - objectMap["properties"] = inr.InboundNatRulePropertiesFormat - } - if inr.Name != nil { - objectMap["name"] = inr.Name - } - if inr.ID != nil { - objectMap["id"] = inr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. -func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat - err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) - if err != nil { - return err - } - inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - inr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - inr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - inr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - inr.ID = &ID - } - } - } - - return nil -} - -// InboundNatRuleListResult response for ListInboundNatRule API service call. -type InboundNatRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of inbound nat rules in a load balancer. - Value *[]InboundNatRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRuleListResult. -func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inrlr.Value != nil { - objectMap["value"] = inrlr.Value - } - return json.Marshal(objectMap) -} - -// InboundNatRuleListResultIterator provides access to a complete listing of InboundNatRule values. -type InboundNatRuleListResultIterator struct { - i int - page InboundNatRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InboundNatRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InboundNatRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InboundNatRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InboundNatRuleListResultIterator) Response() InboundNatRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InboundNatRuleListResultIterator) Value() InboundNatRule { - if !iter.page.NotDone() { - return InboundNatRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InboundNatRuleListResultIterator type. -func NewInboundNatRuleListResultIterator(page InboundNatRuleListResultPage) InboundNatRuleListResultIterator { - return InboundNatRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (inrlr InboundNatRuleListResult) IsEmpty() bool { - return inrlr.Value == nil || len(*inrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (inrlr InboundNatRuleListResult) hasNextLink() bool { - return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0 -} - -// inboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !inrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(inrlr.NextLink))) -} - -// InboundNatRuleListResultPage contains a page of InboundNatRule values. -type InboundNatRuleListResultPage struct { - fn func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error) - inrlr InboundNatRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.inrlr) - if err != nil { - return err - } - page.inrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InboundNatRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InboundNatRuleListResultPage) NotDone() bool { - return !page.inrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InboundNatRuleListResultPage) Response() InboundNatRuleListResult { - return page.inrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InboundNatRuleListResultPage) Values() []InboundNatRule { - if page.inrlr.IsEmpty() { - return nil - } - return *page.inrlr.Value -} - -// Creates a new instance of the InboundNatRuleListResultPage type. -func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage { - return InboundNatRuleListResultPage{ - fn: getNextPage, - inrlr: cur, - } -} - -// InboundNatRulePropertiesFormat properties of the inbound NAT rule. -type InboundNatRulePropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. - BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. -func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inrpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration - } - if inrpf.Protocol != "" { - objectMap["protocol"] = inrpf.Protocol - } - if inrpf.FrontendPort != nil { - objectMap["frontendPort"] = inrpf.FrontendPort - } - if inrpf.BackendPort != nil { - objectMap["backendPort"] = inrpf.BackendPort - } - if inrpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes - } - if inrpf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP - } - if inrpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = inrpf.EnableTCPReset - } - return json.Marshal(objectMap) -} - -// InboundNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InboundNatRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InboundNatRulesClient) (InboundNatRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InboundNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InboundNatRulesCreateOrUpdateFuture.Result. -func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRulesClient) (inr InboundNatRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - inr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if inr.Response.Response, err = future.GetResult(sender); err == nil && inr.Response.Response.StatusCode != http.StatusNoContent { - inr, err = client.CreateOrUpdateResponder(inr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", inr.Response.Response, "Failure responding to request") - } - } - return -} - -// InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InboundNatRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InboundNatRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InboundNatRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InboundNatRulesDeleteFuture.Result. -func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IntentPolicy network Intent Policy resource. -type IntentPolicy struct { - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IntentPolicy. -func (IP IntentPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.ID != nil { - objectMap["id"] = IP.ID - } - if IP.Location != nil { - objectMap["location"] = IP.Location - } - if IP.Tags != nil { - objectMap["tags"] = IP.Tags - } - return json.Marshal(objectMap) -} - -// IntentPolicyConfiguration details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. -type IntentPolicyConfiguration struct { - // NetworkIntentPolicyName - The name of the Network Intent Policy for storing in target subscription. - NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"` - // SourceNetworkIntentPolicy - Source network intent policy. - SourceNetworkIntentPolicy *IntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"` -} - -// Interface a network interface in a resource group. -type Interface struct { - autorest.Response `json:"-"` - // InterfacePropertiesFormat - Properties of the network interface. - *InterfacePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Interface. -func (i Interface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.InterfacePropertiesFormat != nil { - objectMap["properties"] = i.InterfacePropertiesFormat - } - if i.ID != nil { - objectMap["id"] = i.ID - } - if i.Location != nil { - objectMap["location"] = i.Location - } - if i.Tags != nil { - objectMap["tags"] = i.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Interface struct. -func (i *Interface) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var interfacePropertiesFormat InterfacePropertiesFormat - err = json.Unmarshal(*v, &interfacePropertiesFormat) - if err != nil { - return err - } - i.InterfacePropertiesFormat = &interfacePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - i.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - i.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - i.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - i.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - i.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - i.Tags = tags - } - } - } - - return nil -} - -// InterfaceAssociation network interface and its custom security rules. -type InterfaceAssociation struct { - // ID - READ-ONLY; Network interface ID. - ID *string `json:"id,omitempty"` - // SecurityRules - Collection of custom security rules. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceAssociation. -func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ia.SecurityRules != nil { - objectMap["securityRules"] = ia.SecurityRules - } - return json.Marshal(objectMap) -} - -// InterfaceDNSSettings DNS settings of a network interface. -type InterfaceDNSSettings struct { - // DNSServers - List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. - DNSServers *[]string `json:"dnsServers,omitempty"` - // AppliedDNSServers - READ-ONLY; If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. - AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` - // InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. - InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` - // InternalFqdn - READ-ONLY; Fully qualified DNS name supporting internal communications between VMs in the same virtual network. - InternalFqdn *string `json:"internalFqdn,omitempty"` - // InternalDomainNameSuffix - READ-ONLY; Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceDNSSettings. -func (ids InterfaceDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ids.DNSServers != nil { - objectMap["dnsServers"] = ids.DNSServers - } - if ids.InternalDNSNameLabel != nil { - objectMap["internalDnsNameLabel"] = ids.InternalDNSNameLabel - } - return json.Marshal(objectMap) -} - -// InterfaceIPConfiguration iPConfiguration in a network interface. -type InterfaceIPConfiguration struct { - autorest.Response `json:"-"` - // InterfaceIPConfigurationPropertiesFormat - Network interface IP configuration properties. - *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. -func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iic.InterfaceIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat - } - if iic.Name != nil { - objectMap["name"] = iic.Name - } - if iic.ID != nil { - objectMap["id"] = iic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. -func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) - if err != nil { - return err - } - iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - iic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - iic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - iic.ID = &ID - } - } - } - - return nil -} - -// InterfaceIPConfigurationListResult response for list ip configurations API service call. -type InterfaceIPConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of ip configurations. - Value *[]InterfaceIPConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfigurationListResult. -func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iiclr.Value != nil { - objectMap["value"] = iiclr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceIPConfigurationListResultIterator provides access to a complete listing of -// InterfaceIPConfiguration values. -type InterfaceIPConfigurationListResultIterator struct { - i int - page InterfaceIPConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceIPConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceIPConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceIPConfigurationListResultIterator) Response() InterfaceIPConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceIPConfigurationListResultIterator) Value() InterfaceIPConfiguration { - if !iter.page.NotDone() { - return InterfaceIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceIPConfigurationListResultIterator type. -func NewInterfaceIPConfigurationListResultIterator(page InterfaceIPConfigurationListResultPage) InterfaceIPConfigurationListResultIterator { - return InterfaceIPConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool { - return iiclr.Value == nil || len(*iiclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool { - return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0 -} - -// interfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !iiclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(iiclr.NextLink))) -} - -// InterfaceIPConfigurationListResultPage contains a page of InterfaceIPConfiguration values. -type InterfaceIPConfigurationListResultPage struct { - fn func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error) - iiclr InterfaceIPConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.iiclr) - if err != nil { - return err - } - page.iiclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceIPConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceIPConfigurationListResultPage) NotDone() bool { - return !page.iiclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceIPConfigurationListResultPage) Response() InterfaceIPConfigurationListResult { - return page.iiclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceIPConfigurationListResultPage) Values() []InterfaceIPConfiguration { - if page.iiclr.IsEmpty() { - return nil - } - return *page.iiclr.Value -} - -// Creates a new instance of the InterfaceIPConfigurationListResultPage type. -func NewInterfaceIPConfigurationListResultPage(cur InterfaceIPConfigurationListResult, getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage { - return InterfaceIPConfigurationListResultPage{ - fn: getNextPage, - iiclr: cur, - } -} - -// InterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnection properties for the network -// interface. -type InterfaceIPConfigurationPrivateLinkConnectionProperties struct { - // GroupID - READ-ONLY; The group ID for current private link connection. - GroupID *string `json:"groupId,omitempty"` - // RequiredMemberName - READ-ONLY; The required member name for current private link connection. - RequiredMemberName *string `json:"requiredMemberName,omitempty"` - // Fqdns - READ-ONLY; List of FQDNs for current private link connection. - Fqdns *[]string `json:"fqdns,omitempty"` -} - -// InterfaceIPConfigurationPropertiesFormat properties of IP configuration. -type InterfaceIPConfigurationPropertiesFormat struct { - // VirtualNetworkTaps - The reference to Virtual Network Taps. - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` - // ApplicationGatewayBackendAddressPools - The reference to ApplicationGatewayBackendAddressPool resource. - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - // LoadBalancerBackendAddressPools - The reference to LoadBalancerBackendAddressPool resource. - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules. - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - // PrivateIPAddress - Private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // Subnet - Subnet bound to the IP configuration. - Subnet *Subnet `json:"subnet,omitempty"` - // Primary - Whether this is a primary customer address on the network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddress - Public IP address bound to the IP configuration. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ApplicationSecurityGroups - Application security groups in which the IP configuration is included. - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkConnectionProperties - READ-ONLY; PrivateLinkConnection properties for the network interface. - PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfigurationPropertiesFormat. -func (iicpf InterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iicpf.VirtualNetworkTaps != nil { - objectMap["virtualNetworkTaps"] = iicpf.VirtualNetworkTaps - } - if iicpf.ApplicationGatewayBackendAddressPools != nil { - objectMap["applicationGatewayBackendAddressPools"] = iicpf.ApplicationGatewayBackendAddressPools - } - if iicpf.LoadBalancerBackendAddressPools != nil { - objectMap["loadBalancerBackendAddressPools"] = iicpf.LoadBalancerBackendAddressPools - } - if iicpf.LoadBalancerInboundNatRules != nil { - objectMap["loadBalancerInboundNatRules"] = iicpf.LoadBalancerInboundNatRules - } - if iicpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = iicpf.PrivateIPAddress - } - if iicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = iicpf.PrivateIPAllocationMethod - } - if iicpf.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = iicpf.PrivateIPAddressVersion - } - if iicpf.Subnet != nil { - objectMap["subnet"] = iicpf.Subnet - } - if iicpf.Primary != nil { - objectMap["primary"] = iicpf.Primary - } - if iicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = iicpf.PublicIPAddress - } - if iicpf.ApplicationSecurityGroups != nil { - objectMap["applicationSecurityGroups"] = iicpf.ApplicationSecurityGroups - } - return json.Marshal(objectMap) -} - -// InterfaceListResult response for the ListNetworkInterface API service call. -type InterfaceListResult struct { - autorest.Response `json:"-"` - // Value - A list of network interfaces in a resource group. - Value *[]Interface `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceListResult. -func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ilr.Value != nil { - objectMap["value"] = ilr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceListResultIterator provides access to a complete listing of Interface values. -type InterfaceListResultIterator struct { - i int - page InterfaceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceListResultIterator) Response() InterfaceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceListResultIterator) Value() Interface { - if !iter.page.NotDone() { - return Interface{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceListResultIterator type. -func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator { - return InterfaceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr InterfaceListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr InterfaceListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// interfaceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// InterfaceListResultPage contains a page of Interface values. -type InterfaceListResultPage struct { - fn func(context.Context, InterfaceListResult) (InterfaceListResult, error) - ilr InterfaceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceListResultPage) Response() InterfaceListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceListResultPage) Values() []Interface { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the InterfaceListResultPage type. -func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { - return InterfaceListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// InterfaceLoadBalancerListResult response for list ip configurations API service call. -type InterfaceLoadBalancerListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancers. - Value *[]LoadBalancer `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceLoadBalancerListResult. -func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ilblr.Value != nil { - objectMap["value"] = ilblr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceLoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. -type InterfaceLoadBalancerListResultIterator struct { - i int - page InterfaceLoadBalancerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceLoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceLoadBalancerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceLoadBalancerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceLoadBalancerListResultIterator) Response() InterfaceLoadBalancerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceLoadBalancerListResultIterator) Value() LoadBalancer { - if !iter.page.NotDone() { - return LoadBalancer{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceLoadBalancerListResultIterator type. -func NewInterfaceLoadBalancerListResultIterator(page InterfaceLoadBalancerListResultPage) InterfaceLoadBalancerListResultIterator { - return InterfaceLoadBalancerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool { - return ilblr.Value == nil || len(*ilblr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool { - return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0 -} - -// interfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilblr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilblr.NextLink))) -} - -// InterfaceLoadBalancerListResultPage contains a page of LoadBalancer values. -type InterfaceLoadBalancerListResultPage struct { - fn func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error) - ilblr InterfaceLoadBalancerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilblr) - if err != nil { - return err - } - page.ilblr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceLoadBalancerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceLoadBalancerListResultPage) NotDone() bool { - return !page.ilblr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceLoadBalancerListResultPage) Response() InterfaceLoadBalancerListResult { - return page.ilblr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceLoadBalancerListResultPage) Values() []LoadBalancer { - if page.ilblr.IsEmpty() { - return nil - } - return *page.ilblr.Value -} - -// Creates a new instance of the InterfaceLoadBalancerListResultPage type. -func NewInterfaceLoadBalancerListResultPage(cur InterfaceLoadBalancerListResult, getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage { - return InterfaceLoadBalancerListResultPage{ - fn: getNextPage, - ilblr: cur, - } -} - -// InterfacePropertiesFormat networkInterface properties. -type InterfacePropertiesFormat struct { - // VirtualMachine - READ-ONLY; The reference to a virtual machine. - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - // NetworkSecurityGroup - The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - // PrivateEndpoint - READ-ONLY; A reference to the private endpoint to which the network interface is linked. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // IPConfigurations - A list of IPConfigurations of the network interface. - IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - // TapConfigurations - READ-ONLY; A list of TapConfigurations of the network interface. - TapConfigurations *[]InterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - // DNSSettings - The DNS settings in network interface. - DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` - // MacAddress - READ-ONLY; The MAC address of the network interface. - MacAddress *string `json:"macAddress,omitempty"` - // Primary - READ-ONLY; Whether this is a primary network interface on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // HostedWorkloads - READ-ONLY; A list of references to linked BareMetal resources. - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network interface resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfacePropertiesFormat. -func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipf.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = ipf.NetworkSecurityGroup - } - if ipf.IPConfigurations != nil { - objectMap["ipConfigurations"] = ipf.IPConfigurations - } - if ipf.DNSSettings != nil { - objectMap["dnsSettings"] = ipf.DNSSettings - } - if ipf.EnableAcceleratedNetworking != nil { - objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking - } - if ipf.EnableIPForwarding != nil { - objectMap["enableIPForwarding"] = ipf.EnableIPForwarding - } - return json.Marshal(objectMap) -} - -// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfacesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (Interface, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. -func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InterfacesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesDeleteFuture.Result. -func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfacesGetEffectiveRouteTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (EffectiveRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result. -func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent { - erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result. -func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ensglr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent { - ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfaceTapConfiguration tap configuration in a Network Interface. -type InterfaceTapConfiguration struct { - autorest.Response `json:"-"` - // InterfaceTapConfigurationPropertiesFormat - Properties of the Virtual Network Tap configuration. - *InterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfiguration. -func (itc InterfaceTapConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itc.InterfaceTapConfigurationPropertiesFormat != nil { - objectMap["properties"] = itc.InterfaceTapConfigurationPropertiesFormat - } - if itc.Name != nil { - objectMap["name"] = itc.Name - } - if itc.ID != nil { - objectMap["id"] = itc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InterfaceTapConfiguration struct. -func (itc *InterfaceTapConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var interfaceTapConfigurationPropertiesFormat InterfaceTapConfigurationPropertiesFormat - err = json.Unmarshal(*v, &interfaceTapConfigurationPropertiesFormat) - if err != nil { - return err - } - itc.InterfaceTapConfigurationPropertiesFormat = &interfaceTapConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - itc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - itc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - itc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - itc.ID = &ID - } - } - } - - return nil -} - -// InterfaceTapConfigurationListResult response for list tap configurations API service call. -type InterfaceTapConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of tap configurations. - Value *[]InterfaceTapConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfigurationListResult. -func (itclr InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itclr.Value != nil { - objectMap["value"] = itclr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceTapConfigurationListResultIterator provides access to a complete listing of -// InterfaceTapConfiguration values. -type InterfaceTapConfigurationListResultIterator struct { - i int - page InterfaceTapConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceTapConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceTapConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceTapConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceTapConfigurationListResultIterator) Response() InterfaceTapConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceTapConfigurationListResultIterator) Value() InterfaceTapConfiguration { - if !iter.page.NotDone() { - return InterfaceTapConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceTapConfigurationListResultIterator type. -func NewInterfaceTapConfigurationListResultIterator(page InterfaceTapConfigurationListResultPage) InterfaceTapConfigurationListResultIterator { - return InterfaceTapConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (itclr InterfaceTapConfigurationListResult) IsEmpty() bool { - return itclr.Value == nil || len(*itclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (itclr InterfaceTapConfigurationListResult) hasNextLink() bool { - return itclr.NextLink != nil && len(*itclr.NextLink) != 0 -} - -// interfaceTapConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (itclr InterfaceTapConfigurationListResult) interfaceTapConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !itclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(itclr.NextLink))) -} - -// InterfaceTapConfigurationListResultPage contains a page of InterfaceTapConfiguration values. -type InterfaceTapConfigurationListResultPage struct { - fn func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error) - itclr InterfaceTapConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceTapConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.itclr) - if err != nil { - return err - } - page.itclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceTapConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceTapConfigurationListResultPage) NotDone() bool { - return !page.itclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceTapConfigurationListResultPage) Response() InterfaceTapConfigurationListResult { - return page.itclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceTapConfigurationListResultPage) Values() []InterfaceTapConfiguration { - if page.itclr.IsEmpty() { - return nil - } - return *page.itclr.Value -} - -// Creates a new instance of the InterfaceTapConfigurationListResultPage type. -func NewInterfaceTapConfigurationListResultPage(cur InterfaceTapConfigurationListResult, getNextPage func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)) InterfaceTapConfigurationListResultPage { - return InterfaceTapConfigurationListResultPage{ - fn: getNextPage, - itclr: cur, - } -} - -// InterfaceTapConfigurationPropertiesFormat properties of Virtual Network Tap configuration. -type InterfaceTapConfigurationPropertiesFormat struct { - // VirtualNetworkTap - The reference to the Virtual Network Tap resource. - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface tap configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfigurationPropertiesFormat. -func (itcpf InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itcpf.VirtualNetworkTap != nil { - objectMap["virtualNetworkTap"] = itcpf.VirtualNetworkTap - } - return json.Marshal(objectMap) -} - -// InterfaceTapConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type InterfaceTapConfigurationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfaceTapConfigurationsClient) (InterfaceTapConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfaceTapConfigurationsCreateOrUpdateFuture.Result. -func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) result(client InterfaceTapConfigurationsClient) (itc InterfaceTapConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - itc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if itc.Response.Response, err = future.GetResult(sender); err == nil && itc.Response.Response.StatusCode != http.StatusNoContent { - itc, err = client.CreateOrUpdateResponder(itc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", itc.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfaceTapConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfaceTapConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfaceTapConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfaceTapConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfaceTapConfigurationsDeleteFuture.Result. -func (future *InterfaceTapConfigurationsDeleteFuture) result(client InterfaceTapConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call. -type IPAddressAvailabilityResult struct { - autorest.Response `json:"-"` - // Available - Private IP address availability. - Available *bool `json:"available,omitempty"` - // AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken. - AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` -} - -// IPAllocation ipAllocation resource. -type IPAllocation struct { - autorest.Response `json:"-"` - // IPAllocationPropertiesFormat - Properties of the IpAllocation. - *IPAllocationPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IPAllocation. -func (ia IPAllocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ia.IPAllocationPropertiesFormat != nil { - objectMap["properties"] = ia.IPAllocationPropertiesFormat - } - if ia.ID != nil { - objectMap["id"] = ia.ID - } - if ia.Location != nil { - objectMap["location"] = ia.Location - } - if ia.Tags != nil { - objectMap["tags"] = ia.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPAllocation struct. -func (ia *IPAllocation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPAllocationPropertiesFormat IPAllocationPropertiesFormat - err = json.Unmarshal(*v, &IPAllocationPropertiesFormat) - if err != nil { - return err - } - ia.IPAllocationPropertiesFormat = &IPAllocationPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ia.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ia.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ia.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ia.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ia.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ia.Tags = tags - } - } - } - - return nil -} - -// IPAllocationListResult response for the ListIpAllocations API service call. -type IPAllocationListResult struct { - autorest.Response `json:"-"` - // Value - A list of IpAllocation resources. - Value *[]IPAllocation `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// IPAllocationListResultIterator provides access to a complete listing of IPAllocation values. -type IPAllocationListResultIterator struct { - i int - page IPAllocationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IPAllocationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IPAllocationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IPAllocationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IPAllocationListResultIterator) Response() IPAllocationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IPAllocationListResultIterator) Value() IPAllocation { - if !iter.page.NotDone() { - return IPAllocation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IPAllocationListResultIterator type. -func NewIPAllocationListResultIterator(page IPAllocationListResultPage) IPAllocationListResultIterator { - return IPAllocationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ialr IPAllocationListResult) IsEmpty() bool { - return ialr.Value == nil || len(*ialr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ialr IPAllocationListResult) hasNextLink() bool { - return ialr.NextLink != nil && len(*ialr.NextLink) != 0 -} - -// iPAllocationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ialr IPAllocationListResult) iPAllocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ialr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ialr.NextLink))) -} - -// IPAllocationListResultPage contains a page of IPAllocation values. -type IPAllocationListResultPage struct { - fn func(context.Context, IPAllocationListResult) (IPAllocationListResult, error) - ialr IPAllocationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IPAllocationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ialr) - if err != nil { - return err - } - page.ialr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IPAllocationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPAllocationListResultPage) NotDone() bool { - return !page.ialr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IPAllocationListResultPage) Response() IPAllocationListResult { - return page.ialr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IPAllocationListResultPage) Values() []IPAllocation { - if page.ialr.IsEmpty() { - return nil - } - return *page.ialr.Value -} - -// Creates a new instance of the IPAllocationListResultPage type. -func NewIPAllocationListResultPage(cur IPAllocationListResult, getNextPage func(context.Context, IPAllocationListResult) (IPAllocationListResult, error)) IPAllocationListResultPage { - return IPAllocationListResultPage{ - fn: getNextPage, - ialr: cur, - } -} - -// IPAllocationPropertiesFormat properties of the IpAllocation. -type IPAllocationPropertiesFormat struct { - // Subnet - READ-ONLY; The Subnet that using the prefix of this IpAllocation resource. - Subnet *SubResource `json:"subnet,omitempty"` - // VirtualNetwork - READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // Type - The type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' - Type IPAllocationType `json:"type,omitempty"` - // Prefix - The address prefix for the IpAllocation. - Prefix *string `json:"prefix,omitempty"` - // PrefixLength - The address prefix length for the IpAllocation. - PrefixLength *int32 `json:"prefixLength,omitempty"` - // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' - PrefixType IPVersion `json:"prefixType,omitempty"` - // IpamAllocationID - The IPAM allocation ID. - IpamAllocationID *string `json:"ipamAllocationId,omitempty"` - // AllocationTags - IpAllocation tags. - AllocationTags map[string]*string `json:"allocationTags"` -} - -// MarshalJSON is the custom marshaler for IPAllocationPropertiesFormat. -func (iapf IPAllocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iapf.Type != "" { - objectMap["type"] = iapf.Type - } - if iapf.Prefix != nil { - objectMap["prefix"] = iapf.Prefix - } - if iapf.PrefixLength != nil { - objectMap["prefixLength"] = iapf.PrefixLength - } - if iapf.PrefixType != "" { - objectMap["prefixType"] = iapf.PrefixType - } - if iapf.IpamAllocationID != nil { - objectMap["ipamAllocationId"] = iapf.IpamAllocationID - } - if iapf.AllocationTags != nil { - objectMap["allocationTags"] = iapf.AllocationTags - } - return json.Marshal(objectMap) -} - -// IPAllocationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type IPAllocationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPAllocationsClient) (IPAllocation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPAllocationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPAllocationsCreateOrUpdateFuture.Result. -func (future *IPAllocationsCreateOrUpdateFuture) result(client IPAllocationsClient) (ia IPAllocation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ia.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPAllocationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ia.Response.Response, err = future.GetResult(sender); err == nil && ia.Response.Response.StatusCode != http.StatusNoContent { - ia, err = client.CreateOrUpdateResponder(ia.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", ia.Response.Response, "Failure responding to request") - } - } - return -} - -// IPAllocationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPAllocationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPAllocationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPAllocationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPAllocationsDeleteFuture.Result. -func (future *IPAllocationsDeleteFuture) result(client IPAllocationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPAllocationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IPConfiguration IP configuration. -type IPConfiguration struct { - // IPConfigurationPropertiesFormat - Properties of the IP configuration. - *IPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfiguration. -func (ic IPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ic.IPConfigurationPropertiesFormat != nil { - objectMap["properties"] = ic.IPConfigurationPropertiesFormat - } - if ic.Name != nil { - objectMap["name"] = ic.Name - } - if ic.ID != nil { - objectMap["id"] = ic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. -func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) - if err != nil { - return err - } - ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ic.ID = &ID - } - } - } - - return nil -} - -// IPConfigurationBgpPeeringAddress properties of IPConfigurationBgpPeeringAddress. -type IPConfigurationBgpPeeringAddress struct { - // IpconfigurationID - The ID of IP configuration which belongs to gateway. - IpconfigurationID *string `json:"ipconfigurationId,omitempty"` - // DefaultBgpIPAddresses - READ-ONLY; The list of default BGP peering addresses which belong to IP configuration. - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - // CustomBgpIPAddresses - The list of custom BGP peering addresses which belong to IP configuration. - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - // TunnelIPAddresses - READ-ONLY; The list of tunnel public IP addresses which belong to IP configuration. - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationBgpPeeringAddress. -func (icbpa IPConfigurationBgpPeeringAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icbpa.IpconfigurationID != nil { - objectMap["ipconfigurationId"] = icbpa.IpconfigurationID - } - if icbpa.CustomBgpIPAddresses != nil { - objectMap["customBgpIpAddresses"] = icbpa.CustomBgpIPAddresses - } - return json.Marshal(objectMap) -} - -// IPConfigurationProfile IP configuration profile child resource. -type IPConfigurationProfile struct { - // IPConfigurationProfilePropertiesFormat - Properties of the IP configuration profile. - *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationProfile. -func (icp IPConfigurationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icp.IPConfigurationProfilePropertiesFormat != nil { - objectMap["properties"] = icp.IPConfigurationProfilePropertiesFormat - } - if icp.Name != nil { - objectMap["name"] = icp.Name - } - if icp.ID != nil { - objectMap["id"] = icp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPConfigurationProfile struct. -func (icp *IPConfigurationProfile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPConfigurationProfilePropertiesFormat IPConfigurationProfilePropertiesFormat - err = json.Unmarshal(*v, &IPConfigurationProfilePropertiesFormat) - if err != nil { - return err - } - icp.IPConfigurationProfilePropertiesFormat = &IPConfigurationProfilePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - icp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - icp.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - icp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - icp.ID = &ID - } - } - } - - return nil -} - -// IPConfigurationProfilePropertiesFormat IP configuration profile properties. -type IPConfigurationProfilePropertiesFormat struct { - // Subnet - The reference to the subnet resource to create a container network interface ip configuration. - Subnet *Subnet `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationProfilePropertiesFormat. -func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icppf.Subnet != nil { - objectMap["subnet"] = icppf.Subnet - } - return json.Marshal(objectMap) -} - -// IPConfigurationPropertiesFormat properties of IP configuration. -type IPConfigurationPropertiesFormat struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationPropertiesFormat. -func (icpf IPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = icpf.PrivateIPAddress - } - if icpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = icpf.PrivateIPAllocationMethod - } - if icpf.Subnet != nil { - objectMap["subnet"] = icpf.Subnet - } - if icpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = icpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// IPGroup the IpGroups resource information. -type IPGroup struct { - autorest.Response `json:"-"` - // IPGroupPropertiesFormat - Properties of the IpGroups. - *IPGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IPGroup. -func (ig IPGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ig.IPGroupPropertiesFormat != nil { - objectMap["properties"] = ig.IPGroupPropertiesFormat - } - if ig.ID != nil { - objectMap["id"] = ig.ID - } - if ig.Location != nil { - objectMap["location"] = ig.Location - } - if ig.Tags != nil { - objectMap["tags"] = ig.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPGroup struct. -func (ig *IPGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPGroupPropertiesFormat IPGroupPropertiesFormat - err = json.Unmarshal(*v, &IPGroupPropertiesFormat) - if err != nil { - return err - } - ig.IPGroupPropertiesFormat = &IPGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ig.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ig.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ig.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ig.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ig.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ig.Tags = tags - } - } - } - - return nil -} - -// IPGroupListResult response for the ListIpGroups API service call. -type IPGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of IpGroups information resources. - Value *[]IPGroup `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// IPGroupListResultIterator provides access to a complete listing of IPGroup values. -type IPGroupListResultIterator struct { - i int - page IPGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IPGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IPGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IPGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IPGroupListResultIterator) Response() IPGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IPGroupListResultIterator) Value() IPGroup { - if !iter.page.NotDone() { - return IPGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IPGroupListResultIterator type. -func NewIPGroupListResultIterator(page IPGroupListResultPage) IPGroupListResultIterator { - return IPGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (iglr IPGroupListResult) IsEmpty() bool { - return iglr.Value == nil || len(*iglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (iglr IPGroupListResult) hasNextLink() bool { - return iglr.NextLink != nil && len(*iglr.NextLink) != 0 -} - -// iPGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (iglr IPGroupListResult) iPGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !iglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(iglr.NextLink))) -} - -// IPGroupListResultPage contains a page of IPGroup values. -type IPGroupListResultPage struct { - fn func(context.Context, IPGroupListResult) (IPGroupListResult, error) - iglr IPGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IPGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.iglr) - if err != nil { - return err - } - page.iglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IPGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPGroupListResultPage) NotDone() bool { - return !page.iglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IPGroupListResultPage) Response() IPGroupListResult { - return page.iglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IPGroupListResultPage) Values() []IPGroup { - if page.iglr.IsEmpty() { - return nil - } - return *page.iglr.Value -} - -// Creates a new instance of the IPGroupListResultPage type. -func NewIPGroupListResultPage(cur IPGroupListResult, getNextPage func(context.Context, IPGroupListResult) (IPGroupListResult, error)) IPGroupListResultPage { - return IPGroupListResultPage{ - fn: getNextPage, - iglr: cur, - } -} - -// IPGroupPropertiesFormat the IpGroups property information. -type IPGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the IpGroups resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // IPAddresses - IpAddresses/IpAddressPrefixes in the IpGroups resource. - IPAddresses *[]string `json:"ipAddresses,omitempty"` - // Firewalls - READ-ONLY; List of references to Azure resources that this IpGroups is associated with. - Firewalls *[]SubResource `json:"firewalls,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPGroupPropertiesFormat. -func (igpf IPGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if igpf.IPAddresses != nil { - objectMap["ipAddresses"] = igpf.IPAddresses - } - return json.Marshal(objectMap) -} - -// IPGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPGroupsClient) (IPGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPGroupsCreateOrUpdateFuture.Result. -func (future *IPGroupsCreateOrUpdateFuture) result(client IPGroupsClient) (ig IPGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ig.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ig.Response.Response, err = future.GetResult(sender); err == nil && ig.Response.Response.StatusCode != http.StatusNoContent { - ig, err = client.CreateOrUpdateResponder(ig.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", ig.Response.Response, "Failure responding to request") - } - } - return -} - -// IPGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPGroupsDeleteFuture.Result. -func (future *IPGroupsDeleteFuture) result(client IPGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IpsecPolicy an IPSec Policy configuration for a virtual network gateway connection. -type IpsecPolicy struct { - // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` - // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' - IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` - // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' - IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` - // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' - IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` - // DhGroup - The DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - DhGroup DhGroup `json:"dhGroup,omitempty"` - // PfsGroup - The Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' - PfsGroup PfsGroup `json:"pfsGroup,omitempty"` -} - -// IPTag contains the IpTag associated with the object. -type IPTag struct { - // IPTagType - The IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - The value of the IP tag associated with the public IP. Example: SQL. - Tag *string `json:"tag,omitempty"` -} - -// Ipv6CircuitConnectionConfig iPv6 Circuit Connection properties for global reach. -type Ipv6CircuitConnectionConfig struct { - // AddressPrefix - /125 IP address space to carve out customer addresses for global reach. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for Ipv6CircuitConnectionConfig. -func (i6ccc Ipv6CircuitConnectionConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i6ccc.AddressPrefix != nil { - objectMap["addressPrefix"] = i6ccc.AddressPrefix - } - return json.Marshal(objectMap) -} - -// Ipv6ExpressRouteCircuitPeeringConfig contains IPv6 peering config. -type Ipv6ExpressRouteCircuitPeeringConfig struct { - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // RouteFilter - The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - // State - The state of peering. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' - State ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} - -// ListHubRouteTablesResult list of RouteTables and a URL nextLink to get the next set of results. -type ListHubRouteTablesResult struct { - autorest.Response `json:"-"` - // Value - List of RouteTables. - Value *[]HubRouteTable `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListHubRouteTablesResultIterator provides access to a complete listing of HubRouteTable values. -type ListHubRouteTablesResultIterator struct { - i int - page ListHubRouteTablesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListHubRouteTablesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListHubRouteTablesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListHubRouteTablesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListHubRouteTablesResultIterator) Response() ListHubRouteTablesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListHubRouteTablesResultIterator) Value() HubRouteTable { - if !iter.page.NotDone() { - return HubRouteTable{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListHubRouteTablesResultIterator type. -func NewListHubRouteTablesResultIterator(page ListHubRouteTablesResultPage) ListHubRouteTablesResultIterator { - return ListHubRouteTablesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lhrtr ListHubRouteTablesResult) IsEmpty() bool { - return lhrtr.Value == nil || len(*lhrtr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lhrtr ListHubRouteTablesResult) hasNextLink() bool { - return lhrtr.NextLink != nil && len(*lhrtr.NextLink) != 0 -} - -// listHubRouteTablesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lhrtr ListHubRouteTablesResult) listHubRouteTablesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lhrtr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lhrtr.NextLink))) -} - -// ListHubRouteTablesResultPage contains a page of HubRouteTable values. -type ListHubRouteTablesResultPage struct { - fn func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error) - lhrtr ListHubRouteTablesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListHubRouteTablesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lhrtr) - if err != nil { - return err - } - page.lhrtr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListHubRouteTablesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListHubRouteTablesResultPage) NotDone() bool { - return !page.lhrtr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListHubRouteTablesResultPage) Response() ListHubRouteTablesResult { - return page.lhrtr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListHubRouteTablesResultPage) Values() []HubRouteTable { - if page.lhrtr.IsEmpty() { - return nil - } - return *page.lhrtr.Value -} - -// Creates a new instance of the ListHubRouteTablesResultPage type. -func NewListHubRouteTablesResultPage(cur ListHubRouteTablesResult, getNextPage func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error)) ListHubRouteTablesResultPage { - return ListHubRouteTablesResultPage{ - fn: getNextPage, - lhrtr: cur, - } -} - -// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get -// the next set of results. -type ListHubVirtualNetworkConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of HubVirtualNetworkConnections. - Value *[]HubVirtualNetworkConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListHubVirtualNetworkConnectionsResultIterator provides access to a complete listing of -// HubVirtualNetworkConnection values. -type ListHubVirtualNetworkConnectionsResultIterator struct { - i int - page ListHubVirtualNetworkConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListHubVirtualNetworkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListHubVirtualNetworkConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListHubVirtualNetworkConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListHubVirtualNetworkConnectionsResultIterator) Response() ListHubVirtualNetworkConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListHubVirtualNetworkConnectionsResultIterator) Value() HubVirtualNetworkConnection { - if !iter.page.NotDone() { - return HubVirtualNetworkConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListHubVirtualNetworkConnectionsResultIterator type. -func NewListHubVirtualNetworkConnectionsResultIterator(page ListHubVirtualNetworkConnectionsResultPage) ListHubVirtualNetworkConnectionsResultIterator { - return ListHubVirtualNetworkConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { - return lhvncr.Value == nil || len(*lhvncr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool { - return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0 -} - -// listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lhvncr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lhvncr.NextLink))) -} - -// ListHubVirtualNetworkConnectionsResultPage contains a page of HubVirtualNetworkConnection values. -type ListHubVirtualNetworkConnectionsResultPage struct { - fn func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error) - lhvncr ListHubVirtualNetworkConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lhvncr) - if err != nil { - return err - } - page.lhvncr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListHubVirtualNetworkConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListHubVirtualNetworkConnectionsResultPage) NotDone() bool { - return !page.lhvncr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListHubVirtualNetworkConnectionsResultPage) Response() ListHubVirtualNetworkConnectionsResult { - return page.lhvncr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetworkConnection { - if page.lhvncr.IsEmpty() { - return nil - } - return *page.lhvncr.Value -} - -// Creates a new instance of the ListHubVirtualNetworkConnectionsResultPage type. -func NewListHubVirtualNetworkConnectionsResultPage(cur ListHubVirtualNetworkConnectionsResult, getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage { - return ListHubVirtualNetworkConnectionsResultPage{ - fn: getNextPage, - lhvncr: cur, - } -} - -// ListP2SVpnGatewaysResult result of the request to list P2SVpnGateways. It contains a list of -// P2SVpnGateways and a URL nextLink to get the next set of results. -type ListP2SVpnGatewaysResult struct { - autorest.Response `json:"-"` - // Value - List of P2SVpnGateways. - Value *[]P2SVpnGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListP2SVpnGatewaysResultIterator provides access to a complete listing of P2SVpnGateway values. -type ListP2SVpnGatewaysResultIterator struct { - i int - page ListP2SVpnGatewaysResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListP2SVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListP2SVpnGatewaysResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListP2SVpnGatewaysResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListP2SVpnGatewaysResultIterator) Response() ListP2SVpnGatewaysResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListP2SVpnGatewaysResultIterator) Value() P2SVpnGateway { - if !iter.page.NotDone() { - return P2SVpnGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListP2SVpnGatewaysResultIterator type. -func NewListP2SVpnGatewaysResultIterator(page ListP2SVpnGatewaysResultPage) ListP2SVpnGatewaysResultIterator { - return ListP2SVpnGatewaysResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lpvgr ListP2SVpnGatewaysResult) IsEmpty() bool { - return lpvgr.Value == nil || len(*lpvgr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lpvgr ListP2SVpnGatewaysResult) hasNextLink() bool { - return lpvgr.NextLink != nil && len(*lpvgr.NextLink) != 0 -} - -// listP2SVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lpvgr ListP2SVpnGatewaysResult) listP2SVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if !lpvgr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lpvgr.NextLink))) -} - -// ListP2SVpnGatewaysResultPage contains a page of P2SVpnGateway values. -type ListP2SVpnGatewaysResultPage struct { - fn func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error) - lpvgr ListP2SVpnGatewaysResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListP2SVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lpvgr) - if err != nil { - return err - } - page.lpvgr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListP2SVpnGatewaysResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListP2SVpnGatewaysResultPage) NotDone() bool { - return !page.lpvgr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListP2SVpnGatewaysResultPage) Response() ListP2SVpnGatewaysResult { - return page.lpvgr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListP2SVpnGatewaysResultPage) Values() []P2SVpnGateway { - if page.lpvgr.IsEmpty() { - return nil - } - return *page.lpvgr.Value -} - -// Creates a new instance of the ListP2SVpnGatewaysResultPage type. -func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)) ListP2SVpnGatewaysResultPage { - return ListP2SVpnGatewaysResultPage{ - fn: getNextPage, - lpvgr: cur, - } -} - -// ListString ... -type ListString struct { - autorest.Response `json:"-"` - Value *[]string `json:"value,omitempty"` -} - -// ListVirtualHubBgpConnectionResults virtualHubBgpConnections list. -type ListVirtualHubBgpConnectionResults struct { - autorest.Response `json:"-"` - // Value - The list of VirtualHubBgpConnections. - Value *[]BgpConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubBgpConnectionResultsIterator provides access to a complete listing of BgpConnection -// values. -type ListVirtualHubBgpConnectionResultsIterator struct { - i int - page ListVirtualHubBgpConnectionResultsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubBgpConnectionResultsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubBgpConnectionResultsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubBgpConnectionResultsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubBgpConnectionResultsIterator) Response() ListVirtualHubBgpConnectionResults { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubBgpConnectionResultsIterator) Value() BgpConnection { - if !iter.page.NotDone() { - return BgpConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubBgpConnectionResultsIterator type. -func NewListVirtualHubBgpConnectionResultsIterator(page ListVirtualHubBgpConnectionResultsPage) ListVirtualHubBgpConnectionResultsIterator { - return ListVirtualHubBgpConnectionResultsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhbcr ListVirtualHubBgpConnectionResults) IsEmpty() bool { - return lvhbcr.Value == nil || len(*lvhbcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhbcr ListVirtualHubBgpConnectionResults) hasNextLink() bool { - return lvhbcr.NextLink != nil && len(*lvhbcr.NextLink) != 0 -} - -// listVirtualHubBgpConnectionResultsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhbcr ListVirtualHubBgpConnectionResults) listVirtualHubBgpConnectionResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhbcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhbcr.NextLink))) -} - -// ListVirtualHubBgpConnectionResultsPage contains a page of BgpConnection values. -type ListVirtualHubBgpConnectionResultsPage struct { - fn func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error) - lvhbcr ListVirtualHubBgpConnectionResults -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhbcr) - if err != nil { - return err - } - page.lvhbcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubBgpConnectionResultsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubBgpConnectionResultsPage) NotDone() bool { - return !page.lvhbcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubBgpConnectionResultsPage) Response() ListVirtualHubBgpConnectionResults { - return page.lvhbcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubBgpConnectionResultsPage) Values() []BgpConnection { - if page.lvhbcr.IsEmpty() { - return nil - } - return *page.lvhbcr.Value -} - -// Creates a new instance of the ListVirtualHubBgpConnectionResultsPage type. -func NewListVirtualHubBgpConnectionResultsPage(cur ListVirtualHubBgpConnectionResults, getNextPage func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error)) ListVirtualHubBgpConnectionResultsPage { - return ListVirtualHubBgpConnectionResultsPage{ - fn: getNextPage, - lvhbcr: cur, - } -} - -// ListVirtualHubIPConfigurationResults virtualHubIpConfigurations list. -type ListVirtualHubIPConfigurationResults struct { - autorest.Response `json:"-"` - // Value - The list of VirtualHubIpConfigurations. - Value *[]HubIPConfiguration `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubIPConfigurationResultsIterator provides access to a complete listing of HubIPConfiguration -// values. -type ListVirtualHubIPConfigurationResultsIterator struct { - i int - page ListVirtualHubIPConfigurationResultsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubIPConfigurationResultsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubIPConfigurationResultsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubIPConfigurationResultsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubIPConfigurationResultsIterator) Response() ListVirtualHubIPConfigurationResults { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubIPConfigurationResultsIterator) Value() HubIPConfiguration { - if !iter.page.NotDone() { - return HubIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubIPConfigurationResultsIterator type. -func NewListVirtualHubIPConfigurationResultsIterator(page ListVirtualHubIPConfigurationResultsPage) ListVirtualHubIPConfigurationResultsIterator { - return ListVirtualHubIPConfigurationResultsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhicr ListVirtualHubIPConfigurationResults) IsEmpty() bool { - return lvhicr.Value == nil || len(*lvhicr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhicr ListVirtualHubIPConfigurationResults) hasNextLink() bool { - return lvhicr.NextLink != nil && len(*lvhicr.NextLink) != 0 -} - -// listVirtualHubIPConfigurationResultsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhicr ListVirtualHubIPConfigurationResults) listVirtualHubIPConfigurationResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhicr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhicr.NextLink))) -} - -// ListVirtualHubIPConfigurationResultsPage contains a page of HubIPConfiguration values. -type ListVirtualHubIPConfigurationResultsPage struct { - fn func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error) - lvhicr ListVirtualHubIPConfigurationResults -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhicr) - if err != nil { - return err - } - page.lvhicr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubIPConfigurationResultsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubIPConfigurationResultsPage) NotDone() bool { - return !page.lvhicr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubIPConfigurationResultsPage) Response() ListVirtualHubIPConfigurationResults { - return page.lvhicr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubIPConfigurationResultsPage) Values() []HubIPConfiguration { - if page.lvhicr.IsEmpty() { - return nil - } - return *page.lvhicr.Value -} - -// Creates a new instance of the ListVirtualHubIPConfigurationResultsPage type. -func NewListVirtualHubIPConfigurationResultsPage(cur ListVirtualHubIPConfigurationResults, getNextPage func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error)) ListVirtualHubIPConfigurationResultsPage { - return ListVirtualHubIPConfigurationResultsPage{ - fn: getNextPage, - lvhicr: cur, - } -} - -// ListVirtualHubRouteTableV2sResult list of VirtualHubRouteTableV2s and a URL nextLink to get the next set -// of results. -type ListVirtualHubRouteTableV2sResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualHubRouteTableV2s. - Value *[]VirtualHubRouteTableV2 `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubRouteTableV2sResultIterator provides access to a complete listing of -// VirtualHubRouteTableV2 values. -type ListVirtualHubRouteTableV2sResultIterator struct { - i int - page ListVirtualHubRouteTableV2sResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubRouteTableV2sResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubRouteTableV2sResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubRouteTableV2sResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubRouteTableV2sResultIterator) Response() ListVirtualHubRouteTableV2sResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubRouteTableV2sResultIterator) Value() VirtualHubRouteTableV2 { - if !iter.page.NotDone() { - return VirtualHubRouteTableV2{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubRouteTableV2sResultIterator type. -func NewListVirtualHubRouteTableV2sResultIterator(page ListVirtualHubRouteTableV2sResultPage) ListVirtualHubRouteTableV2sResultIterator { - return ListVirtualHubRouteTableV2sResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) IsEmpty() bool { - return lvhrtvr.Value == nil || len(*lvhrtvr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) hasNextLink() bool { - return lvhrtvr.NextLink != nil && len(*lvhrtvr.NextLink) != 0 -} - -// listVirtualHubRouteTableV2sResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) listVirtualHubRouteTableV2sResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvhrtvr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhrtvr.NextLink))) -} - -// ListVirtualHubRouteTableV2sResultPage contains a page of VirtualHubRouteTableV2 values. -type ListVirtualHubRouteTableV2sResultPage struct { - fn func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error) - lvhrtvr ListVirtualHubRouteTableV2sResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubRouteTableV2sResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhrtvr) - if err != nil { - return err - } - page.lvhrtvr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubRouteTableV2sResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubRouteTableV2sResultPage) NotDone() bool { - return !page.lvhrtvr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubRouteTableV2sResultPage) Response() ListVirtualHubRouteTableV2sResult { - return page.lvhrtvr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubRouteTableV2sResultPage) Values() []VirtualHubRouteTableV2 { - if page.lvhrtvr.IsEmpty() { - return nil - } - return *page.lvhrtvr.Value -} - -// Creates a new instance of the ListVirtualHubRouteTableV2sResultPage type. -func NewListVirtualHubRouteTableV2sResultPage(cur ListVirtualHubRouteTableV2sResult, getNextPage func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error)) ListVirtualHubRouteTableV2sResultPage { - return ListVirtualHubRouteTableV2sResultPage{ - fn: getNextPage, - lvhrtvr: cur, - } -} - -// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a -// URL nextLink to get the next set of results. -type ListVirtualHubsResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualHubs. - Value *[]VirtualHub `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubsResultIterator provides access to a complete listing of VirtualHub values. -type ListVirtualHubsResultIterator struct { - i int - page ListVirtualHubsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubsResultIterator) Response() ListVirtualHubsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubsResultIterator) Value() VirtualHub { - if !iter.page.NotDone() { - return VirtualHub{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubsResultIterator type. -func NewListVirtualHubsResultIterator(page ListVirtualHubsResultPage) ListVirtualHubsResultIterator { - return ListVirtualHubsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhr ListVirtualHubsResult) IsEmpty() bool { - return lvhr.Value == nil || len(*lvhr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhr ListVirtualHubsResult) hasNextLink() bool { - return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0 -} - -// listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvhr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhr.NextLink))) -} - -// ListVirtualHubsResultPage contains a page of VirtualHub values. -type ListVirtualHubsResultPage struct { - fn func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error) - lvhr ListVirtualHubsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhr) - if err != nil { - return err - } - page.lvhr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubsResultPage) NotDone() bool { - return !page.lvhr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubsResultPage) Response() ListVirtualHubsResult { - return page.lvhr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubsResultPage) Values() []VirtualHub { - if page.lvhr.IsEmpty() { - return nil - } - return *page.lvhr.Value -} - -// Creates a new instance of the ListVirtualHubsResultPage type. -func NewListVirtualHubsResultPage(cur ListVirtualHubsResult, getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage { - return ListVirtualHubsResultPage{ - fn: getNextPage, - lvhr: cur, - } -} - -// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a -// URL nextLink to get the next set of results. -type ListVirtualWANsResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualWANs. - Value *[]VirtualWAN `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualWANsResultIterator provides access to a complete listing of VirtualWAN values. -type ListVirtualWANsResultIterator struct { - i int - page ListVirtualWANsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualWANsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualWANsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualWANsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualWANsResultIterator) Response() ListVirtualWANsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualWANsResultIterator) Value() VirtualWAN { - if !iter.page.NotDone() { - return VirtualWAN{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualWANsResultIterator type. -func NewListVirtualWANsResultIterator(page ListVirtualWANsResultPage) ListVirtualWANsResultIterator { - return ListVirtualWANsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvwnr ListVirtualWANsResult) IsEmpty() bool { - return lvwnr.Value == nil || len(*lvwnr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvwnr ListVirtualWANsResult) hasNextLink() bool { - return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0 -} - -// listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvwnr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvwnr.NextLink))) -} - -// ListVirtualWANsResultPage contains a page of VirtualWAN values. -type ListVirtualWANsResultPage struct { - fn func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error) - lvwnr ListVirtualWANsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvwnr) - if err != nil { - return err - } - page.lvwnr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualWANsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualWANsResultPage) NotDone() bool { - return !page.lvwnr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualWANsResultPage) Response() ListVirtualWANsResult { - return page.lvwnr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualWANsResultPage) Values() []VirtualWAN { - if page.lvwnr.IsEmpty() { - return nil - } - return *page.lvwnr.Value -} - -// Creates a new instance of the ListVirtualWANsResultPage type. -func NewListVirtualWANsResultPage(cur ListVirtualWANsResult, getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage { - return ListVirtualWANsResultPage{ - fn: getNextPage, - lvwnr: cur, - } -} - -// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. -// It contains a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVpnConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of Vpn Connections. - Value *[]VpnConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnConnectionsResultIterator provides access to a complete listing of VpnConnection values. -type ListVpnConnectionsResultIterator struct { - i int - page ListVpnConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnConnectionsResultIterator) Response() ListVpnConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnConnectionsResultIterator) Value() VpnConnection { - if !iter.page.NotDone() { - return VpnConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnConnectionsResultIterator type. -func NewListVpnConnectionsResultIterator(page ListVpnConnectionsResultPage) ListVpnConnectionsResultIterator { - return ListVpnConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvcr ListVpnConnectionsResult) IsEmpty() bool { - return lvcr.Value == nil || len(*lvcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvcr ListVpnConnectionsResult) hasNextLink() bool { - return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0 -} - -// listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvcr.NextLink))) -} - -// ListVpnConnectionsResultPage contains a page of VpnConnection values. -type ListVpnConnectionsResultPage struct { - fn func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error) - lvcr ListVpnConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvcr) - if err != nil { - return err - } - page.lvcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnConnectionsResultPage) NotDone() bool { - return !page.lvcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnConnectionsResultPage) Response() ListVpnConnectionsResult { - return page.lvcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnConnectionsResultPage) Values() []VpnConnection { - if page.lvcr.IsEmpty() { - return nil - } - return *page.lvcr.Value -} - -// Creates a new instance of the ListVpnConnectionsResultPage type. -func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage { - return ListVpnConnectionsResultPage{ - fn: getNextPage, - lvcr: cur, - } -} - -// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a -// URL nextLink to get the next set of results. -type ListVpnGatewaysResult struct { - autorest.Response `json:"-"` - // Value - List of VpnGateways. - Value *[]VpnGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnGatewaysResultIterator provides access to a complete listing of VpnGateway values. -type ListVpnGatewaysResultIterator struct { - i int - page ListVpnGatewaysResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnGatewaysResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnGatewaysResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnGatewaysResultIterator) Response() ListVpnGatewaysResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnGatewaysResultIterator) Value() VpnGateway { - if !iter.page.NotDone() { - return VpnGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnGatewaysResultIterator type. -func NewListVpnGatewaysResultIterator(page ListVpnGatewaysResultPage) ListVpnGatewaysResultIterator { - return ListVpnGatewaysResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvgr ListVpnGatewaysResult) IsEmpty() bool { - return lvgr.Value == nil || len(*lvgr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvgr ListVpnGatewaysResult) hasNextLink() bool { - return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0 -} - -// listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvgr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvgr.NextLink))) -} - -// ListVpnGatewaysResultPage contains a page of VpnGateway values. -type ListVpnGatewaysResultPage struct { - fn func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error) - lvgr ListVpnGatewaysResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvgr) - if err != nil { - return err - } - page.lvgr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnGatewaysResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnGatewaysResultPage) NotDone() bool { - return !page.lvgr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnGatewaysResultPage) Response() ListVpnGatewaysResult { - return page.lvgr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnGatewaysResultPage) Values() []VpnGateway { - if page.lvgr.IsEmpty() { - return nil - } - return *page.lvgr.Value -} - -// Creates a new instance of the ListVpnGatewaysResultPage type. -func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage { - return ListVpnGatewaysResultPage{ - fn: getNextPage, - lvgr: cur, - } -} - -// ListVpnServerConfigurationsResult result of the request to list all VpnServerConfigurations. It contains -// a list of VpnServerConfigurations and a URL nextLink to get the next set of results. -type ListVpnServerConfigurationsResult struct { - autorest.Response `json:"-"` - // Value - List of VpnServerConfigurations. - Value *[]VpnServerConfiguration `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnServerConfigurationsResultIterator provides access to a complete listing of -// VpnServerConfiguration values. -type ListVpnServerConfigurationsResultIterator struct { - i int - page ListVpnServerConfigurationsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnServerConfigurationsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnServerConfigurationsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnServerConfigurationsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnServerConfigurationsResultIterator) Response() ListVpnServerConfigurationsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnServerConfigurationsResultIterator) Value() VpnServerConfiguration { - if !iter.page.NotDone() { - return VpnServerConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnServerConfigurationsResultIterator type. -func NewListVpnServerConfigurationsResultIterator(page ListVpnServerConfigurationsResultPage) ListVpnServerConfigurationsResultIterator { - return ListVpnServerConfigurationsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvscr ListVpnServerConfigurationsResult) IsEmpty() bool { - return lvscr.Value == nil || len(*lvscr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvscr ListVpnServerConfigurationsResult) hasNextLink() bool { - return lvscr.NextLink != nil && len(*lvscr.NextLink) != 0 -} - -// listVpnServerConfigurationsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvscr ListVpnServerConfigurationsResult) listVpnServerConfigurationsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvscr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvscr.NextLink))) -} - -// ListVpnServerConfigurationsResultPage contains a page of VpnServerConfiguration values. -type ListVpnServerConfigurationsResultPage struct { - fn func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error) - lvscr ListVpnServerConfigurationsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnServerConfigurationsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvscr) - if err != nil { - return err - } - page.lvscr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnServerConfigurationsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnServerConfigurationsResultPage) NotDone() bool { - return !page.lvscr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnServerConfigurationsResultPage) Response() ListVpnServerConfigurationsResult { - return page.lvscr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnServerConfigurationsResultPage) Values() []VpnServerConfiguration { - if page.lvscr.IsEmpty() { - return nil - } - return *page.lvscr.Value -} - -// Creates a new instance of the ListVpnServerConfigurationsResultPage type. -func NewListVpnServerConfigurationsResultPage(cur ListVpnServerConfigurationsResult, getNextPage func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error)) ListVpnServerConfigurationsResultPage { - return ListVpnServerConfigurationsResultPage{ - fn: getNextPage, - lvscr: cur, - } -} - -// ListVpnSiteLinkConnectionsResult result of the request to list all vpn connections to a virtual wan vpn -// gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVpnSiteLinkConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSiteLinkConnections. - Value *[]VpnSiteLinkConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSiteLinkConnectionsResultIterator provides access to a complete listing of VpnSiteLinkConnection -// values. -type ListVpnSiteLinkConnectionsResultIterator struct { - i int - page ListVpnSiteLinkConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSiteLinkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSiteLinkConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSiteLinkConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSiteLinkConnectionsResultIterator) Response() ListVpnSiteLinkConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSiteLinkConnectionsResultIterator) Value() VpnSiteLinkConnection { - if !iter.page.NotDone() { - return VpnSiteLinkConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSiteLinkConnectionsResultIterator type. -func NewListVpnSiteLinkConnectionsResultIterator(page ListVpnSiteLinkConnectionsResultPage) ListVpnSiteLinkConnectionsResultIterator { - return ListVpnSiteLinkConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvslcr ListVpnSiteLinkConnectionsResult) IsEmpty() bool { - return lvslcr.Value == nil || len(*lvslcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvslcr ListVpnSiteLinkConnectionsResult) hasNextLink() bool { - return lvslcr.NextLink != nil && len(*lvslcr.NextLink) != 0 -} - -// listVpnSiteLinkConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvslcr ListVpnSiteLinkConnectionsResult) listVpnSiteLinkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvslcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvslcr.NextLink))) -} - -// ListVpnSiteLinkConnectionsResultPage contains a page of VpnSiteLinkConnection values. -type ListVpnSiteLinkConnectionsResultPage struct { - fn func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error) - lvslcr ListVpnSiteLinkConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSiteLinkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvslcr) - if err != nil { - return err - } - page.lvslcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSiteLinkConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSiteLinkConnectionsResultPage) NotDone() bool { - return !page.lvslcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSiteLinkConnectionsResultPage) Response() ListVpnSiteLinkConnectionsResult { - return page.lvslcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSiteLinkConnectionsResultPage) Values() []VpnSiteLinkConnection { - if page.lvslcr.IsEmpty() { - return nil - } - return *page.lvslcr.Value -} - -// Creates a new instance of the ListVpnSiteLinkConnectionsResultPage type. -func NewListVpnSiteLinkConnectionsResultPage(cur ListVpnSiteLinkConnectionsResult, getNextPage func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)) ListVpnSiteLinkConnectionsResultPage { - return ListVpnSiteLinkConnectionsResultPage{ - fn: getNextPage, - lvslcr: cur, - } -} - -// ListVpnSiteLinksResult result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks -// and a URL nextLink to get the next set of results. -type ListVpnSiteLinksResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSitesLinks. - Value *[]VpnSiteLink `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSiteLinksResultIterator provides access to a complete listing of VpnSiteLink values. -type ListVpnSiteLinksResultIterator struct { - i int - page ListVpnSiteLinksResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSiteLinksResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSiteLinksResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSiteLinksResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSiteLinksResultIterator) Response() ListVpnSiteLinksResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSiteLinksResultIterator) Value() VpnSiteLink { - if !iter.page.NotDone() { - return VpnSiteLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSiteLinksResultIterator type. -func NewListVpnSiteLinksResultIterator(page ListVpnSiteLinksResultPage) ListVpnSiteLinksResultIterator { - return ListVpnSiteLinksResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvslr ListVpnSiteLinksResult) IsEmpty() bool { - return lvslr.Value == nil || len(*lvslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvslr ListVpnSiteLinksResult) hasNextLink() bool { - return lvslr.NextLink != nil && len(*lvslr.NextLink) != 0 -} - -// listVpnSiteLinksResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvslr ListVpnSiteLinksResult) listVpnSiteLinksResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvslr.NextLink))) -} - -// ListVpnSiteLinksResultPage contains a page of VpnSiteLink values. -type ListVpnSiteLinksResultPage struct { - fn func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error) - lvslr ListVpnSiteLinksResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSiteLinksResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvslr) - if err != nil { - return err - } - page.lvslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSiteLinksResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSiteLinksResultPage) NotDone() bool { - return !page.lvslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSiteLinksResultPage) Response() ListVpnSiteLinksResult { - return page.lvslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSiteLinksResultPage) Values() []VpnSiteLink { - if page.lvslr.IsEmpty() { - return nil - } - return *page.lvslr.Value -} - -// Creates a new instance of the ListVpnSiteLinksResultPage type. -func NewListVpnSiteLinksResultPage(cur ListVpnSiteLinksResult, getNextPage func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)) ListVpnSiteLinksResultPage { - return ListVpnSiteLinksResultPage{ - fn: getNextPage, - lvslr: cur, - } -} - -// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL -// nextLink to get the next set of results. -type ListVpnSitesResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSites. - Value *[]VpnSite `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSitesResultIterator provides access to a complete listing of VpnSite values. -type ListVpnSitesResultIterator struct { - i int - page ListVpnSitesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSitesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSitesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSitesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSitesResultIterator) Response() ListVpnSitesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSitesResultIterator) Value() VpnSite { - if !iter.page.NotDone() { - return VpnSite{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSitesResultIterator type. -func NewListVpnSitesResultIterator(page ListVpnSitesResultPage) ListVpnSitesResultIterator { - return ListVpnSitesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvsr ListVpnSitesResult) IsEmpty() bool { - return lvsr.Value == nil || len(*lvsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvsr ListVpnSitesResult) hasNextLink() bool { - return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0 -} - -// listVpnSitesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvsr.NextLink))) -} - -// ListVpnSitesResultPage contains a page of VpnSite values. -type ListVpnSitesResultPage struct { - fn func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error) - lvsr ListVpnSitesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvsr) - if err != nil { - return err - } - page.lvsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSitesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSitesResultPage) NotDone() bool { - return !page.lvsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSitesResultPage) Response() ListVpnSitesResult { - return page.lvsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSitesResultPage) Values() []VpnSite { - if page.lvsr.IsEmpty() { - return nil - } - return *page.lvsr.Value -} - -// Creates a new instance of the ListVpnSitesResultPage type. -func NewListVpnSitesResultPage(cur ListVpnSitesResult, getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage { - return ListVpnSitesResultPage{ - fn: getNextPage, - lvsr: cur, - } -} - -// LoadBalancer loadBalancer resource. -type LoadBalancer struct { - autorest.Response `json:"-"` - // Sku - The load balancer SKU. - Sku *LoadBalancerSku `json:"sku,omitempty"` - // LoadBalancerPropertiesFormat - Properties of load balancer. - *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for LoadBalancer. -func (lb LoadBalancer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lb.Sku != nil { - objectMap["sku"] = lb.Sku - } - if lb.LoadBalancerPropertiesFormat != nil { - objectMap["properties"] = lb.LoadBalancerPropertiesFormat - } - if lb.ID != nil { - objectMap["id"] = lb.ID - } - if lb.Location != nil { - objectMap["location"] = lb.Location - } - if lb.Tags != nil { - objectMap["tags"] = lb.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. -func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku LoadBalancerSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - lb.Sku = &sku - } - case "properties": - if v != nil { - var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat - err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) - if err != nil { - return err - } - lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lb.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lb.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lb.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lb.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - lb.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - lb.Tags = tags - } - } - } - - return nil -} - -// LoadBalancerBackendAddress load balancer backend addresses. -type LoadBalancerBackendAddress struct { - // LoadBalancerBackendAddressPropertiesFormat - Properties of load balancer backend address pool. - *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend address. - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddress. -func (lbba LoadBalancerBackendAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbba.LoadBalancerBackendAddressPropertiesFormat != nil { - objectMap["properties"] = lbba.LoadBalancerBackendAddressPropertiesFormat - } - if lbba.Name != nil { - objectMap["name"] = lbba.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancerBackendAddress struct. -func (lbba *LoadBalancerBackendAddress) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var loadBalancerBackendAddressPropertiesFormat LoadBalancerBackendAddressPropertiesFormat - err = json.Unmarshal(*v, &loadBalancerBackendAddressPropertiesFormat) - if err != nil { - return err - } - lbba.LoadBalancerBackendAddressPropertiesFormat = &loadBalancerBackendAddressPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lbba.Name = &name - } - } - } - - return nil -} - -// LoadBalancerBackendAddressPoolListResult response for ListBackendAddressPool API service call. -type LoadBalancerBackendAddressPoolListResult struct { - autorest.Response `json:"-"` - // Value - A list of backend address pools in a load balancer. - Value *[]BackendAddressPool `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPoolListResult. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbbaplr.Value != nil { - objectMap["value"] = lbbaplr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of -// BackendAddressPool values. -type LoadBalancerBackendAddressPoolListResultIterator struct { - i int - page LoadBalancerBackendAddressPoolListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerBackendAddressPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerBackendAddressPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerBackendAddressPoolListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerBackendAddressPoolListResultIterator) Response() LoadBalancerBackendAddressPoolListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerBackendAddressPoolListResultIterator) Value() BackendAddressPool { - if !iter.page.NotDone() { - return BackendAddressPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerBackendAddressPoolListResultIterator type. -func NewLoadBalancerBackendAddressPoolListResultIterator(page LoadBalancerBackendAddressPoolListResultPage) LoadBalancerBackendAddressPoolListResultIterator { - return LoadBalancerBackendAddressPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool { - return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool { - return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0 -} - -// loadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbbaplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbbaplr.NextLink))) -} - -// LoadBalancerBackendAddressPoolListResultPage contains a page of BackendAddressPool values. -type LoadBalancerBackendAddressPoolListResultPage struct { - fn func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error) - lbbaplr LoadBalancerBackendAddressPoolListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbbaplr) - if err != nil { - return err - } - page.lbbaplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerBackendAddressPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerBackendAddressPoolListResultPage) NotDone() bool { - return !page.lbbaplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerBackendAddressPoolListResultPage) Response() LoadBalancerBackendAddressPoolListResult { - return page.lbbaplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerBackendAddressPoolListResultPage) Values() []BackendAddressPool { - if page.lbbaplr.IsEmpty() { - return nil - } - return *page.lbbaplr.Value -} - -// Creates a new instance of the LoadBalancerBackendAddressPoolListResultPage type. -func NewLoadBalancerBackendAddressPoolListResultPage(cur LoadBalancerBackendAddressPoolListResult, getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage { - return LoadBalancerBackendAddressPoolListResultPage{ - fn: getNextPage, - lbbaplr: cur, - } -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LoadBalancerBackendAddressPoolsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancerBackendAddressPoolsClient) (BackendAddressPool, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancerBackendAddressPoolsCreateOrUpdateFuture.Result. -func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) result(client LoadBalancerBackendAddressPoolsClient) (bap BackendAddressPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bap.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bap.Response.Response, err = future.GetResult(sender); err == nil && bap.Response.Response.StatusCode != http.StatusNoContent { - bap, err = client.CreateOrUpdateResponder(bap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", bap.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancerBackendAddressPoolsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type LoadBalancerBackendAddressPoolsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancerBackendAddressPoolsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancerBackendAddressPoolsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancerBackendAddressPoolsDeleteFuture.Result. -func (future *LoadBalancerBackendAddressPoolsDeleteFuture) result(client LoadBalancerBackendAddressPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerBackendAddressPropertiesFormat properties of the load balancer backend addresses. -type LoadBalancerBackendAddressPropertiesFormat struct { - // VirtualNetwork - Reference to an existing virtual network. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // IPAddress - IP Address belonging to the referenced virtual network. - IPAddress *string `json:"ipAddress,omitempty"` - // NetworkInterfaceIPConfiguration - READ-ONLY; Reference to IP address defined in network interfaces. - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPropertiesFormat. -func (lbbapf LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbbapf.VirtualNetwork != nil { - objectMap["virtualNetwork"] = lbbapf.VirtualNetwork - } - if lbbapf.IPAddress != nil { - objectMap["ipAddress"] = lbbapf.IPAddress - } - return json.Marshal(objectMap) -} - -// LoadBalancerFrontendIPConfigurationListResult response for ListFrontendIPConfiguration API service call. -type LoadBalancerFrontendIPConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of frontend IP configurations in a load balancer. - Value *[]FrontendIPConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerFrontendIPConfigurationListResult. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbficlr.Value != nil { - objectMap["value"] = lbficlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerFrontendIPConfigurationListResultIterator provides access to a complete listing of -// FrontendIPConfiguration values. -type LoadBalancerFrontendIPConfigurationListResultIterator struct { - i int - page LoadBalancerFrontendIPConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Response() LoadBalancerFrontendIPConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Value() FrontendIPConfiguration { - if !iter.page.NotDone() { - return FrontendIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultIterator type. -func NewLoadBalancerFrontendIPConfigurationListResultIterator(page LoadBalancerFrontendIPConfigurationListResultPage) LoadBalancerFrontendIPConfigurationListResultIterator { - return LoadBalancerFrontendIPConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool { - return lbficlr.Value == nil || len(*lbficlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool { - return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0 -} - -// loadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbficlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbficlr.NextLink))) -} - -// LoadBalancerFrontendIPConfigurationListResultPage contains a page of FrontendIPConfiguration values. -type LoadBalancerFrontendIPConfigurationListResultPage struct { - fn func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error) - lbficlr LoadBalancerFrontendIPConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbficlr) - if err != nil { - return err - } - page.lbficlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerFrontendIPConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerFrontendIPConfigurationListResultPage) NotDone() bool { - return !page.lbficlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerFrontendIPConfigurationListResultPage) Response() LoadBalancerFrontendIPConfigurationListResult { - return page.lbficlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerFrontendIPConfigurationListResultPage) Values() []FrontendIPConfiguration { - if page.lbficlr.IsEmpty() { - return nil - } - return *page.lbficlr.Value -} - -// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultPage type. -func NewLoadBalancerFrontendIPConfigurationListResultPage(cur LoadBalancerFrontendIPConfigurationListResult, getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage { - return LoadBalancerFrontendIPConfigurationListResultPage{ - fn: getNextPage, - lbficlr: cur, - } -} - -// LoadBalancerListResult response for ListLoadBalancers API service call. -type LoadBalancerListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancers in a resource group. - Value *[]LoadBalancer `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerListResult. -func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lblr.Value != nil { - objectMap["value"] = lblr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. -type LoadBalancerListResultIterator struct { - i int - page LoadBalancerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerListResultIterator) Value() LoadBalancer { - if !iter.page.NotDone() { - return LoadBalancer{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerListResultIterator type. -func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator { - return LoadBalancerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lblr LoadBalancerListResult) IsEmpty() bool { - return lblr.Value == nil || len(*lblr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lblr LoadBalancerListResult) hasNextLink() bool { - return lblr.NextLink != nil && len(*lblr.NextLink) != 0 -} - -// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lblr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lblr.NextLink))) -} - -// LoadBalancerListResultPage contains a page of LoadBalancer values. -type LoadBalancerListResultPage struct { - fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error) - lblr LoadBalancerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lblr) - if err != nil { - return err - } - page.lblr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerListResultPage) NotDone() bool { - return !page.lblr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { - return page.lblr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerListResultPage) Values() []LoadBalancer { - if page.lblr.IsEmpty() { - return nil - } - return *page.lblr.Value -} - -// Creates a new instance of the LoadBalancerListResultPage type. -func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { - return LoadBalancerListResultPage{ - fn: getNextPage, - lblr: cur, - } -} - -// LoadBalancerLoadBalancingRuleListResult response for ListLoadBalancingRule API service call. -type LoadBalancerLoadBalancingRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancing rules in a load balancer. - Value *[]LoadBalancingRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerLoadBalancingRuleListResult. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lblbrlr.Value != nil { - objectMap["value"] = lblbrlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of -// LoadBalancingRule values. -type LoadBalancerLoadBalancingRuleListResultIterator struct { - i int - page LoadBalancerLoadBalancingRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerLoadBalancingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerLoadBalancingRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) Response() LoadBalancerLoadBalancingRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) Value() LoadBalancingRule { - if !iter.page.NotDone() { - return LoadBalancingRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultIterator type. -func NewLoadBalancerLoadBalancingRuleListResultIterator(page LoadBalancerLoadBalancingRuleListResultPage) LoadBalancerLoadBalancingRuleListResultIterator { - return LoadBalancerLoadBalancingRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool { - return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool { - return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0 -} - -// loadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lblbrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lblbrlr.NextLink))) -} - -// LoadBalancerLoadBalancingRuleListResultPage contains a page of LoadBalancingRule values. -type LoadBalancerLoadBalancingRuleListResultPage struct { - fn func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error) - lblbrlr LoadBalancerLoadBalancingRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lblbrlr) - if err != nil { - return err - } - page.lblbrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerLoadBalancingRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerLoadBalancingRuleListResultPage) NotDone() bool { - return !page.lblbrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerLoadBalancingRuleListResultPage) Response() LoadBalancerLoadBalancingRuleListResult { - return page.lblbrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerLoadBalancingRuleListResultPage) Values() []LoadBalancingRule { - if page.lblbrlr.IsEmpty() { - return nil - } - return *page.lblbrlr.Value -} - -// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultPage type. -func NewLoadBalancerLoadBalancingRuleListResultPage(cur LoadBalancerLoadBalancingRuleListResult, getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage { - return LoadBalancerLoadBalancingRuleListResultPage{ - fn: getNextPage, - lblbrlr: cur, - } -} - -// LoadBalancerOutboundRuleListResult response for ListOutboundRule API service call. -type LoadBalancerOutboundRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of outbound rules in a load balancer. - Value *[]OutboundRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerOutboundRuleListResult. -func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lborlr.Value != nil { - objectMap["value"] = lborlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. -type LoadBalancerOutboundRuleListResultIterator struct { - i int - page LoadBalancerOutboundRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerOutboundRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerOutboundRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerOutboundRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerOutboundRuleListResultIterator) Response() LoadBalancerOutboundRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerOutboundRuleListResultIterator) Value() OutboundRule { - if !iter.page.NotDone() { - return OutboundRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerOutboundRuleListResultIterator type. -func NewLoadBalancerOutboundRuleListResultIterator(page LoadBalancerOutboundRuleListResultPage) LoadBalancerOutboundRuleListResultIterator { - return LoadBalancerOutboundRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { - return lborlr.Value == nil || len(*lborlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { - return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 -} - -// loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lborlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lborlr.NextLink))) -} - -// LoadBalancerOutboundRuleListResultPage contains a page of OutboundRule values. -type LoadBalancerOutboundRuleListResultPage struct { - fn func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error) - lborlr LoadBalancerOutboundRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lborlr) - if err != nil { - return err - } - page.lborlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerOutboundRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerOutboundRuleListResultPage) NotDone() bool { - return !page.lborlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerOutboundRuleListResultPage) Response() LoadBalancerOutboundRuleListResult { - return page.lborlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule { - if page.lborlr.IsEmpty() { - return nil - } - return *page.lborlr.Value -} - -// Creates a new instance of the LoadBalancerOutboundRuleListResultPage type. -func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { - return LoadBalancerOutboundRuleListResultPage{ - fn: getNextPage, - lborlr: cur, - } -} - -// LoadBalancerProbeListResult response for ListProbe API service call. -type LoadBalancerProbeListResult struct { - autorest.Response `json:"-"` - // Value - A list of probes in a load balancer. - Value *[]Probe `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. -func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbplr.Value != nil { - objectMap["value"] = lbplr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. -type LoadBalancerProbeListResultIterator struct { - i int - page LoadBalancerProbeListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerProbeListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerProbeListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerProbeListResultIterator) Value() Probe { - if !iter.page.NotDone() { - return Probe{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerProbeListResultIterator type. -func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator { - return LoadBalancerProbeListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { - return lbplr.Value == nil || len(*lbplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { - return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 -} - -// loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbplr.NextLink))) -} - -// LoadBalancerProbeListResultPage contains a page of Probe values. -type LoadBalancerProbeListResultPage struct { - fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error) - lbplr LoadBalancerProbeListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbplr) - if err != nil { - return err - } - page.lbplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerProbeListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerProbeListResultPage) NotDone() bool { - return !page.lbplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult { - return page.lbplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerProbeListResultPage) Values() []Probe { - if page.lbplr.IsEmpty() { - return nil - } - return *page.lbplr.Value -} - -// Creates a new instance of the LoadBalancerProbeListResultPage type. -func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { - return LoadBalancerProbeListResultPage{ - fn: getNextPage, - lbplr: cur, - } -} - -// LoadBalancerPropertiesFormat properties of the load balancer. -type LoadBalancerPropertiesFormat struct { - // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer. - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - // BackendAddressPools - Collection of backend address pools used by a load balancer. - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning. - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - // Probes - Collection of probe objects used in the load balancer. - Probes *[]Probe `json:"probes,omitempty"` - // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - // OutboundRules - The outbound rules. - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the load balancer resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerPropertiesFormat. -func (lbpf LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = lbpf.FrontendIPConfigurations - } - if lbpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = lbpf.BackendAddressPools - } - if lbpf.LoadBalancingRules != nil { - objectMap["loadBalancingRules"] = lbpf.LoadBalancingRules - } - if lbpf.Probes != nil { - objectMap["probes"] = lbpf.Probes - } - if lbpf.InboundNatRules != nil { - objectMap["inboundNatRules"] = lbpf.InboundNatRules - } - if lbpf.InboundNatPools != nil { - objectMap["inboundNatPools"] = lbpf.InboundNatPools - } - if lbpf.OutboundRules != nil { - objectMap["outboundRules"] = lbpf.OutboundRules - } - return json.Marshal(objectMap) -} - -// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (LoadBalancer, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. -func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lb.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { - lb, err = client.CreateOrUpdateResponder(lb.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type LoadBalancersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersDeleteFuture.Result. -func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerSku SKU of a load balancer. -type LoadBalancerSku struct { - // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard' - Name LoadBalancerSkuName `json:"name,omitempty"` -} - -// LoadBalancingRule a load balancing rule for a load balancer. -type LoadBalancingRule struct { - autorest.Response `json:"-"` - // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. - *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancingRule. -func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbr.LoadBalancingRulePropertiesFormat != nil { - objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat - } - if lbr.Name != nil { - objectMap["name"] = lbr.Name - } - if lbr.ID != nil { - objectMap["id"] = lbr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. -func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat - err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) - if err != nil { - return err - } - lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lbr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lbr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lbr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lbr.ID = &ID - } - } - } - - return nil -} - -// LoadBalancingRulePropertiesFormat properties of the load balancer. -type LoadBalancingRulePropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // Probe - The reference to the load balancer probe used by the load balancing rule. - Probe *SubResource `json:"probe,omitempty"` - // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // LoadDistribution - The load distribution policy for this rule. Possible values include: 'LoadDistributionDefault', 'LoadDistributionSourceIP', 'LoadDistributionSourceIPProtocol' - LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` - // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancingRulePropertiesFormat. -func (lbrpf LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbrpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = lbrpf.FrontendIPConfiguration - } - if lbrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = lbrpf.BackendAddressPool - } - if lbrpf.Probe != nil { - objectMap["probe"] = lbrpf.Probe - } - if lbrpf.Protocol != "" { - objectMap["protocol"] = lbrpf.Protocol - } - if lbrpf.LoadDistribution != "" { - objectMap["loadDistribution"] = lbrpf.LoadDistribution - } - if lbrpf.FrontendPort != nil { - objectMap["frontendPort"] = lbrpf.FrontendPort - } - if lbrpf.BackendPort != nil { - objectMap["backendPort"] = lbrpf.BackendPort - } - if lbrpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = lbrpf.IdleTimeoutInMinutes - } - if lbrpf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = lbrpf.EnableFloatingIP - } - if lbrpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = lbrpf.EnableTCPReset - } - if lbrpf.DisableOutboundSnat != nil { - objectMap["disableOutboundSnat"] = lbrpf.DisableOutboundSnat - } - return json.Marshal(objectMap) -} - -// LocalNetworkGateway a common class for general resource information. -type LocalNetworkGateway struct { - autorest.Response `json:"-"` - // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. - *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGateway. -func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lng.LocalNetworkGatewayPropertiesFormat != nil { - objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat - } - if lng.ID != nil { - objectMap["id"] = lng.ID - } - if lng.Location != nil { - objectMap["location"] = lng.Location - } - if lng.Tags != nil { - objectMap["tags"] = lng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. -func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat - err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) - if err != nil { - return err - } - lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - lng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - lng.Tags = tags - } - } - } - - return nil -} - -// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. -type LocalNetworkGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of local network gateways that exists in a resource group. - Value *[]LocalNetworkGateway `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. -func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lnglr.Value != nil { - objectMap["value"] = lnglr.Value - } - return json.Marshal(objectMap) -} - -// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway -// values. -type LocalNetworkGatewayListResultIterator struct { - i int - page LocalNetworkGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LocalNetworkGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { - if !iter.page.NotDone() { - return LocalNetworkGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LocalNetworkGatewayListResultIterator type. -func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { - return LocalNetworkGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { - return lnglr.Value == nil || len(*lnglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { - return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 -} - -// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lnglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lnglr.NextLink))) -} - -// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. -type LocalNetworkGatewayListResultPage struct { - fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) - lnglr LocalNetworkGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lnglr) - if err != nil { - return err - } - page.lnglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LocalNetworkGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LocalNetworkGatewayListResultPage) NotDone() bool { - return !page.lnglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { - return page.lnglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { - if page.lnglr.IsEmpty() { - return nil - } - return *page.lnglr.Value -} - -// Creates a new instance of the LocalNetworkGatewayListResultPage type. -func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { - return LocalNetworkGatewayListResultPage{ - fn: getNextPage, - lnglr: cur, - } -} - -// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties. -type LocalNetworkGatewayPropertiesFormat struct { - // LocalNetworkAddressSpace - Local network site address space. - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - // GatewayIPAddress - IP address of local network gateway. - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - // Fqdn - FQDN of local network gateway. - Fqdn *string `json:"fqdn,omitempty"` - // BgpSettings - Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the local network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. -func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lngpf.LocalNetworkAddressSpace != nil { - objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace - } - if lngpf.GatewayIPAddress != nil { - objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress - } - if lngpf.Fqdn != nil { - objectMap["fqdn"] = lngpf.Fqdn - } - if lngpf.BgpSettings != nil { - objectMap["bgpSettings"] = lngpf.BgpSettings - } - return json.Marshal(objectMap) -} - -// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { - lng, err = client.CreateOrUpdateResponder(lng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") - } - } - return -} - -// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. -func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LogSpecification description of logging specification. -type LogSpecification struct { - // Name - The name of the specification. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the specification. - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - Duration of the blob. - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ManagedRuleGroupOverride defines a managed rule group override setting. -type ManagedRuleGroupOverride struct { - // RuleGroupName - The managed rule group to override. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} - -// ManagedRuleOverride defines a managed rule group override setting. -type ManagedRuleOverride struct { - // RuleID - Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - // State - The state of the managed rule. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled' - State ManagedRuleEnabledState `json:"state,omitempty"` -} - -// ManagedRulesDefinition allow to exclude some variable satisfy the condition for the WAF check. -type ManagedRulesDefinition struct { - // Exclusions - The Exclusions that are applied on the policy. - Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` - // ManagedRuleSets - The managed rule sets that are associated with the policy. - ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` -} - -// ManagedRuleSet defines a managed rule set. -type ManagedRuleSet struct { - // RuleSetType - Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` -} - -// ManagedServiceIdentity identity for the resource. -type ManagedServiceIdentity struct { - // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for ManagedServiceIdentity. -func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if msi.Type != "" { - objectMap["type"] = msi.Type - } - if msi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// ManagedServiceIdentityUserAssignedIdentitiesValue ... -type ManagedServiceIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MatchCondition define match conditions. -type MatchCondition struct { - // MatchVariables - List of match variables. - MatchVariables *[]MatchVariable `json:"matchVariables,omitempty"` - // Operator - The operator to be matched. Possible values include: 'WebApplicationFirewallOperatorIPMatch', 'WebApplicationFirewallOperatorEqual', 'WebApplicationFirewallOperatorContains', 'WebApplicationFirewallOperatorLessThan', 'WebApplicationFirewallOperatorGreaterThan', 'WebApplicationFirewallOperatorLessThanOrEqual', 'WebApplicationFirewallOperatorGreaterThanOrEqual', 'WebApplicationFirewallOperatorBeginsWith', 'WebApplicationFirewallOperatorEndsWith', 'WebApplicationFirewallOperatorRegex', 'WebApplicationFirewallOperatorGeoMatch' - Operator WebApplicationFirewallOperator `json:"operator,omitempty"` - // NegationConditon - Whether this is negate condition or not. - NegationConditon *bool `json:"negationConditon,omitempty"` - // MatchValues - Match value. - MatchValues *[]string `json:"matchValues,omitempty"` - // Transforms - List of transforms. - Transforms *[]WebApplicationFirewallTransform `json:"transforms,omitempty"` -} - -// MatchedRule matched rule. -type MatchedRule struct { - // RuleName - Name of the matched network security rule. - RuleName *string `json:"ruleName,omitempty"` - // Action - The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. - Action *string `json:"action,omitempty"` -} - -// MatchVariable define match variables. -type MatchVariable struct { - // VariableName - Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeaders', 'RequestBody', 'RequestCookies' - VariableName WebApplicationFirewallMatchVariable `json:"variableName,omitempty"` - // Selector - The selector of match variable. - Selector *string `json:"selector,omitempty"` -} - -// MetricSpecification description of metrics specification. -type MetricSpecification struct { - // Name - The name of the metric. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the metric. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - The description of the metric. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Units the metric to be displayed in. - Unit *string `json:"unit,omitempty"` - // AggregationType - The aggregation type. - AggregationType *string `json:"aggregationType,omitempty"` - // Availabilities - List of availability. - Availabilities *[]Availability `json:"availabilities,omitempty"` - // EnableRegionalMdmAccount - Whether regional MDM account enabled. - EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` - // FillGapWithZero - Whether gaps would be filled with zeros. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // MetricFilterPattern - Pattern for the filter of the metric. - MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` - // Dimensions - List of dimensions. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // IsInternal - Whether the metric is internal. - IsInternal *bool `json:"isInternal,omitempty"` - // SourceMdmAccount - The source MDM account. - SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` - // SourceMdmNamespace - The source MDM namespace. - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` - // ResourceIDDimensionNameOverride - The resource Id dimension name override. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` -} - -// NatGateway nat Gateway resource. -type NatGateway struct { - autorest.Response `json:"-"` - // Sku - The nat gateway SKU. - Sku *NatGatewaySku `json:"sku,omitempty"` - // NatGatewayPropertiesFormat - Nat Gateway properties. - *NatGatewayPropertiesFormat `json:"properties,omitempty"` - // Zones - A list of availability zones denoting the zone in which Nat Gateway should be deployed. - Zones *[]string `json:"zones,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for NatGateway. -func (ng NatGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ng.Sku != nil { - objectMap["sku"] = ng.Sku - } - if ng.NatGatewayPropertiesFormat != nil { - objectMap["properties"] = ng.NatGatewayPropertiesFormat - } - if ng.Zones != nil { - objectMap["zones"] = ng.Zones - } - if ng.ID != nil { - objectMap["id"] = ng.ID - } - if ng.Location != nil { - objectMap["location"] = ng.Location - } - if ng.Tags != nil { - objectMap["tags"] = ng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for NatGateway struct. -func (ng *NatGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku NatGatewaySku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - ng.Sku = &sku - } - case "properties": - if v != nil { - var natGatewayPropertiesFormat NatGatewayPropertiesFormat - err = json.Unmarshal(*v, &natGatewayPropertiesFormat) - if err != nil { - return err - } - ng.NatGatewayPropertiesFormat = &natGatewayPropertiesFormat - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ng.Zones = &zones - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ng.Tags = tags - } - } - } - - return nil -} - -// NatGatewayListResult response for ListNatGateways API service call. -type NatGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of Nat Gateways that exists in a resource group. - Value *[]NatGateway `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// NatGatewayListResultIterator provides access to a complete listing of NatGateway values. -type NatGatewayListResultIterator struct { - i int - page NatGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *NatGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *NatGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NatGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter NatGatewayListResultIterator) Response() NatGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter NatGatewayListResultIterator) Value() NatGateway { - if !iter.page.NotDone() { - return NatGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the NatGatewayListResultIterator type. -func NewNatGatewayListResultIterator(page NatGatewayListResultPage) NatGatewayListResultIterator { - return NatGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (nglr NatGatewayListResult) IsEmpty() bool { - return nglr.Value == nil || len(*nglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (nglr NatGatewayListResult) hasNextLink() bool { - return nglr.NextLink != nil && len(*nglr.NextLink) != 0 -} - -// natGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nglr NatGatewayListResult) natGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !nglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nglr.NextLink))) -} - -// NatGatewayListResultPage contains a page of NatGateway values. -type NatGatewayListResultPage struct { - fn func(context.Context, NatGatewayListResult) (NatGatewayListResult, error) - nglr NatGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *NatGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.nglr) - if err != nil { - return err - } - page.nglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *NatGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NatGatewayListResultPage) NotDone() bool { - return !page.nglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NatGatewayListResultPage) Response() NatGatewayListResult { - return page.nglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NatGatewayListResultPage) Values() []NatGateway { - if page.nglr.IsEmpty() { - return nil - } - return *page.nglr.Value -} - -// Creates a new instance of the NatGatewayListResultPage type. -func NewNatGatewayListResultPage(cur NatGatewayListResult, getNextPage func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)) NatGatewayListResultPage { - return NatGatewayListResultPage{ - fn: getNextPage, - nglr: cur, - } -} - -// NatGatewayPropertiesFormat nat Gateway properties. -type NatGatewayPropertiesFormat struct { - // IdleTimeoutInMinutes - The idle timeout of the nat gateway. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // PublicIPAddresses - An array of public ip addresses associated with the nat gateway resource. - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - // PublicIPPrefixes - An array of public ip prefixes associated with the nat gateway resource. - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - // Subnets - READ-ONLY; An array of references to the subnets using this nat gateway resource. - Subnets *[]SubResource `json:"subnets,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the NAT gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for NatGatewayPropertiesFormat. -func (ngpf NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ngpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = ngpf.IdleTimeoutInMinutes - } - if ngpf.PublicIPAddresses != nil { - objectMap["publicIpAddresses"] = ngpf.PublicIPAddresses - } - if ngpf.PublicIPPrefixes != nil { - objectMap["publicIpPrefixes"] = ngpf.PublicIPPrefixes - } - return json.Marshal(objectMap) -} - -// NatGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type NatGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatGatewaysClient) (NatGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatGatewaysCreateOrUpdateFuture.Result. -func (future *NatGatewaysCreateOrUpdateFuture) result(client NatGatewaysClient) (ng NatGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ng.Response.Response, err = future.GetResult(sender); err == nil && ng.Response.Response.StatusCode != http.StatusNoContent { - ng, err = client.CreateOrUpdateResponder(ng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", ng.Response.Response, "Failure responding to request") - } - } - return -} - -// NatGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type NatGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatGatewaysDeleteFuture.Result. -func (future *NatGatewaysDeleteFuture) result(client NatGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// NatGatewaySku SKU of nat gateway. -type NatGatewaySku struct { - // Name - Name of Nat Gateway SKU. Possible values include: 'NatGatewaySkuNameStandard' - Name NatGatewaySkuName `json:"name,omitempty"` -} - -// NatRule rule of type nat. -type NatRule struct { - // IPProtocols - Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // TranslatedAddress - The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - // TranslatedPort - The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for NatRule. -func (nr NatRule) MarshalJSON() ([]byte, error) { - nr.RuleType = RuleTypeNatRule - objectMap := make(map[string]interface{}) - if nr.IPProtocols != nil { - objectMap["ipProtocols"] = nr.IPProtocols - } - if nr.SourceAddresses != nil { - objectMap["sourceAddresses"] = nr.SourceAddresses - } - if nr.DestinationAddresses != nil { - objectMap["destinationAddresses"] = nr.DestinationAddresses - } - if nr.DestinationPorts != nil { - objectMap["destinationPorts"] = nr.DestinationPorts - } - if nr.TranslatedAddress != nil { - objectMap["translatedAddress"] = nr.TranslatedAddress - } - if nr.TranslatedPort != nil { - objectMap["translatedPort"] = nr.TranslatedPort - } - if nr.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = nr.SourceIPGroups - } - if nr.Name != nil { - objectMap["name"] = nr.Name - } - if nr.Description != nil { - objectMap["description"] = nr.Description - } - if nr.RuleType != "" { - objectMap["ruleType"] = nr.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsNatRule() (*NatRule, bool) { - return &nr, true -} - -// AsRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &nr, true -} - -// NextHopParameters parameters that define the source and destination endpoint. -type NextHopParameters struct { - // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // SourceIPAddress - The source IP address. - SourceIPAddress *string `json:"sourceIPAddress,omitempty"` - // DestinationIPAddress - The destination IP address. - DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` - // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// NextHopResult the information about next hop from the specified VM. -type NextHopResult struct { - autorest.Response `json:"-"` - // NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone' - NextHopType NextHopType `json:"nextHopType,omitempty"` - // NextHopIPAddress - Next hop IP Address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - // RouteTableID - The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. - RouteTableID *string `json:"routeTableId,omitempty"` -} - -// Office365PolicyProperties network Virtual Appliance Sku Properties. -type Office365PolicyProperties struct { - // BreakOutCategories - Office 365 breakout categories. - BreakOutCategories *BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} - -// Operation network REST API operation definition. -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` - // Display - Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - Origin of the operation. - Origin *string `json:"origin,omitempty"` - // OperationPropertiesFormat - Operation properties format. - *OperationPropertiesFormat `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Name != nil { - objectMap["name"] = o.Name - } - if o.Display != nil { - objectMap["display"] = o.Display - } - if o.Origin != nil { - objectMap["origin"] = o.Origin - } - if o.OperationPropertiesFormat != nil { - objectMap["properties"] = o.OperationPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Operation struct. -func (o *Operation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - o.Name = &name - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - o.Display = &display - } - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - o.Origin = &origin - } - case "properties": - if v != nil { - var operationPropertiesFormat OperationPropertiesFormat - err = json.Unmarshal(*v, &operationPropertiesFormat) - if err != nil { - return err - } - o.OperationPropertiesFormat = &operationPropertiesFormat - } - } - } - - return nil -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft Network. - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - Type of the operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation. - Description *string `json:"description,omitempty"` -} - -// OperationListResult result of the request to list Network operations. It contains a list of operations -// and a URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Network operations supported by the Network resource provider. - Value *[]Operation `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// OperationListResultIterator provides access to a complete listing of Operation values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OperationListResultIterator) Response() OperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OperationListResultIterator) Value() Operation { - if !iter.page.NotDone() { - return Operation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// OperationPropertiesFormat description of operation properties format. -type OperationPropertiesFormat struct { - // ServiceSpecification - Specification of the service. - ServiceSpecification *OperationPropertiesFormatServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// OperationPropertiesFormatServiceSpecification specification of the service. -type OperationPropertiesFormatServiceSpecification struct { - // MetricSpecifications - Operation service specification. - MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` - // LogSpecifications - Operation log specification. - LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` -} - -// OutboundRule outbound rule of the load balancer. -type OutboundRule struct { - autorest.Response `json:"-"` - // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. - *OutboundRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for OutboundRule. -func (or OutboundRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if or.OutboundRulePropertiesFormat != nil { - objectMap["properties"] = or.OutboundRulePropertiesFormat - } - if or.Name != nil { - objectMap["name"] = or.Name - } - if or.ID != nil { - objectMap["id"] = or.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OutboundRule struct. -func (or *OutboundRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var outboundRulePropertiesFormat OutboundRulePropertiesFormat - err = json.Unmarshal(*v, &outboundRulePropertiesFormat) - if err != nil { - return err - } - or.OutboundRulePropertiesFormat = &outboundRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - or.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - or.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - or.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - or.ID = &ID - } - } - } - - return nil -} - -// OutboundRulePropertiesFormat outbound rule of the load balancer. -type OutboundRulePropertiesFormat struct { - // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. - AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` - // FrontendIPConfigurations - The Frontend IP addresses of the load balancer. - FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` - // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the outbound rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Protocol - The protocol for the outbound rule in load balancer. Possible values include: 'LoadBalancerOutboundRuleProtocolTCP', 'LoadBalancerOutboundRuleProtocolUDP', 'LoadBalancerOutboundRuleProtocolAll' - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` -} - -// MarshalJSON is the custom marshaler for OutboundRulePropertiesFormat. -func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if orpf.AllocatedOutboundPorts != nil { - objectMap["allocatedOutboundPorts"] = orpf.AllocatedOutboundPorts - } - if orpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = orpf.FrontendIPConfigurations - } - if orpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = orpf.BackendAddressPool - } - if orpf.Protocol != "" { - objectMap["protocol"] = orpf.Protocol - } - if orpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = orpf.EnableTCPReset - } - if orpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = orpf.IdleTimeoutInMinutes - } - return json.Marshal(objectMap) -} - -// OwaspCrsExclusionEntry allow to exclude some variable satisfy the condition for the WAF check. -type OwaspCrsExclusionEntry struct { - // MatchVariable - The variable to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames' - MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` - // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. Possible values include: 'OwaspCrsExclusionEntrySelectorMatchOperatorEquals', 'OwaspCrsExclusionEntrySelectorMatchOperatorContains', 'OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny' - SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` - // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. - Selector *string `json:"selector,omitempty"` -} - -// P2SConnectionConfiguration p2SConnectionConfiguration Resource. -type P2SConnectionConfiguration struct { - // P2SConnectionConfigurationProperties - Properties of the P2S connection configuration. - *P2SConnectionConfigurationProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SConnectionConfiguration. -func (pcc P2SConnectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcc.P2SConnectionConfigurationProperties != nil { - objectMap["properties"] = pcc.P2SConnectionConfigurationProperties - } - if pcc.Name != nil { - objectMap["name"] = pcc.Name - } - if pcc.ID != nil { - objectMap["id"] = pcc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for P2SConnectionConfiguration struct. -func (pcc *P2SConnectionConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var p2SConnectionConfigurationProperties P2SConnectionConfigurationProperties - err = json.Unmarshal(*v, &p2SConnectionConfigurationProperties) - if err != nil { - return err - } - pcc.P2SConnectionConfigurationProperties = &p2SConnectionConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pcc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcc.ID = &ID - } - } - } - - return nil -} - -// P2SConnectionConfigurationProperties parameters for P2SConnectionConfiguration. -type P2SConnectionConfigurationProperties struct { - // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SConnectionConfigurationProperties. -func (pccp P2SConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pccp.VpnClientAddressPool != nil { - objectMap["vpnClientAddressPool"] = pccp.VpnClientAddressPool - } - if pccp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = pccp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// P2SVpnConnectionHealth p2S Vpn connection detailed health written to sas url. -type P2SVpnConnectionHealth struct { - autorest.Response `json:"-"` - // SasURL - Returned sas url of the blob to which the p2s vpn connection detailed health will be written. - SasURL *string `json:"sasUrl,omitempty"` -} - -// P2SVpnConnectionHealthRequest list of P2S Vpn connection health request. -type P2SVpnConnectionHealthRequest struct { - // VpnUserNamesFilter - The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. - VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` - // OutputBlobSasURL - The sas-url to download the P2S Vpn connection health detail. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` -} - -// P2SVpnConnectionRequest list of p2s vpn connections to be disconnected. -type P2SVpnConnectionRequest struct { - // VpnConnectionIds - List of p2s vpn connection Ids. - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} - -// P2SVpnGateway p2SVpnGateway Resource. -type P2SVpnGateway struct { - autorest.Response `json:"-"` - // P2SVpnGatewayProperties - Properties of the P2SVpnGateway. - *P2SVpnGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for P2SVpnGateway. -func (pvg P2SVpnGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pvg.P2SVpnGatewayProperties != nil { - objectMap["properties"] = pvg.P2SVpnGatewayProperties - } - if pvg.ID != nil { - objectMap["id"] = pvg.ID - } - if pvg.Location != nil { - objectMap["location"] = pvg.Location - } - if pvg.Tags != nil { - objectMap["tags"] = pvg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for P2SVpnGateway struct. -func (pvg *P2SVpnGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var p2SVpnGatewayProperties P2SVpnGatewayProperties - err = json.Unmarshal(*v, &p2SVpnGatewayProperties) - if err != nil { - return err - } - pvg.P2SVpnGatewayProperties = &p2SVpnGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pvg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pvg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pvg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pvg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pvg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pvg.Tags = tags - } - } - } - - return nil -} - -// P2SVpnGatewayProperties parameters for P2SVpnGateway. -type P2SVpnGatewayProperties struct { - // VirtualHub - The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // P2SConnectionConfigurations - List of all p2s connection configurations of the gateway. - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2S VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnGatewayScaleUnit - The scale unit for this p2s vpn gateway. - VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` - // VpnServerConfiguration - The VpnServerConfiguration to which the p2sVpnGateway is attached to. - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` - // VpnClientConnectionHealth - READ-ONLY; All P2S VPN clients' connection health status. - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - // CustomDNSServers - List of all customer specified DNS servers IP addresses. - CustomDNSServers *[]string `json:"customDnsServers,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SVpnGatewayProperties. -func (pvgp P2SVpnGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pvgp.VirtualHub != nil { - objectMap["virtualHub"] = pvgp.VirtualHub - } - if pvgp.P2SConnectionConfigurations != nil { - objectMap["p2SConnectionConfigurations"] = pvgp.P2SConnectionConfigurations - } - if pvgp.VpnGatewayScaleUnit != nil { - objectMap["vpnGatewayScaleUnit"] = pvgp.VpnGatewayScaleUnit - } - if pvgp.VpnServerConfiguration != nil { - objectMap["vpnServerConfiguration"] = pvgp.VpnServerConfiguration - } - if pvgp.CustomDNSServers != nil { - objectMap["customDnsServers"] = pvgp.CustomDNSServers - } - return json.Marshal(objectMap) -} - -// P2sVpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type P2sVpnGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysCreateOrUpdateFuture.Result. -func (future *P2sVpnGatewaysCreateOrUpdateFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.CreateOrUpdateResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type P2sVpnGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysDeleteFuture.Result. -func (future *P2sVpnGatewaysDeleteFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture.Result. -func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture") - return - } - ar.Response = future.Response() - return -} - -// P2sVpnGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type P2sVpnGatewaysGenerateVpnProfileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (VpnProfileResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGenerateVpnProfileFuture.Result. -func (future *P2sVpnGatewaysGenerateVpnProfileFuture) result(client P2sVpnGatewaysClient) (vpr VpnProfileResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vpr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGenerateVpnProfileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent { - vpr, err = client.GenerateVpnProfileResponder(vpr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", vpr.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnConnectionHealth, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture.Result. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) result(client P2sVpnGatewaysClient) (pvch P2SVpnConnectionHealth, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvch.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvch.Response.Response, err = future.GetResult(sender); err == nil && pvch.Response.Response.StatusCode != http.StatusNoContent { - pvch, err = client.GetP2sVpnConnectionHealthDetailedResponder(pvch.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", pvch.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysGetP2sVpnConnectionHealthFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type P2sVpnGatewaysGetP2sVpnConnectionHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.Result. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.GetP2sVpnConnectionHealthResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2SVpnProfileParameters vpn Client Parameters for package generation. -type P2SVpnProfileParameters struct { - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` -} - -// PacketCapture parameters that define the create packet capture operation. -type PacketCapture struct { - // PacketCaptureParameters - Properties of the packet capture. - *PacketCaptureParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCapture. -func (pc PacketCapture) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pc.PacketCaptureParameters != nil { - objectMap["properties"] = pc.PacketCaptureParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PacketCapture struct. -func (pc *PacketCapture) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var packetCaptureParameters PacketCaptureParameters - err = json.Unmarshal(*v, &packetCaptureParameters) - if err != nil { - return err - } - pc.PacketCaptureParameters = &packetCaptureParameters - } - } - } - - return nil -} - -// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied. -type PacketCaptureFilter struct { - // Protocol - Protocol to be filtered on. Possible values include: 'PcProtocolTCP', 'PcProtocolUDP', 'PcProtocolAny' - Protocol PcProtocol `json:"protocol,omitempty"` - // LocalIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - // RemoteIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - // LocalPort - Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - LocalPort *string `json:"localPort,omitempty"` - // RemotePort - Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - RemotePort *string `json:"remotePort,omitempty"` -} - -// PacketCaptureListResult list of packet capture sessions. -type PacketCaptureListResult struct { - autorest.Response `json:"-"` - // Value - Information about packet capture sessions. - Value *[]PacketCaptureResult `json:"value,omitempty"` -} - -// PacketCaptureParameters parameters that define the create packet capture operation. -type PacketCaptureParameters struct { - // Target - The ID of the targeted resource, only VM is currently supported. - Target *string `json:"target,omitempty"` - // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` - // TotalBytesPerSession - Maximum size of the capture output. - TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` - // TimeLimitInSeconds - Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - // StorageLocation - The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - // Filters - A list of packet capture filters. - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` -} - -// PacketCaptureQueryStatusResult status of packet capture session. -type PacketCaptureQueryStatusResult struct { - autorest.Response `json:"-"` - // Name - The name of the packet capture resource. - Name *string `json:"name,omitempty"` - // ID - The ID of the packet capture resource. - ID *string `json:"id,omitempty"` - // CaptureStartTime - The start time of the packet capture session. - CaptureStartTime *date.Time `json:"captureStartTime,omitempty"` - // PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown' - PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"` - // StopReason - The reason the current packet capture session was stopped. - StopReason *string `json:"stopReason,omitempty"` - // PacketCaptureError - List of errors of packet capture session. - PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` -} - -// PacketCaptureResult information about packet capture session. -type PacketCaptureResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the packet capture session. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; ID of the packet capture operation. - ID *string `json:"id,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // PacketCaptureResultProperties - Properties of the packet capture result. - *PacketCaptureResultProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCaptureResult. -func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcr.PacketCaptureResultProperties != nil { - objectMap["properties"] = pcr.PacketCaptureResultProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. -func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pcr.Etag = &etag - } - case "properties": - if v != nil { - var packetCaptureResultProperties PacketCaptureResultProperties - err = json.Unmarshal(*v, &packetCaptureResultProperties) - if err != nil { - return err - } - pcr.PacketCaptureResultProperties = &packetCaptureResultProperties - } - } - } - - return nil -} - -// PacketCaptureResultProperties the properties of a packet capture session. -type PacketCaptureResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Target - The ID of the targeted resource, only VM is currently supported. - Target *string `json:"target,omitempty"` - // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` - // TotalBytesPerSession - Maximum size of the capture output. - TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` - // TimeLimitInSeconds - Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - // StorageLocation - The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - // Filters - A list of packet capture filters. - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCaptureResultProperties. -func (pcrp PacketCaptureResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcrp.Target != nil { - objectMap["target"] = pcrp.Target - } - if pcrp.BytesToCapturePerPacket != nil { - objectMap["bytesToCapturePerPacket"] = pcrp.BytesToCapturePerPacket - } - if pcrp.TotalBytesPerSession != nil { - objectMap["totalBytesPerSession"] = pcrp.TotalBytesPerSession - } - if pcrp.TimeLimitInSeconds != nil { - objectMap["timeLimitInSeconds"] = pcrp.TimeLimitInSeconds - } - if pcrp.StorageLocation != nil { - objectMap["storageLocation"] = pcrp.StorageLocation - } - if pcrp.Filters != nil { - objectMap["filters"] = pcrp.Filters - } - return json.Marshal(objectMap) -} - -// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (PacketCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesCreateFuture.Result. -func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent { - pcr, err = client.CreateResponder(pcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request") - } - } - return -} - -// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesDeleteFuture.Result. -func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesGetStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesGetStatusFuture.Result. -func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pcqsr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent { - pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request") - } - } - return -} - -// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesStopFuture.Result. -func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") - return - } - ar.Response = future.Response() - return -} - -// PacketCaptureStorageLocation the storage location for a packet capture session. -type PacketCaptureStorageLocation struct { - // StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided. - StorageID *string `json:"storageId,omitempty"` - // StoragePath - The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. - StoragePath *string `json:"storagePath,omitempty"` - // FilePath - A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. - FilePath *string `json:"filePath,omitempty"` -} - -// PatchRouteFilter route Filter Resource. -type PatchRouteFilter struct { - // RouteFilterPropertiesFormat - Properties of the route filter. - *RouteFilterPropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchRouteFilter. -func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if prf.RouteFilterPropertiesFormat != nil { - objectMap["properties"] = prf.RouteFilterPropertiesFormat - } - if prf.Tags != nil { - objectMap["tags"] = prf.Tags - } - if prf.ID != nil { - objectMap["id"] = prf.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. -func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterPropertiesFormat RouteFilterPropertiesFormat - err = json.Unmarshal(*v, &routeFilterPropertiesFormat) - if err != nil { - return err - } - prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - prf.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - prf.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - prf.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - prf.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - prf.ID = &ID - } - } - } - - return nil -} - -// PatchRouteFilterRule route Filter Rule Resource. -type PatchRouteFilterRule struct { - // RouteFilterRulePropertiesFormat - Properties of the route filter rule. - *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchRouteFilterRule. -func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if prfr.RouteFilterRulePropertiesFormat != nil { - objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat - } - if prfr.ID != nil { - objectMap["id"] = prfr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct. -func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat - err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) - if err != nil { - return err - } - prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - prfr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - prfr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - prfr.ID = &ID - } - } - } - - return nil -} - -// PeerExpressRouteCircuitConnection peer Express Route Circuit Connection in an ExpressRouteCircuitPeering -// resource. -type PeerExpressRouteCircuitConnection struct { - autorest.Response `json:"-"` - // PeerExpressRouteCircuitConnectionPropertiesFormat - Properties of the peer express route circuit connection. - *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnection. -func (percc PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if percc.PeerExpressRouteCircuitConnectionPropertiesFormat != nil { - objectMap["properties"] = percc.PeerExpressRouteCircuitConnectionPropertiesFormat - } - if percc.Name != nil { - objectMap["name"] = percc.Name - } - if percc.ID != nil { - objectMap["id"] = percc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PeerExpressRouteCircuitConnection struct. -func (percc *PeerExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var peerExpressRouteCircuitConnectionPropertiesFormat PeerExpressRouteCircuitConnectionPropertiesFormat - err = json.Unmarshal(*v, &peerExpressRouteCircuitConnectionPropertiesFormat) - if err != nil { - return err - } - percc.PeerExpressRouteCircuitConnectionPropertiesFormat = &peerExpressRouteCircuitConnectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - percc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - percc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - percc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - percc.ID = &ID - } - } - } - - return nil -} - -// PeerExpressRouteCircuitConnectionListResult response for ListPeeredConnections API service call -// retrieves all global reach peer circuit connections that belongs to a Private Peering for an -// ExpressRouteCircuit. -type PeerExpressRouteCircuitConnectionListResult struct { - autorest.Response `json:"-"` - // Value - The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. - Value *[]PeerExpressRouteCircuitConnection `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PeerExpressRouteCircuitConnectionListResultIterator provides access to a complete listing of -// PeerExpressRouteCircuitConnection values. -type PeerExpressRouteCircuitConnectionListResultIterator struct { - i int - page PeerExpressRouteCircuitConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PeerExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PeerExpressRouteCircuitConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) Response() PeerExpressRouteCircuitConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) Value() PeerExpressRouteCircuitConnection { - if !iter.page.NotDone() { - return PeerExpressRouteCircuitConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PeerExpressRouteCircuitConnectionListResultIterator type. -func NewPeerExpressRouteCircuitConnectionListResultIterator(page PeerExpressRouteCircuitConnectionListResultPage) PeerExpressRouteCircuitConnectionListResultIterator { - return PeerExpressRouteCircuitConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (percclr PeerExpressRouteCircuitConnectionListResult) IsEmpty() bool { - return percclr.Value == nil || len(*percclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (percclr PeerExpressRouteCircuitConnectionListResult) hasNextLink() bool { - return percclr.NextLink != nil && len(*percclr.NextLink) != 0 -} - -// peerExpressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !percclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(percclr.NextLink))) -} - -// PeerExpressRouteCircuitConnectionListResultPage contains a page of PeerExpressRouteCircuitConnection -// values. -type PeerExpressRouteCircuitConnectionListResultPage struct { - fn func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error) - percclr PeerExpressRouteCircuitConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PeerExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.percclr) - if err != nil { - return err - } - page.percclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PeerExpressRouteCircuitConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PeerExpressRouteCircuitConnectionListResultPage) NotDone() bool { - return !page.percclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PeerExpressRouteCircuitConnectionListResultPage) Response() PeerExpressRouteCircuitConnectionListResult { - return page.percclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PeerExpressRouteCircuitConnectionListResultPage) Values() []PeerExpressRouteCircuitConnection { - if page.percclr.IsEmpty() { - return nil - } - return *page.percclr.Value -} - -// Creates a new instance of the PeerExpressRouteCircuitConnectionListResultPage type. -func NewPeerExpressRouteCircuitConnectionListResultPage(cur PeerExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)) PeerExpressRouteCircuitConnectionListResultPage { - return PeerExpressRouteCircuitConnectionListResultPage{ - fn: getNextPage, - percclr: cur, - } -} - -// PeerExpressRouteCircuitConnectionPropertiesFormat properties of the peer express route circuit -// connection. -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - // ExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the circuit. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - // PeerExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - // ConnectionName - The name of the express route circuit connection resource. - ConnectionName *string `json:"connectionName,omitempty"` - // AuthResourceGUID - The resource guid of the authorization used for the express route circuit connection. - AuthResourceGUID *string `json:"authResourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the peer express route circuit connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnectionPropertiesFormat. -func (perccpf PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if perccpf.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = perccpf.ExpressRouteCircuitPeering - } - if perccpf.PeerExpressRouteCircuitPeering != nil { - objectMap["peerExpressRouteCircuitPeering"] = perccpf.PeerExpressRouteCircuitPeering - } - if perccpf.AddressPrefix != nil { - objectMap["addressPrefix"] = perccpf.AddressPrefix - } - if perccpf.CircuitConnectionStatus != "" { - objectMap["circuitConnectionStatus"] = perccpf.CircuitConnectionStatus - } - if perccpf.ConnectionName != nil { - objectMap["connectionName"] = perccpf.ConnectionName - } - if perccpf.AuthResourceGUID != nil { - objectMap["authResourceGuid"] = perccpf.AuthResourceGUID - } - return json.Marshal(objectMap) -} - -// PolicySettings defines contents of a web application firewall global configuration. -type PolicySettings struct { - // State - The state of the policy. Possible values include: 'WebApplicationFirewallEnabledStateDisabled', 'WebApplicationFirewallEnabledStateEnabled' - State WebApplicationFirewallEnabledState `json:"state,omitempty"` - // Mode - The mode of the policy. Possible values include: 'WebApplicationFirewallModePrevention', 'WebApplicationFirewallModeDetection' - Mode WebApplicationFirewallMode `json:"mode,omitempty"` - // RequestBodyCheck - Whether to allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - // MaxRequestBodySizeInKb - Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - // FileUploadLimitInMb - Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` -} - -// PrepareNetworkPoliciesRequest details of PrepareNetworkPolicies for Subnet. -type PrepareNetworkPoliciesRequest struct { - // ServiceName - The name of the service for which subnet is being prepared for. - ServiceName *string `json:"serviceName,omitempty"` - // NetworkIntentPolicyConfigurations - A list of NetworkIntentPolicyConfiguration. - NetworkIntentPolicyConfigurations *[]IntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"` -} - -// PrivateDNSZoneConfig privateDnsZoneConfig resource. -type PrivateDNSZoneConfig struct { - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // PrivateDNSZonePropertiesFormat - Properties of the private dns zone configuration. - *PrivateDNSZonePropertiesFormat `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneConfig. -func (pdzc PrivateDNSZoneConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzc.Name != nil { - objectMap["name"] = pdzc.Name - } - if pdzc.PrivateDNSZonePropertiesFormat != nil { - objectMap["properties"] = pdzc.PrivateDNSZonePropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateDNSZoneConfig struct. -func (pdzc *PrivateDNSZoneConfig) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pdzc.Name = &name - } - case "properties": - if v != nil { - var privateDNSZonePropertiesFormat PrivateDNSZonePropertiesFormat - err = json.Unmarshal(*v, &privateDNSZonePropertiesFormat) - if err != nil { - return err - } - pdzc.PrivateDNSZonePropertiesFormat = &privateDNSZonePropertiesFormat - } - } - } - - return nil -} - -// PrivateDNSZoneGroup private dns zone group resource. -type PrivateDNSZoneGroup struct { - autorest.Response `json:"-"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // PrivateDNSZoneGroupPropertiesFormat - Properties of the private dns zone group. - *PrivateDNSZoneGroupPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroup. -func (pdzg PrivateDNSZoneGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzg.Name != nil { - objectMap["name"] = pdzg.Name - } - if pdzg.PrivateDNSZoneGroupPropertiesFormat != nil { - objectMap["properties"] = pdzg.PrivateDNSZoneGroupPropertiesFormat - } - if pdzg.ID != nil { - objectMap["id"] = pdzg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateDNSZoneGroup struct. -func (pdzg *PrivateDNSZoneGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pdzg.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pdzg.Etag = &etag - } - case "properties": - if v != nil { - var privateDNSZoneGroupPropertiesFormat PrivateDNSZoneGroupPropertiesFormat - err = json.Unmarshal(*v, &privateDNSZoneGroupPropertiesFormat) - if err != nil { - return err - } - pdzg.PrivateDNSZoneGroupPropertiesFormat = &privateDNSZoneGroupPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pdzg.ID = &ID - } - } - } - - return nil -} - -// PrivateDNSZoneGroupListResult response for the ListPrivateDnsZoneGroups API service call. -type PrivateDNSZoneGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of private dns zone group resources in a private endpoint. - Value *[]PrivateDNSZoneGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroupListResult. -func (pdzglr PrivateDNSZoneGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzglr.Value != nil { - objectMap["value"] = pdzglr.Value - } - return json.Marshal(objectMap) -} - -// PrivateDNSZoneGroupListResultIterator provides access to a complete listing of PrivateDNSZoneGroup -// values. -type PrivateDNSZoneGroupListResultIterator struct { - i int - page PrivateDNSZoneGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateDNSZoneGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateDNSZoneGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateDNSZoneGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateDNSZoneGroupListResultIterator) Response() PrivateDNSZoneGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateDNSZoneGroupListResultIterator) Value() PrivateDNSZoneGroup { - if !iter.page.NotDone() { - return PrivateDNSZoneGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateDNSZoneGroupListResultIterator type. -func NewPrivateDNSZoneGroupListResultIterator(page PrivateDNSZoneGroupListResultPage) PrivateDNSZoneGroupListResultIterator { - return PrivateDNSZoneGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pdzglr PrivateDNSZoneGroupListResult) IsEmpty() bool { - return pdzglr.Value == nil || len(*pdzglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pdzglr PrivateDNSZoneGroupListResult) hasNextLink() bool { - return pdzglr.NextLink != nil && len(*pdzglr.NextLink) != 0 -} - -// privateDNSZoneGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pdzglr PrivateDNSZoneGroupListResult) privateDNSZoneGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pdzglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pdzglr.NextLink))) -} - -// PrivateDNSZoneGroupListResultPage contains a page of PrivateDNSZoneGroup values. -type PrivateDNSZoneGroupListResultPage struct { - fn func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error) - pdzglr PrivateDNSZoneGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateDNSZoneGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pdzglr) - if err != nil { - return err - } - page.pdzglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateDNSZoneGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateDNSZoneGroupListResultPage) NotDone() bool { - return !page.pdzglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateDNSZoneGroupListResultPage) Response() PrivateDNSZoneGroupListResult { - return page.pdzglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateDNSZoneGroupListResultPage) Values() []PrivateDNSZoneGroup { - if page.pdzglr.IsEmpty() { - return nil - } - return *page.pdzglr.Value -} - -// Creates a new instance of the PrivateDNSZoneGroupListResultPage type. -func NewPrivateDNSZoneGroupListResultPage(cur PrivateDNSZoneGroupListResult, getNextPage func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error)) PrivateDNSZoneGroupListResultPage { - return PrivateDNSZoneGroupListResultPage{ - fn: getNextPage, - pdzglr: cur, - } -} - -// PrivateDNSZoneGroupPropertiesFormat properties of the private dns zone group. -type PrivateDNSZoneGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private dns zone group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateDNSZoneConfigs - A collection of private dns zone configurations of the private dns zone group. - PrivateDNSZoneConfigs *[]PrivateDNSZoneConfig `json:"privateDnsZoneConfigs,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroupPropertiesFormat. -func (pdzgpf PrivateDNSZoneGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzgpf.PrivateDNSZoneConfigs != nil { - objectMap["privateDnsZoneConfigs"] = pdzgpf.PrivateDNSZoneConfigs - } - return json.Marshal(objectMap) -} - -// PrivateDNSZoneGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateDNSZoneGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateDNSZoneGroupsClient) (PrivateDNSZoneGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateDNSZoneGroupsCreateOrUpdateFuture.Result. -func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) result(client PrivateDNSZoneGroupsClient) (pdzg PrivateDNSZoneGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pdzg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pdzg.Response.Response, err = future.GetResult(sender); err == nil && pdzg.Response.Response.StatusCode != http.StatusNoContent { - pdzg, err = client.CreateOrUpdateResponder(pdzg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", pdzg.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateDNSZoneGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateDNSZoneGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateDNSZoneGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateDNSZoneGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateDNSZoneGroupsDeleteFuture.Result. -func (future *PrivateDNSZoneGroupsDeleteFuture) result(client PrivateDNSZoneGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateDNSZonePropertiesFormat properties of the private dns zone configuration resource. -type PrivateDNSZonePropertiesFormat struct { - // PrivateDNSZoneID - The resource id of the private dns zone. - PrivateDNSZoneID *string `json:"privateDnsZoneId,omitempty"` - // RecordSets - READ-ONLY; A collection of information regarding a recordSet, holding information to identify private resources. - RecordSets *[]RecordSet `json:"recordSets,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZonePropertiesFormat. -func (pdzpf PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzpf.PrivateDNSZoneID != nil { - objectMap["privateDnsZoneId"] = pdzpf.PrivateDNSZoneID - } - return json.Marshal(objectMap) -} - -// PrivateEndpoint private endpoint resource. -type PrivateEndpoint struct { - autorest.Response `json:"-"` - // PrivateEndpointProperties - Properties of the private endpoint. - *PrivateEndpointProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if peVar.PrivateEndpointProperties != nil { - objectMap["properties"] = peVar.PrivateEndpointProperties - } - if peVar.ID != nil { - objectMap["id"] = peVar.ID - } - if peVar.Location != nil { - objectMap["location"] = peVar.Location - } - if peVar.Tags != nil { - objectMap["tags"] = peVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpoint struct. -func (peVar *PrivateEndpoint) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointProperties PrivateEndpointProperties - err = json.Unmarshal(*v, &privateEndpointProperties) - if err != nil { - return err - } - peVar.PrivateEndpointProperties = &privateEndpointProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - peVar.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - peVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - peVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - peVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - peVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - peVar.Tags = tags - } - } - } - - return nil -} - -// PrivateEndpointConnection privateEndpointConnection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Properties of the private end point connection. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - if pec.Name != nil { - objectMap["name"] = pec.Name - } - if pec.ID != nil { - objectMap["id"] = pec.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pec.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult response for the ListPrivateEndpointConnection API service call. -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of PrivateEndpointConnection resources for a specific private link service. - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult. -func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if peclr.Value != nil { - objectMap["value"] = peclr.Value - } - return json.Marshal(objectMap) -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { - return peclr.NextLink != nil && len(*peclr.NextLink) != 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !peclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{ - fn: getNextPage, - peclr: cur, - } -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // LinkIdentifier - READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// PrivateEndpointListResult response for the ListPrivateEndpoints API service call. -type PrivateEndpointListResult struct { - autorest.Response `json:"-"` - // Value - A list of private endpoint resources in a resource group. - Value *[]PrivateEndpoint `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointListResult. -func (pelr PrivateEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pelr.Value != nil { - objectMap["value"] = pelr.Value - } - return json.Marshal(objectMap) -} - -// PrivateEndpointListResultIterator provides access to a complete listing of PrivateEndpoint values. -type PrivateEndpointListResultIterator struct { - i int - page PrivateEndpointListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointListResultIterator) Response() PrivateEndpointListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointListResultIterator) Value() PrivateEndpoint { - if !iter.page.NotDone() { - return PrivateEndpoint{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointListResultIterator type. -func NewPrivateEndpointListResultIterator(page PrivateEndpointListResultPage) PrivateEndpointListResultIterator { - return PrivateEndpointListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pelr PrivateEndpointListResult) IsEmpty() bool { - return pelr.Value == nil || len(*pelr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pelr PrivateEndpointListResult) hasNextLink() bool { - return pelr.NextLink != nil && len(*pelr.NextLink) != 0 -} - -// privateEndpointListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pelr PrivateEndpointListResult) privateEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pelr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pelr.NextLink))) -} - -// PrivateEndpointListResultPage contains a page of PrivateEndpoint values. -type PrivateEndpointListResultPage struct { - fn func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error) - pelr PrivateEndpointListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pelr) - if err != nil { - return err - } - page.pelr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointListResultPage) NotDone() bool { - return !page.pelr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointListResultPage) Response() PrivateEndpointListResult { - return page.pelr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointListResultPage) Values() []PrivateEndpoint { - if page.pelr.IsEmpty() { - return nil - } - return *page.pelr.Value -} - -// Creates a new instance of the PrivateEndpointListResultPage type. -func NewPrivateEndpointListResultPage(cur PrivateEndpointListResult, getNextPage func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)) PrivateEndpointListResultPage { - return PrivateEndpointListResultPage{ - fn: getNextPage, - pelr: cur, - } -} - -// PrivateEndpointProperties properties of the private endpoint. -type PrivateEndpointProperties struct { - // Subnet - The ID of the subnet from which the private IP will be allocated. - Subnet *Subnet `json:"subnet,omitempty"` - // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private endpoint. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - // ManualPrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource. - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - // CustomDNSConfigs - An array of custom dns configurations. - CustomDNSConfigs *[]CustomDNSConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointProperties. -func (pep PrivateEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pep.Subnet != nil { - objectMap["subnet"] = pep.Subnet - } - if pep.PrivateLinkServiceConnections != nil { - objectMap["privateLinkServiceConnections"] = pep.PrivateLinkServiceConnections - } - if pep.ManualPrivateLinkServiceConnections != nil { - objectMap["manualPrivateLinkServiceConnections"] = pep.ManualPrivateLinkServiceConnections - } - if pep.CustomDNSConfigs != nil { - objectMap["customDnsConfigs"] = pep.CustomDNSConfigs - } - return json.Marshal(objectMap) -} - -// PrivateEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointsClient) (PrivateEndpoint, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointsCreateOrUpdateFuture.Result. -func (future *PrivateEndpointsCreateOrUpdateFuture) result(client PrivateEndpointsClient) (peVar PrivateEndpoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - peVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if peVar.Response.Response, err = future.GetResult(sender); err == nil && peVar.Response.Response.StatusCode != http.StatusNoContent { - peVar, err = client.CreateOrUpdateResponder(peVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", peVar.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PrivateEndpointsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointsDeleteFuture.Result. -func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkService private link service resource. -type PrivateLinkService struct { - autorest.Response `json:"-"` - // PrivateLinkServiceProperties - Properties of the private link service. - *PrivateLinkServiceProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkService. -func (pls PrivateLinkService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pls.PrivateLinkServiceProperties != nil { - objectMap["properties"] = pls.PrivateLinkServiceProperties - } - if pls.ID != nil { - objectMap["id"] = pls.ID - } - if pls.Location != nil { - objectMap["location"] = pls.Location - } - if pls.Tags != nil { - objectMap["tags"] = pls.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkService struct. -func (pls *PrivateLinkService) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkServiceProperties PrivateLinkServiceProperties - err = json.Unmarshal(*v, &privateLinkServiceProperties) - if err != nil { - return err - } - pls.PrivateLinkServiceProperties = &privateLinkServiceProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pls.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pls.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pls.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pls.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pls.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pls.Tags = tags - } - } - } - - return nil -} - -// PrivateLinkServiceConnection privateLinkServiceConnection resource. -type PrivateLinkServiceConnection struct { - // PrivateLinkServiceConnectionProperties - Properties of the private link service connection. - *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnection. -func (plsc PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsc.PrivateLinkServiceConnectionProperties != nil { - objectMap["properties"] = plsc.PrivateLinkServiceConnectionProperties - } - if plsc.Name != nil { - objectMap["name"] = plsc.Name - } - if plsc.ID != nil { - objectMap["id"] = plsc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkServiceConnection struct. -func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkServiceConnectionProperties PrivateLinkServiceConnectionProperties - err = json.Unmarshal(*v, &privateLinkServiceConnectionProperties) - if err != nil { - return err - } - plsc.PrivateLinkServiceConnectionProperties = &privateLinkServiceConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plsc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - plsc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plsc.ID = &ID - } - } - } - - return nil -} - -// PrivateLinkServiceConnectionProperties properties of the PrivateLinkServiceConnection. -type PrivateLinkServiceConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private link service connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkServiceID - The resource id of private link service. - PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"` - // GroupIds - The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. - GroupIds *[]string `json:"groupIds,omitempty"` - // RequestMessage - A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. - RequestMessage *string `json:"requestMessage,omitempty"` - // PrivateLinkServiceConnectionState - A collection of read-only information about the state of the connection to the remote resource. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionProperties. -func (plscp PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plscp.PrivateLinkServiceID != nil { - objectMap["privateLinkServiceId"] = plscp.PrivateLinkServiceID - } - if plscp.GroupIds != nil { - objectMap["groupIds"] = plscp.GroupIds - } - if plscp.RequestMessage != nil { - objectMap["requestMessage"] = plscp.RequestMessage - } - if plscp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = plscp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *string `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// PrivateLinkServiceIPConfiguration the private link service ip configuration. -type PrivateLinkServiceIPConfiguration struct { - // PrivateLinkServiceIPConfigurationProperties - Properties of the private link service ip configuration. - *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - // Name - The name of private link service ip configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceIPConfiguration. -func (plsic PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsic.PrivateLinkServiceIPConfigurationProperties != nil { - objectMap["properties"] = plsic.PrivateLinkServiceIPConfigurationProperties - } - if plsic.Name != nil { - objectMap["name"] = plsic.Name - } - if plsic.ID != nil { - objectMap["id"] = plsic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkServiceIPConfiguration struct. -func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkServiceIPConfigurationProperties PrivateLinkServiceIPConfigurationProperties - err = json.Unmarshal(*v, &privateLinkServiceIPConfigurationProperties) - if err != nil { - return err - } - plsic.PrivateLinkServiceIPConfigurationProperties = &privateLinkServiceIPConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plsic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - plsic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plsic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plsic.ID = &ID - } - } - } - - return nil -} - -// PrivateLinkServiceIPConfigurationProperties properties of private link service IP configuration. -type PrivateLinkServiceIPConfigurationProperties struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // Primary - Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceIPConfigurationProperties. -func (plsicp PrivateLinkServiceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsicp.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = plsicp.PrivateIPAddress - } - if plsicp.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = plsicp.PrivateIPAllocationMethod - } - if plsicp.Subnet != nil { - objectMap["subnet"] = plsicp.Subnet - } - if plsicp.Primary != nil { - objectMap["primary"] = plsicp.Primary - } - if plsicp.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = plsicp.PrivateIPAddressVersion - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceListResult response for the ListPrivateLinkService API service call. -type PrivateLinkServiceListResult struct { - autorest.Response `json:"-"` - // Value - A list of PrivateLinkService resources in a resource group. - Value *[]PrivateLinkService `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceListResult. -func (plslr PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plslr.Value != nil { - objectMap["value"] = plslr.Value - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceListResultIterator provides access to a complete listing of PrivateLinkService values. -type PrivateLinkServiceListResultIterator struct { - i int - page PrivateLinkServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateLinkServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateLinkServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkServiceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateLinkServiceListResultIterator) Response() PrivateLinkServiceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateLinkServiceListResultIterator) Value() PrivateLinkService { - if !iter.page.NotDone() { - return PrivateLinkService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateLinkServiceListResultIterator type. -func NewPrivateLinkServiceListResultIterator(page PrivateLinkServiceListResultPage) PrivateLinkServiceListResultIterator { - return PrivateLinkServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plslr PrivateLinkServiceListResult) IsEmpty() bool { - return plslr.Value == nil || len(*plslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plslr PrivateLinkServiceListResult) hasNextLink() bool { - return plslr.NextLink != nil && len(*plslr.NextLink) != 0 -} - -// privateLinkServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plslr PrivateLinkServiceListResult) privateLinkServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plslr.NextLink))) -} - -// PrivateLinkServiceListResultPage contains a page of PrivateLinkService values. -type PrivateLinkServiceListResultPage struct { - fn func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error) - plslr PrivateLinkServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateLinkServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plslr) - if err != nil { - return err - } - page.plslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateLinkServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkServiceListResultPage) NotDone() bool { - return !page.plslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateLinkServiceListResultPage) Response() PrivateLinkServiceListResult { - return page.plslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkServiceListResultPage) Values() []PrivateLinkService { - if page.plslr.IsEmpty() { - return nil - } - return *page.plslr.Value -} - -// Creates a new instance of the PrivateLinkServiceListResultPage type. -func NewPrivateLinkServiceListResultPage(cur PrivateLinkServiceListResult, getNextPage func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)) PrivateLinkServiceListResultPage { - return PrivateLinkServiceListResultPage{ - fn: getNextPage, - plslr: cur, - } -} - -// PrivateLinkServiceProperties properties of the private link service. -type PrivateLinkServiceProperties struct { - // LoadBalancerFrontendIPConfigurations - An array of references to the load balancer IP configurations. - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - // IPConfigurations - An array of private link service IP configurations. - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private link service. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpointConnections - READ-ONLY; An array of list about connections to the private endpoint. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // Visibility - The visibility list of the private link service. - Visibility *PrivateLinkServicePropertiesVisibility `json:"visibility,omitempty"` - // AutoApproval - The auto-approval list of the private link service. - AutoApproval *PrivateLinkServicePropertiesAutoApproval `json:"autoApproval,omitempty"` - // Fqdns - The list of Fqdn. - Fqdns *[]string `json:"fqdns,omitempty"` - // Alias - READ-ONLY; The alias of the private link service. - Alias *string `json:"alias,omitempty"` - // EnableProxyProtocol - Whether the private link service is enabled for proxy protocol or not. - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceProperties. -func (plsp PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsp.LoadBalancerFrontendIPConfigurations != nil { - objectMap["loadBalancerFrontendIpConfigurations"] = plsp.LoadBalancerFrontendIPConfigurations - } - if plsp.IPConfigurations != nil { - objectMap["ipConfigurations"] = plsp.IPConfigurations - } - if plsp.Visibility != nil { - objectMap["visibility"] = plsp.Visibility - } - if plsp.AutoApproval != nil { - objectMap["autoApproval"] = plsp.AutoApproval - } - if plsp.Fqdns != nil { - objectMap["fqdns"] = plsp.Fqdns - } - if plsp.EnableProxyProtocol != nil { - objectMap["enableProxyProtocol"] = plsp.EnableProxyProtocol - } - return json.Marshal(objectMap) -} - -// PrivateLinkServicePropertiesAutoApproval the auto-approval list of the private link service. -type PrivateLinkServicePropertiesAutoApproval struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServicePropertiesVisibility the visibility list of the private link service. -type PrivateLinkServicePropertiesVisibility struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture an abstraction for monitoring -// and retrieving the results of a long-running operation. -type PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.Result. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - plsv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { - plsv, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupResponder(plsv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", plsv.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.Result. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - plsv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { - plsv, err = client.CheckPrivateLinkServiceVisibilityResponder(plsv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", plsv.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateLinkServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCreateOrUpdateFuture.Result. -func (future *PrivateLinkServicesCreateOrUpdateFuture) result(client PrivateLinkServicesClient) (pls PrivateLinkService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pls.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pls.Response.Response, err = future.GetResult(sender); err == nil && pls.Response.Response.StatusCode != http.StatusNoContent { - pls, err = client.CreateOrUpdateResponder(pls.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", pls.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateLinkServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesDeleteFuture.Result. -func (future *PrivateLinkServicesDeleteFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkServicesDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type PrivateLinkServicesDeletePrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesDeletePrivateEndpointConnectionFuture.Result. -func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkServiceVisibility response for the CheckPrivateLinkServiceVisibility API service call. -type PrivateLinkServiceVisibility struct { - autorest.Response `json:"-"` - // Visible - Private Link Service Visibility (True/False). - Visible *bool `json:"visible,omitempty"` -} - -// Probe a load balancer probe. -type Probe struct { - autorest.Response `json:"-"` - // ProbePropertiesFormat - Properties of load balancer probe. - *ProbePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Probe. -func (p Probe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.ProbePropertiesFormat != nil { - objectMap["properties"] = p.ProbePropertiesFormat - } - if p.Name != nil { - objectMap["name"] = p.Name - } - if p.ID != nil { - objectMap["id"] = p.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Probe struct. -func (p *Probe) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var probePropertiesFormat ProbePropertiesFormat - err = json.Unmarshal(*v, &probePropertiesFormat) - if err != nil { - return err - } - p.ProbePropertiesFormat = &probePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - p.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - p.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - p.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - p.ID = &ID - } - } - } - - return nil -} - -// ProbePropertiesFormat load balancer probe resource. -type ProbePropertiesFormat struct { - // LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // Protocol - The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' - Protocol ProbeProtocol `json:"protocol,omitempty"` - // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - Port *int32 `json:"port,omitempty"` - // IntervalInSeconds - The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` - // NumberOfProbes - The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. - NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` - // RequestPath - The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. - RequestPath *string `json:"requestPath,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProbePropertiesFormat. -func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppf.Protocol != "" { - objectMap["protocol"] = ppf.Protocol - } - if ppf.Port != nil { - objectMap["port"] = ppf.Port - } - if ppf.IntervalInSeconds != nil { - objectMap["intervalInSeconds"] = ppf.IntervalInSeconds - } - if ppf.NumberOfProbes != nil { - objectMap["numberOfProbes"] = ppf.NumberOfProbes - } - if ppf.RequestPath != nil { - objectMap["requestPath"] = ppf.RequestPath - } - return json.Marshal(objectMap) -} - -// Profile network profile resource. -type Profile struct { - autorest.Response `json:"-"` - // ProfilePropertiesFormat - Network profile properties. - *ProfilePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Profile. -func (p Profile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.ProfilePropertiesFormat != nil { - objectMap["properties"] = p.ProfilePropertiesFormat - } - if p.ID != nil { - objectMap["id"] = p.ID - } - if p.Location != nil { - objectMap["location"] = p.Location - } - if p.Tags != nil { - objectMap["tags"] = p.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Profile struct. -func (p *Profile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var profilePropertiesFormat ProfilePropertiesFormat - err = json.Unmarshal(*v, &profilePropertiesFormat) - if err != nil { - return err - } - p.ProfilePropertiesFormat = &profilePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - p.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - p.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - p.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - p.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - p.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - p.Tags = tags - } - } - } - - return nil -} - -// ProfileListResult response for ListNetworkProfiles API service call. -type ProfileListResult struct { - autorest.Response `json:"-"` - // Value - A list of network profiles that exist in a resource group. - Value *[]Profile `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProfileListResultIterator provides access to a complete listing of Profile values. -type ProfileListResultIterator struct { - i int - page ProfileListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProfileListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProfileListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProfileListResultIterator) Response() ProfileListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProfileListResultIterator) Value() Profile { - if !iter.page.NotDone() { - return Profile{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProfileListResultIterator type. -func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { - return ProfileListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plr ProfileListResult) IsEmpty() bool { - return plr.Value == nil || len(*plr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plr ProfileListResult) hasNextLink() bool { - return plr.NextLink != nil && len(*plr.NextLink) != 0 -} - -// profileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plr.NextLink))) -} - -// ProfileListResultPage contains a page of Profile values. -type ProfileListResultPage struct { - fn func(context.Context, ProfileListResult) (ProfileListResult, error) - plr ProfileListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plr) - if err != nil { - return err - } - page.plr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProfileListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProfileListResultPage) NotDone() bool { - return !page.plr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProfileListResultPage) Response() ProfileListResult { - return page.plr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProfileListResultPage) Values() []Profile { - if page.plr.IsEmpty() { - return nil - } - return *page.plr.Value -} - -// Creates a new instance of the ProfileListResultPage type. -func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { - return ProfileListResultPage{ - fn: getNextPage, - plr: cur, - } -} - -// ProfilePropertiesFormat network profile properties. -type ProfilePropertiesFormat struct { - // ContainerNetworkInterfaces - READ-ONLY; List of child container network interfaces. - ContainerNetworkInterfaces *[]ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty"` - // ContainerNetworkInterfaceConfigurations - List of chid container network interface configurations. - ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network profile resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProfilePropertiesFormat. -func (ppf ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppf.ContainerNetworkInterfaceConfigurations != nil { - objectMap["containerNetworkInterfaceConfigurations"] = ppf.ContainerNetworkInterfaceConfigurations - } - return json.Marshal(objectMap) -} - -// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ProfilesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ProfilesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ProfilesDeleteFuture.Result. -func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ProfilesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PropagatedRouteTable the list of RouteTables to advertise the routes to. -type PropagatedRouteTable struct { - // Labels - The list of labels. - Labels *[]string `json:"labels,omitempty"` - // Ids - The list of resource ids of all the RouteTables. - Ids *[]SubResource `json:"ids,omitempty"` -} - -// ProtocolConfiguration configuration of the protocol. -type ProtocolConfiguration struct { - // HTTPConfiguration - HTTP configuration of the connectivity check. - HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` -} - -// ProtocolCustomSettingsFormat dDoS custom policy properties. -type ProtocolCustomSettingsFormat struct { - // Protocol - The protocol for which the DDoS protection policy is being customized. Possible values include: 'DdosCustomPolicyProtocolTCP', 'DdosCustomPolicyProtocolUDP', 'DdosCustomPolicyProtocolSyn' - Protocol DdosCustomPolicyProtocol `json:"protocol,omitempty"` - // TriggerRateOverride - The customized DDoS protection trigger rate. - TriggerRateOverride *string `json:"triggerRateOverride,omitempty"` - // SourceRateOverride - The customized DDoS protection source rate. - SourceRateOverride *string `json:"sourceRateOverride,omitempty"` - // TriggerSensitivityOverride - The customized DDoS protection trigger rate sensitivity degrees. High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity w.r.t. normal traffic. Possible values include: 'Relaxed', 'Low', 'Default', 'High' - TriggerSensitivityOverride DdosCustomPolicyTriggerSensitivityOverride `json:"triggerSensitivityOverride,omitempty"` -} - -// PublicIPAddress public IP address resource. -type PublicIPAddress struct { - autorest.Response `json:"-"` - // Sku - The public IP address SKU. - Sku *PublicIPAddressSku `json:"sku,omitempty"` - // PublicIPAddressPropertiesFormat - Public IP address properties. - *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PublicIPAddress. -func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pia.Sku != nil { - objectMap["sku"] = pia.Sku - } - if pia.PublicIPAddressPropertiesFormat != nil { - objectMap["properties"] = pia.PublicIPAddressPropertiesFormat - } - if pia.Zones != nil { - objectMap["zones"] = pia.Zones - } - if pia.ID != nil { - objectMap["id"] = pia.ID - } - if pia.Location != nil { - objectMap["location"] = pia.Location - } - if pia.Tags != nil { - objectMap["tags"] = pia.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. -func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - pia.Sku = &sku - } - case "properties": - if v != nil { - var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat - err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) - if err != nil { - return err - } - pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pia.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - pia.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pia.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pia.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pia.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pia.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pia.Tags = tags - } - } - } - - return nil -} - -// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address. -type PublicIPAddressDNSSettings struct { - // DomainNameLabel - The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - // Fqdn - The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. - Fqdn *string `json:"fqdn,omitempty"` - // ReverseFqdn - The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} - -// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PublicIPAddressesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPAddressesClient) (PublicIPAddress, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. -func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pia.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { - pia, err = client.CreateOrUpdateResponder(pia.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request") - } - } - return -} - -// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PublicIPAddressesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPAddressesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPAddressesDeleteFuture.Result. -func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PublicIPAddressListResult response for ListPublicIpAddresses API service call. -type PublicIPAddressListResult struct { - autorest.Response `json:"-"` - // Value - A list of public IP addresses that exists in a resource group. - Value *[]PublicIPAddress `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. -type PublicIPAddressListResultIterator struct { - i int - page PublicIPAddressListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PublicIPAddressListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PublicIPAddressListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { - if !iter.page.NotDone() { - return PublicIPAddress{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PublicIPAddressListResultIterator type. -func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator { - return PublicIPAddressListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pialr PublicIPAddressListResult) IsEmpty() bool { - return pialr.Value == nil || len(*pialr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pialr PublicIPAddressListResult) hasNextLink() bool { - return pialr.NextLink != nil && len(*pialr.NextLink) != 0 -} - -// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pialr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pialr.NextLink))) -} - -// PublicIPAddressListResultPage contains a page of PublicIPAddress values. -type PublicIPAddressListResultPage struct { - fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error) - pialr PublicIPAddressListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pialr) - if err != nil { - return err - } - page.pialr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PublicIPAddressListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PublicIPAddressListResultPage) NotDone() bool { - return !page.pialr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { - return page.pialr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { - if page.pialr.IsEmpty() { - return nil - } - return *page.pialr.Value -} - -// Creates a new instance of the PublicIPAddressListResultPage type. -func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { - return PublicIPAddressListResultPage{ - fn: getNextPage, - pialr: cur, - } -} - -// PublicIPAddressPropertiesFormat public IP address properties. -type PublicIPAddressPropertiesFormat struct { - // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'Static', 'Dynamic' - PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address. - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - // DNSSettings - The FQDN of the DNS record associated with the public IP address. - DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` - // DdosSettings - The DDoS protection custom policy associated with the public IP address. - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - // IPTags - The list of tags associated with the public IP address. - IPTags *[]IPTag `json:"ipTags,omitempty"` - // IPAddress - The IP address associated with the public IP address resource. - IPAddress *string `json:"ipAddress,omitempty"` - // PublicIPPrefix - The Public IP Prefix this Public IP Address should be allocated from. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the public IP address resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP address resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. -func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if piapf.PublicIPAllocationMethod != "" { - objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod - } - if piapf.PublicIPAddressVersion != "" { - objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion - } - if piapf.DNSSettings != nil { - objectMap["dnsSettings"] = piapf.DNSSettings - } - if piapf.DdosSettings != nil { - objectMap["ddosSettings"] = piapf.DdosSettings - } - if piapf.IPTags != nil { - objectMap["ipTags"] = piapf.IPTags - } - if piapf.IPAddress != nil { - objectMap["ipAddress"] = piapf.IPAddress - } - if piapf.PublicIPPrefix != nil { - objectMap["publicIPPrefix"] = piapf.PublicIPPrefix - } - if piapf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes - } - return json.Marshal(objectMap) -} - -// PublicIPAddressSku SKU of a public IP address. -type PublicIPAddressSku struct { - // Name - Name of a public IP address SKU. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' - Name PublicIPAddressSkuName `json:"name,omitempty"` -} - -// PublicIPPrefix public IP prefix resource. -type PublicIPPrefix struct { - autorest.Response `json:"-"` - // Sku - The public IP prefix SKU. - Sku *PublicIPPrefixSku `json:"sku,omitempty"` - // PublicIPPrefixPropertiesFormat - Public IP prefix properties. - *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PublicIPPrefix. -func (pip PublicIPPrefix) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pip.Sku != nil { - objectMap["sku"] = pip.Sku - } - if pip.PublicIPPrefixPropertiesFormat != nil { - objectMap["properties"] = pip.PublicIPPrefixPropertiesFormat - } - if pip.Zones != nil { - objectMap["zones"] = pip.Zones - } - if pip.ID != nil { - objectMap["id"] = pip.ID - } - if pip.Location != nil { - objectMap["location"] = pip.Location - } - if pip.Tags != nil { - objectMap["tags"] = pip.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PublicIPPrefix struct. -func (pip *PublicIPPrefix) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku PublicIPPrefixSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - pip.Sku = &sku - } - case "properties": - if v != nil { - var publicIPPrefixPropertiesFormat PublicIPPrefixPropertiesFormat - err = json.Unmarshal(*v, &publicIPPrefixPropertiesFormat) - if err != nil { - return err - } - pip.PublicIPPrefixPropertiesFormat = &publicIPPrefixPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pip.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - pip.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pip.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pip.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pip.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pip.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pip.Tags = tags - } - } - } - - return nil -} - -// PublicIPPrefixesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PublicIPPrefixesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPPrefixesClient) (PublicIPPrefix, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPPrefixesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPPrefixesCreateOrUpdateFuture.Result. -func (future *PublicIPPrefixesCreateOrUpdateFuture) result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pip.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pip.Response.Response, err = future.GetResult(sender); err == nil && pip.Response.Response.StatusCode != http.StatusNoContent { - pip, err = client.CreateOrUpdateResponder(pip.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", pip.Response.Response, "Failure responding to request") - } - } - return -} - -// PublicIPPrefixesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PublicIPPrefixesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPPrefixesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPPrefixesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPPrefixesDeleteFuture.Result. -func (future *PublicIPPrefixesDeleteFuture) result(client PublicIPPrefixesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PublicIPPrefixListResult response for ListPublicIpPrefixes API service call. -type PublicIPPrefixListResult struct { - autorest.Response `json:"-"` - // Value - A list of public IP prefixes that exists in a resource group. - Value *[]PublicIPPrefix `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PublicIPPrefixListResultIterator provides access to a complete listing of PublicIPPrefix values. -type PublicIPPrefixListResultIterator struct { - i int - page PublicIPPrefixListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PublicIPPrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PublicIPPrefixListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PublicIPPrefixListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PublicIPPrefixListResultIterator) Response() PublicIPPrefixListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PublicIPPrefixListResultIterator) Value() PublicIPPrefix { - if !iter.page.NotDone() { - return PublicIPPrefix{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PublicIPPrefixListResultIterator type. -func NewPublicIPPrefixListResultIterator(page PublicIPPrefixListResultPage) PublicIPPrefixListResultIterator { - return PublicIPPrefixListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (piplr PublicIPPrefixListResult) IsEmpty() bool { - return piplr.Value == nil || len(*piplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (piplr PublicIPPrefixListResult) hasNextLink() bool { - return piplr.NextLink != nil && len(*piplr.NextLink) != 0 -} - -// publicIPPrefixListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (piplr PublicIPPrefixListResult) publicIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { - if !piplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(piplr.NextLink))) -} - -// PublicIPPrefixListResultPage contains a page of PublicIPPrefix values. -type PublicIPPrefixListResultPage struct { - fn func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error) - piplr PublicIPPrefixListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PublicIPPrefixListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.piplr) - if err != nil { - return err - } - page.piplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PublicIPPrefixListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PublicIPPrefixListResultPage) NotDone() bool { - return !page.piplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PublicIPPrefixListResultPage) Response() PublicIPPrefixListResult { - return page.piplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PublicIPPrefixListResultPage) Values() []PublicIPPrefix { - if page.piplr.IsEmpty() { - return nil - } - return *page.piplr.Value -} - -// Creates a new instance of the PublicIPPrefixListResultPage type. -func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)) PublicIPPrefixListResultPage { - return PublicIPPrefixListResultPage{ - fn: getNextPage, - piplr: cur, - } -} - -// PublicIPPrefixPropertiesFormat public IP prefix properties. -type PublicIPPrefixPropertiesFormat struct { - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // IPTags - The list of tags associated with the public IP prefix. - IPTags *[]IPTag `json:"ipTags,omitempty"` - // PrefixLength - The Length of the Public IP Prefix. - PrefixLength *int32 `json:"prefixLength,omitempty"` - // IPPrefix - READ-ONLY; The allocated Prefix. - IPPrefix *string `json:"ipPrefix,omitempty"` - // PublicIPAddresses - READ-ONLY; The list of all referenced PublicIPAddresses. - PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"` - // LoadBalancerFrontendIPConfiguration - READ-ONLY; The reference to load balancer frontend IP configuration associated with the public IP prefix. - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the public IP prefix resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PublicIPPrefixPropertiesFormat. -func (pippf PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pippf.PublicIPAddressVersion != "" { - objectMap["publicIPAddressVersion"] = pippf.PublicIPAddressVersion - } - if pippf.IPTags != nil { - objectMap["ipTags"] = pippf.IPTags - } - if pippf.PrefixLength != nil { - objectMap["prefixLength"] = pippf.PrefixLength - } - return json.Marshal(objectMap) -} - -// PublicIPPrefixSku SKU of a public IP prefix. -type PublicIPPrefixSku struct { - // Name - Name of a public IP prefix SKU. Possible values include: 'PublicIPPrefixSkuNameStandard' - Name PublicIPPrefixSkuName `json:"name,omitempty"` -} - -// PutBastionShareableLinkAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PutBastionShareableLinkAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionShareableLinkListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PutBastionShareableLinkAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PutBastionShareableLinkAllFuture.Result. -func (future *PutBastionShareableLinkAllFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bsllrp.bsllr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent { - bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request") - } - } - return -} - -// PutBastionShareableLinkFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PutBastionShareableLinkFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionShareableLinkListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PutBastionShareableLinkFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PutBastionShareableLinkFuture.Result. -func (future *PutBastionShareableLinkFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bsllrp.bsllr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent { - bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request") - } - } - return -} - -// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. -type QueryTroubleshootingParameters struct { - // TargetResourceID - The target resource ID to query the troubleshooting result. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// RadiusServer radius Server Settings. -type RadiusServer struct { - // RadiusServerAddress - The address of this radius server. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerScore - The initial score assigned to this radius server. - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - // RadiusServerSecret - The secret used for this radius server. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} - -// RecordSet a collective group of information about the record set information. -type RecordSet struct { - // RecordType - Resource record type. - RecordType *string `json:"recordType,omitempty"` - // RecordSetName - Recordset name. - RecordSetName *string `json:"recordSetName,omitempty"` - // Fqdn - Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the recordset. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // TTL - Recordset time to live. - TTL *int32 `json:"ttl,omitempty"` - // IPAddresses - The private ip address of the private endpoint. - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecordSet. -func (rs RecordSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rs.RecordType != nil { - objectMap["recordType"] = rs.RecordType - } - if rs.RecordSetName != nil { - objectMap["recordSetName"] = rs.RecordSetName - } - if rs.Fqdn != nil { - objectMap["fqdn"] = rs.Fqdn - } - if rs.TTL != nil { - objectMap["ttl"] = rs.TTL - } - if rs.IPAddresses != nil { - objectMap["ipAddresses"] = rs.IPAddresses - } - return json.Marshal(objectMap) -} - -// ReferencedPublicIPAddress reference to a public IP address. -type ReferencedPublicIPAddress struct { - // ID - The PublicIPAddress Reference. - ID *string `json:"id,omitempty"` -} - -// Resource common resource representation. -type Resource struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.ID != nil { - objectMap["id"] = r.ID - } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceNavigationLink resourceNavigationLink resource. -type ResourceNavigationLink struct { - // ResourceNavigationLinkFormat - Resource navigation link properties format. - *ResourceNavigationLinkFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLink. -func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnl.ResourceNavigationLinkFormat != nil { - objectMap["properties"] = rnl.ResourceNavigationLinkFormat - } - if rnl.Name != nil { - objectMap["name"] = rnl.Name - } - if rnl.ID != nil { - objectMap["id"] = rnl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. -func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var resourceNavigationLinkFormat ResourceNavigationLinkFormat - err = json.Unmarshal(*v, &resourceNavigationLinkFormat) - if err != nil { - return err - } - rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rnl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rnl.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rnl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rnl.ID = &ID - } - } - } - - return nil -} - -// ResourceNavigationLinkFormat properties of ResourceNavigationLink. -type ResourceNavigationLinkFormat struct { - // LinkedResourceType - Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - // Link - Link to the external resource. - Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource navigation link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. -func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnlf.LinkedResourceType != nil { - objectMap["linkedResourceType"] = rnlf.LinkedResourceType - } - if rnlf.Link != nil { - objectMap["link"] = rnlf.Link - } - return json.Marshal(objectMap) -} - -// ResourceNavigationLinksListResult response for ResourceNavigationLinks_List operation. -type ResourceNavigationLinksListResult struct { - autorest.Response `json:"-"` - // Value - The resource navigation links in a subnet. - Value *[]ResourceNavigationLink `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLinksListResult. -func (rnllr ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnllr.Value != nil { - objectMap["value"] = rnllr.Value - } - return json.Marshal(objectMap) -} - -// ResourceSet the base resource set for visibility and auto-approval. -type ResourceSet struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// RetentionPolicyParameters parameters that define the retention policy for flow log. -type RetentionPolicyParameters struct { - // Days - Number of days to retain flow log records. - Days *int32 `json:"days,omitempty"` - // Enabled - Flag to enable/disable retention. - Enabled *bool `json:"enabled,omitempty"` -} - -// Route route resource. -type Route struct { - autorest.Response `json:"-"` - // RoutePropertiesFormat - Properties of the route. - *RoutePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Route. -func (r Route) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.RoutePropertiesFormat != nil { - objectMap["properties"] = r.RoutePropertiesFormat - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.ID != nil { - objectMap["id"] = r.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Route struct. -func (r *Route) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routePropertiesFormat RoutePropertiesFormat - err = json.Unmarshal(*v, &routePropertiesFormat) - if err != nil { - return err - } - r.RoutePropertiesFormat = &routePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - r.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - r.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - r.ID = &ID - } - } - } - - return nil -} - -// RouteFilter route Filter Resource. -type RouteFilter struct { - autorest.Response `json:"-"` - // RouteFilterPropertiesFormat - Properties of the route filter. - *RouteFilterPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RouteFilter. -func (rf RouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rf.RouteFilterPropertiesFormat != nil { - objectMap["properties"] = rf.RouteFilterPropertiesFormat - } - if rf.ID != nil { - objectMap["id"] = rf.ID - } - if rf.Location != nil { - objectMap["location"] = rf.Location - } - if rf.Tags != nil { - objectMap["tags"] = rf.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. -func (rf *RouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterPropertiesFormat RouteFilterPropertiesFormat - err = json.Unmarshal(*v, &routeFilterPropertiesFormat) - if err != nil { - return err - } - rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rf.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rf.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rf.Tags = tags - } - } - } - - return nil -} - -// RouteFilterListResult response for the ListRouteFilters API service call. -type RouteFilterListResult struct { - autorest.Response `json:"-"` - // Value - A list of route filters in a resource group. - Value *[]RouteFilter `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteFilterListResultIterator provides access to a complete listing of RouteFilter values. -type RouteFilterListResultIterator struct { - i int - page RouteFilterListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteFilterListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteFilterListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteFilterListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteFilterListResultIterator) Response() RouteFilterListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteFilterListResultIterator) Value() RouteFilter { - if !iter.page.NotDone() { - return RouteFilter{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteFilterListResultIterator type. -func NewRouteFilterListResultIterator(page RouteFilterListResultPage) RouteFilterListResultIterator { - return RouteFilterListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rflr RouteFilterListResult) IsEmpty() bool { - return rflr.Value == nil || len(*rflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rflr RouteFilterListResult) hasNextLink() bool { - return rflr.NextLink != nil && len(*rflr.NextLink) != 0 -} - -// routeFilterListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rflr.NextLink))) -} - -// RouteFilterListResultPage contains a page of RouteFilter values. -type RouteFilterListResultPage struct { - fn func(context.Context, RouteFilterListResult) (RouteFilterListResult, error) - rflr RouteFilterListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rflr) - if err != nil { - return err - } - page.rflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteFilterListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteFilterListResultPage) NotDone() bool { - return !page.rflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteFilterListResultPage) Response() RouteFilterListResult { - return page.rflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteFilterListResultPage) Values() []RouteFilter { - if page.rflr.IsEmpty() { - return nil - } - return *page.rflr.Value -} - -// Creates a new instance of the RouteFilterListResultPage type. -func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage { - return RouteFilterListResultPage{ - fn: getNextPage, - rflr: cur, - } -} - -// RouteFilterPropertiesFormat route Filter Resource. -type RouteFilterPropertiesFormat struct { - // Rules - Collection of RouteFilterRules contained within a route filter. - Rules *[]RouteFilterRule `json:"rules,omitempty"` - // Peerings - READ-ONLY; A collection of references to express route circuit peerings. - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - // Ipv6Peerings - READ-ONLY; A collection of references to express route circuit ipv6 peerings. - Ipv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat. -func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfpf.Rules != nil { - objectMap["rules"] = rfpf.Rules - } - return json.Marshal(objectMap) -} - -// RouteFilterRule route Filter Rule Resource. -type RouteFilterRule struct { - autorest.Response `json:"-"` - // RouteFilterRulePropertiesFormat - Properties of the route filter rule. - *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterRule. -func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfr.RouteFilterRulePropertiesFormat != nil { - objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat - } - if rfr.Name != nil { - objectMap["name"] = rfr.Name - } - if rfr.Location != nil { - objectMap["location"] = rfr.Location - } - if rfr.ID != nil { - objectMap["id"] = rfr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. -func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat - err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) - if err != nil { - return err - } - rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rfr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rfr.Location = &location - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rfr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rfr.ID = &ID - } - } - } - - return nil -} - -// RouteFilterRuleListResult response for the ListRouteFilterRules API service call. -type RouteFilterRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of RouteFilterRules in a resource group. - Value *[]RouteFilterRule `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteFilterRuleListResultIterator provides access to a complete listing of RouteFilterRule values. -type RouteFilterRuleListResultIterator struct { - i int - page RouteFilterRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteFilterRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteFilterRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteFilterRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule { - if !iter.page.NotDone() { - return RouteFilterRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteFilterRuleListResultIterator type. -func NewRouteFilterRuleListResultIterator(page RouteFilterRuleListResultPage) RouteFilterRuleListResultIterator { - return RouteFilterRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { - return rfrlr.Value == nil || len(*rfrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rfrlr RouteFilterRuleListResult) hasNextLink() bool { - return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0 -} - -// routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rfrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rfrlr.NextLink))) -} - -// RouteFilterRuleListResultPage contains a page of RouteFilterRule values. -type RouteFilterRuleListResultPage struct { - fn func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error) - rfrlr RouteFilterRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rfrlr) - if err != nil { - return err - } - page.rfrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteFilterRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteFilterRuleListResultPage) NotDone() bool { - return !page.rfrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult { - return page.rfrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule { - if page.rfrlr.IsEmpty() { - return nil - } - return *page.rfrlr.Value -} - -// Creates a new instance of the RouteFilterRuleListResultPage type. -func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage { - return RouteFilterRuleListResultPage{ - fn: getNextPage, - rfrlr: cur, - } -} - -// RouteFilterRulePropertiesFormat route Filter Rule Resource. -type RouteFilterRulePropertiesFormat struct { - // Access - The access type of the rule. Possible values include: 'Allow', 'Deny' - Access Access `json:"access,omitempty"` - // RouteFilterRuleType - The rule type of the rule. - RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` - // Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - Communities *[]string `json:"communities,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat. -func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfrpf.Access != "" { - objectMap["access"] = rfrpf.Access - } - if rfrpf.RouteFilterRuleType != nil { - objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType - } - if rfrpf.Communities != nil { - objectMap["communities"] = rfrpf.Communities - } - return json.Marshal(objectMap) -} - -// RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteFilterRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFilterRulesClient) (RouteFilterRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFilterRulesCreateOrUpdateFuture.Result. -func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rfr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent { - rfr, err = client.CreateOrUpdateResponder(rfr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteFilterRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFilterRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFilterRulesDeleteFuture.Result. -func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteFiltersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFiltersClient) (RouteFilter, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFiltersCreateOrUpdateFuture.Result. -func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rf.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent { - rf, err = client.CreateOrUpdateResponder(rf.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", rf.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteFiltersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFiltersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFiltersDeleteFuture.Result. -func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteListResult response for the ListRoute API service call. -type RouteListResult struct { - autorest.Response `json:"-"` - // Value - A list of routes in a resource group. - Value *[]Route `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteListResultIterator provides access to a complete listing of Route values. -type RouteListResultIterator struct { - i int - page RouteListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteListResultIterator) Response() RouteListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteListResultIterator) Value() Route { - if !iter.page.NotDone() { - return Route{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteListResultIterator type. -func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { - return RouteListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rlr RouteListResult) IsEmpty() bool { - return rlr.Value == nil || len(*rlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rlr RouteListResult) hasNextLink() bool { - return rlr.NextLink != nil && len(*rlr.NextLink) != 0 -} - -// routeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rlr.NextLink))) -} - -// RouteListResultPage contains a page of Route values. -type RouteListResultPage struct { - fn func(context.Context, RouteListResult) (RouteListResult, error) - rlr RouteListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err - } - page.rlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteListResultPage) NotDone() bool { - return !page.rlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteListResultPage) Response() RouteListResult { - return page.rlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteListResultPage) Values() []Route { - if page.rlr.IsEmpty() { - return nil - } - return *page.rlr.Value -} - -// Creates a new instance of the RouteListResultPage type. -func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { - return RouteListResultPage{ - fn: getNextPage, - rlr: cur, - } -} - -// RoutePropertiesFormat route resource. -type RoutePropertiesFormat struct { - // AddressPrefix - The destination CIDR to which the route applies. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // NextHopType - The type of Azure hop the packet should be sent to. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' - NextHopType RouteNextHopType `json:"nextHopType,omitempty"` - // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoutePropertiesFormat. -func (rpf RoutePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpf.AddressPrefix != nil { - objectMap["addressPrefix"] = rpf.AddressPrefix - } - if rpf.NextHopType != "" { - objectMap["nextHopType"] = rpf.NextHopType - } - if rpf.NextHopIPAddress != nil { - objectMap["nextHopIpAddress"] = rpf.NextHopIPAddress - } - return json.Marshal(objectMap) -} - -// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutesClient) (Route, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutesCreateOrUpdateFuture.Result. -func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - r.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { - r, err = client.CreateOrUpdateResponder(r.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RoutesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutesDeleteFuture.Result. -func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteTable route table resource. -type RouteTable struct { - autorest.Response `json:"-"` - // RouteTablePropertiesFormat - Properties of the route table. - *RouteTablePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RouteTable. -func (rt RouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rt.RouteTablePropertiesFormat != nil { - objectMap["properties"] = rt.RouteTablePropertiesFormat - } - if rt.ID != nil { - objectMap["id"] = rt.ID - } - if rt.Location != nil { - objectMap["location"] = rt.Location - } - if rt.Tags != nil { - objectMap["tags"] = rt.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteTable struct. -func (rt *RouteTable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeTablePropertiesFormat RouteTablePropertiesFormat - err = json.Unmarshal(*v, &routeTablePropertiesFormat) - if err != nil { - return err - } - rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rt.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rt.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rt.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rt.Tags = tags - } - } - } - - return nil -} - -// RouteTableListResult response for the ListRouteTable API service call. -type RouteTableListResult struct { - autorest.Response `json:"-"` - // Value - A list of route tables in a resource group. - Value *[]RouteTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteTableListResultIterator provides access to a complete listing of RouteTable values. -type RouteTableListResultIterator struct { - i int - page RouteTableListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteTableListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteTableListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteTableListResultIterator) Response() RouteTableListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteTableListResultIterator) Value() RouteTable { - if !iter.page.NotDone() { - return RouteTable{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteTableListResultIterator type. -func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator { - return RouteTableListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rtlr RouteTableListResult) IsEmpty() bool { - return rtlr.Value == nil || len(*rtlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rtlr RouteTableListResult) hasNextLink() bool { - return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 -} - -// routeTableListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rtlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rtlr.NextLink))) -} - -// RouteTableListResultPage contains a page of RouteTable values. -type RouteTableListResultPage struct { - fn func(context.Context, RouteTableListResult) (RouteTableListResult, error) - rtlr RouteTableListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rtlr) - if err != nil { - return err - } - page.rtlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteTableListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteTableListResultPage) NotDone() bool { - return !page.rtlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteTableListResultPage) Response() RouteTableListResult { - return page.rtlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteTableListResultPage) Values() []RouteTable { - if page.rtlr.IsEmpty() { - return nil - } - return *page.rtlr.Value -} - -// Creates a new instance of the RouteTableListResultPage type. -func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { - return RouteTableListResultPage{ - fn: getNextPage, - rtlr: cur, - } -} - -// RouteTablePropertiesFormat route Table resource. -type RouteTablePropertiesFormat struct { - // Routes - Collection of routes contained within a route table. - Routes *[]Route `json:"routes,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // DisableBgpRoutePropagation - Whether to disable the routes learned by BGP on that route table. True means disable. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route table resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. -func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rtpf.Routes != nil { - objectMap["routes"] = rtpf.Routes - } - if rtpf.DisableBgpRoutePropagation != nil { - objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation - } - return json.Marshal(objectMap) -} - -// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteTablesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteTablesClient) (RouteTable, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. -func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { - rt, err = client.CreateOrUpdateResponder(rt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteTablesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteTablesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteTablesDeleteFuture.Result. -func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RoutingConfiguration routing Configuration indicating the associated and propagated route tables for -// this connection. -type RoutingConfiguration struct { - // AssociatedRouteTable - The resource id RouteTable associated with this RoutingConfiguration. - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - // PropagatedRouteTables - The list of RouteTables to advertise the routes to. - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - // VnetRoutes - List of routes that control routing from VirtualHub into a virtual network connection. - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} - -// Rule rule of type network. -type Rule struct { - // IPProtocols - Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // DestinationIPGroups - List of destination IpGroups for this rule. - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - // DestinationFqdns - List of destination FQDNs. - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for Rule. -func (r Rule) MarshalJSON() ([]byte, error) { - r.RuleType = RuleTypeNetworkRule - objectMap := make(map[string]interface{}) - if r.IPProtocols != nil { - objectMap["ipProtocols"] = r.IPProtocols - } - if r.SourceAddresses != nil { - objectMap["sourceAddresses"] = r.SourceAddresses - } - if r.DestinationAddresses != nil { - objectMap["destinationAddresses"] = r.DestinationAddresses - } - if r.DestinationPorts != nil { - objectMap["destinationPorts"] = r.DestinationPorts - } - if r.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = r.SourceIPGroups - } - if r.DestinationIPGroups != nil { - objectMap["destinationIpGroups"] = r.DestinationIPGroups - } - if r.DestinationFqdns != nil { - objectMap["destinationFqdns"] = r.DestinationFqdns - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Description != nil { - objectMap["description"] = r.Description - } - if r.RuleType != "" { - objectMap["ruleType"] = r.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsRule() (*Rule, bool) { - return &r, true -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &r, true -} - -// SecurityGroup networkSecurityGroup resource. -type SecurityGroup struct { - autorest.Response `json:"-"` - // SecurityGroupPropertiesFormat - Properties of the network security group. - *SecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SecurityGroup. -func (sg SecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sg.SecurityGroupPropertiesFormat != nil { - objectMap["properties"] = sg.SecurityGroupPropertiesFormat - } - if sg.ID != nil { - objectMap["id"] = sg.ID - } - if sg.Location != nil { - objectMap["location"] = sg.Location - } - if sg.Tags != nil { - objectMap["tags"] = sg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. -func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityGroupPropertiesFormat SecurityGroupPropertiesFormat - err = json.Unmarshal(*v, &securityGroupPropertiesFormat) - if err != nil { - return err - } - sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sg.Tags = tags - } - } - } - - return nil -} - -// SecurityGroupListResult response for ListNetworkSecurityGroups API service call. -type SecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of NetworkSecurityGroup resources. - Value *[]SecurityGroup `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. -type SecurityGroupListResultIterator struct { - i int - page SecurityGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityGroupListResultIterator) Value() SecurityGroup { - if !iter.page.NotDone() { - return SecurityGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityGroupListResultIterator type. -func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator { - return SecurityGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sglr SecurityGroupListResult) IsEmpty() bool { - return sglr.Value == nil || len(*sglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sglr SecurityGroupListResult) hasNextLink() bool { - return sglr.NextLink != nil && len(*sglr.NextLink) != 0 -} - -// securityGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sglr.NextLink))) -} - -// SecurityGroupListResultPage contains a page of SecurityGroup values. -type SecurityGroupListResultPage struct { - fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error) - sglr SecurityGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sglr) - if err != nil { - return err - } - page.sglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityGroupListResultPage) NotDone() bool { - return !page.sglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { - return page.sglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityGroupListResultPage) Values() []SecurityGroup { - if page.sglr.IsEmpty() { - return nil - } - return *page.sglr.Value -} - -// Creates a new instance of the SecurityGroupListResultPage type. -func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { - return SecurityGroupListResultPage{ - fn: getNextPage, - sglr: cur, - } -} - -// SecurityGroupNetworkInterface network interface and all its associated security rules. -type SecurityGroupNetworkInterface struct { - // ID - ID of the network interface. - ID *string `json:"id,omitempty"` - // SecurityRuleAssociations - All security rules associated with the network interface. - SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` -} - -// SecurityGroupPropertiesFormat network Security Group resource. -type SecurityGroupPropertiesFormat struct { - // SecurityRules - A collection of security rules of the network security group. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - // DefaultSecurityRules - READ-ONLY; The default security rules of network security group. - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - // NetworkInterfaces - READ-ONLY; A collection of references to network interfaces. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // FlowLogs - READ-ONLY; A collection of references to flow log resources. - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network security group resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. -func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgpf.SecurityRules != nil { - objectMap["securityRules"] = sgpf.SecurityRules - } - return json.Marshal(objectMap) -} - -// SecurityGroupResult network configuration diagnostic result corresponded provided traffic query. -type SecurityGroupResult struct { - // SecurityRuleAccessResult - The network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - SecurityRuleAccessResult SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"` - // EvaluatedNetworkSecurityGroups - READ-ONLY; List of results network security groups diagnostic. - EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityGroupResult. -func (sgr SecurityGroupResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgr.SecurityRuleAccessResult != "" { - objectMap["securityRuleAccessResult"] = sgr.SecurityRuleAccessResult - } - return json.Marshal(objectMap) -} - -// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityGroupsClient) (SecurityGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. -func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { - sg, err = client.CreateOrUpdateResponder(sg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SecurityGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityGroupsDeleteFuture.Result. -func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityGroupViewParameters parameters that define the VM to check security groups for. -type SecurityGroupViewParameters struct { - // TargetResourceID - ID of the target VM. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// SecurityGroupViewResult the information about security rules applied to the specified VM. -type SecurityGroupViewResult struct { - autorest.Response `json:"-"` - // NetworkInterfaces - List of network interfaces on the specified VM. - NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` -} - -// SecurityPartnerProvider security Partner Provider resource. -type SecurityPartnerProvider struct { - autorest.Response `json:"-"` - // SecurityPartnerProviderPropertiesFormat - Properties of the Security Partner Provider. - *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SecurityPartnerProvider. -func (spp SecurityPartnerProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spp.SecurityPartnerProviderPropertiesFormat != nil { - objectMap["properties"] = spp.SecurityPartnerProviderPropertiesFormat - } - if spp.ID != nil { - objectMap["id"] = spp.ID - } - if spp.Location != nil { - objectMap["location"] = spp.Location - } - if spp.Tags != nil { - objectMap["tags"] = spp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityPartnerProvider struct. -func (spp *SecurityPartnerProvider) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityPartnerProviderPropertiesFormat SecurityPartnerProviderPropertiesFormat - err = json.Unmarshal(*v, &securityPartnerProviderPropertiesFormat) - if err != nil { - return err - } - spp.SecurityPartnerProviderPropertiesFormat = &securityPartnerProviderPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - spp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spp.Tags = tags - } - } - } - - return nil -} - -// SecurityPartnerProviderListResult response for ListSecurityPartnerProviders API service call. -type SecurityPartnerProviderListResult struct { - autorest.Response `json:"-"` - // Value - List of Security Partner Providers in a resource group. - Value *[]SecurityPartnerProvider `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityPartnerProviderListResultIterator provides access to a complete listing of -// SecurityPartnerProvider values. -type SecurityPartnerProviderListResultIterator struct { - i int - page SecurityPartnerProviderListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityPartnerProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityPartnerProviderListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityPartnerProviderListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityPartnerProviderListResultIterator) Response() SecurityPartnerProviderListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityPartnerProviderListResultIterator) Value() SecurityPartnerProvider { - if !iter.page.NotDone() { - return SecurityPartnerProvider{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityPartnerProviderListResultIterator type. -func NewSecurityPartnerProviderListResultIterator(page SecurityPartnerProviderListResultPage) SecurityPartnerProviderListResultIterator { - return SecurityPartnerProviderListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (spplr SecurityPartnerProviderListResult) IsEmpty() bool { - return spplr.Value == nil || len(*spplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (spplr SecurityPartnerProviderListResult) hasNextLink() bool { - return spplr.NextLink != nil && len(*spplr.NextLink) != 0 -} - -// securityPartnerProviderListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (spplr SecurityPartnerProviderListResult) securityPartnerProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if !spplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(spplr.NextLink))) -} - -// SecurityPartnerProviderListResultPage contains a page of SecurityPartnerProvider values. -type SecurityPartnerProviderListResultPage struct { - fn func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error) - spplr SecurityPartnerProviderListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityPartnerProviderListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.spplr) - if err != nil { - return err - } - page.spplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityPartnerProviderListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityPartnerProviderListResultPage) NotDone() bool { - return !page.spplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityPartnerProviderListResultPage) Response() SecurityPartnerProviderListResult { - return page.spplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityPartnerProviderListResultPage) Values() []SecurityPartnerProvider { - if page.spplr.IsEmpty() { - return nil - } - return *page.spplr.Value -} - -// Creates a new instance of the SecurityPartnerProviderListResultPage type. -func NewSecurityPartnerProviderListResultPage(cur SecurityPartnerProviderListResult, getNextPage func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error)) SecurityPartnerProviderListResultPage { - return SecurityPartnerProviderListResultPage{ - fn: getNextPage, - spplr: cur, - } -} - -// SecurityPartnerProviderPropertiesFormat properties of the Security Partner Provider. -type SecurityPartnerProviderPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Security Partner Provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' - SecurityProviderName SecurityProviderName `json:"securityProviderName,omitempty"` - // ConnectionStatus - READ-ONLY; The connection status with the Security Partner Provider. Possible values include: 'SecurityPartnerProviderConnectionStatusUnknown', 'SecurityPartnerProviderConnectionStatusPartiallyConnected', 'SecurityPartnerProviderConnectionStatusConnected', 'SecurityPartnerProviderConnectionStatusNotConnected' - ConnectionStatus SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` - // VirtualHub - The virtualHub to which the Security Partner Provider belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityPartnerProviderPropertiesFormat. -func (spppf SecurityPartnerProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spppf.SecurityProviderName != "" { - objectMap["securityProviderName"] = spppf.SecurityProviderName - } - if spppf.VirtualHub != nil { - objectMap["virtualHub"] = spppf.VirtualHub - } - return json.Marshal(objectMap) -} - -// SecurityPartnerProvidersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type SecurityPartnerProvidersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityPartnerProvidersClient) (SecurityPartnerProvider, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityPartnerProvidersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityPartnerProvidersCreateOrUpdateFuture.Result. -func (future *SecurityPartnerProvidersCreateOrUpdateFuture) result(client SecurityPartnerProvidersClient) (spp SecurityPartnerProvider, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - spp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if spp.Response.Response, err = future.GetResult(sender); err == nil && spp.Response.Response.StatusCode != http.StatusNoContent { - spp, err = client.CreateOrUpdateResponder(spp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", spp.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityPartnerProvidersDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityPartnerProvidersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityPartnerProvidersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityPartnerProvidersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityPartnerProvidersDeleteFuture.Result. -func (future *SecurityPartnerProvidersDeleteFuture) result(client SecurityPartnerProvidersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityRule network security rule. -type SecurityRule struct { - autorest.Response `json:"-"` - // SecurityRulePropertiesFormat - Properties of the security rule. - *SecurityRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityRule. -func (sr SecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.SecurityRulePropertiesFormat != nil { - objectMap["properties"] = sr.SecurityRulePropertiesFormat - } - if sr.Name != nil { - objectMap["name"] = sr.Name - } - if sr.ID != nil { - objectMap["id"] = sr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. -func (sr *SecurityRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityRulePropertiesFormat SecurityRulePropertiesFormat - err = json.Unmarshal(*v, &securityRulePropertiesFormat) - if err != nil { - return err - } - sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sr.ID = &ID - } - } - } - - return nil -} - -// SecurityRuleAssociations all security rules associated with the network interface. -type SecurityRuleAssociations struct { - // NetworkInterfaceAssociation - Network interface and it's custom security rules. - NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` - // SubnetAssociation - Subnet and it's custom security rules. - SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` - // DefaultSecurityRules - Collection of default security rules of the network security group. - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - // EffectiveSecurityRules - Collection of effective security rules. - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` -} - -// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that -// belongs to a network security group. -type SecurityRuleListResult struct { - autorest.Response `json:"-"` - // Value - The security rules in a network security group. - Value *[]SecurityRule `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. -type SecurityRuleListResultIterator struct { - i int - page SecurityRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityRuleListResultIterator) Value() SecurityRule { - if !iter.page.NotDone() { - return SecurityRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityRuleListResultIterator type. -func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator { - return SecurityRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (srlr SecurityRuleListResult) IsEmpty() bool { - return srlr.Value == nil || len(*srlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (srlr SecurityRuleListResult) hasNextLink() bool { - return srlr.NextLink != nil && len(*srlr.NextLink) != 0 -} - -// securityRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !srlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(srlr.NextLink))) -} - -// SecurityRuleListResultPage contains a page of SecurityRule values. -type SecurityRuleListResultPage struct { - fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error) - srlr SecurityRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.srlr) - if err != nil { - return err - } - page.srlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityRuleListResultPage) NotDone() bool { - return !page.srlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { - return page.srlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityRuleListResultPage) Values() []SecurityRule { - if page.srlr.IsEmpty() { - return nil - } - return *page.srlr.Value -} - -// Creates a new instance of the SecurityRuleListResultPage type. -func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { - return SecurityRuleListResultPage{ - fn: getNextPage, - srlr: cur, - } -} - -// SecurityRulePropertiesFormat security rule resource. -type SecurityRulePropertiesFormat struct { - // Description - A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Protocol - Network protocol this rule applies to. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolIcmp', 'SecurityRuleProtocolEsp', 'SecurityRuleProtocolAsterisk', 'SecurityRuleProtocolAh' - Protocol SecurityRuleProtocol `json:"protocol,omitempty"` - // SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - // DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - // SourceAddressPrefix - The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - // SourceAddressPrefixes - The CIDR or source IP ranges. - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - // SourceApplicationSecurityGroups - The application security group specified as source. - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - // DestinationAddressPrefix - The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - // DestinationAddressPrefixes - The destination address prefixes. CIDR or destination IP ranges. - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - // DestinationApplicationSecurityGroups - The application security group specified as destination. - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - // SourcePortRanges - The source port ranges. - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - The destination port ranges. - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // Access - The network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - Access SecurityRuleAccess `json:"access,omitempty"` - // Priority - The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' - Direction SecurityRuleDirection `json:"direction,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the security rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityRulePropertiesFormat. -func (srpf SecurityRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if srpf.Description != nil { - objectMap["description"] = srpf.Description - } - if srpf.Protocol != "" { - objectMap["protocol"] = srpf.Protocol - } - if srpf.SourcePortRange != nil { - objectMap["sourcePortRange"] = srpf.SourcePortRange - } - if srpf.DestinationPortRange != nil { - objectMap["destinationPortRange"] = srpf.DestinationPortRange - } - if srpf.SourceAddressPrefix != nil { - objectMap["sourceAddressPrefix"] = srpf.SourceAddressPrefix - } - if srpf.SourceAddressPrefixes != nil { - objectMap["sourceAddressPrefixes"] = srpf.SourceAddressPrefixes - } - if srpf.SourceApplicationSecurityGroups != nil { - objectMap["sourceApplicationSecurityGroups"] = srpf.SourceApplicationSecurityGroups - } - if srpf.DestinationAddressPrefix != nil { - objectMap["destinationAddressPrefix"] = srpf.DestinationAddressPrefix - } - if srpf.DestinationAddressPrefixes != nil { - objectMap["destinationAddressPrefixes"] = srpf.DestinationAddressPrefixes - } - if srpf.DestinationApplicationSecurityGroups != nil { - objectMap["destinationApplicationSecurityGroups"] = srpf.DestinationApplicationSecurityGroups - } - if srpf.SourcePortRanges != nil { - objectMap["sourcePortRanges"] = srpf.SourcePortRanges - } - if srpf.DestinationPortRanges != nil { - objectMap["destinationPortRanges"] = srpf.DestinationPortRanges - } - if srpf.Access != "" { - objectMap["access"] = srpf.Access - } - if srpf.Priority != nil { - objectMap["priority"] = srpf.Priority - } - if srpf.Direction != "" { - objectMap["direction"] = srpf.Direction - } - return json.Marshal(objectMap) -} - -// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityRulesClient) (SecurityRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. -func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.CreateOrUpdateResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SecurityRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityRulesDeleteFuture.Result. -func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityRulesEvaluationResult network security rules evaluation result. -type SecurityRulesEvaluationResult struct { - // Name - Name of the network security rule. - Name *string `json:"name,omitempty"` - // ProtocolMatched - Value indicating whether protocol is matched. - ProtocolMatched *bool `json:"protocolMatched,omitempty"` - // SourceMatched - Value indicating whether source is matched. - SourceMatched *bool `json:"sourceMatched,omitempty"` - // SourcePortMatched - Value indicating whether source port is matched. - SourcePortMatched *bool `json:"sourcePortMatched,omitempty"` - // DestinationMatched - Value indicating whether destination is matched. - DestinationMatched *bool `json:"destinationMatched,omitempty"` - // DestinationPortMatched - Value indicating whether destination port is matched. - DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"` -} - -// ServiceAssociationLink serviceAssociationLink resource. -type ServiceAssociationLink struct { - // ServiceAssociationLinkPropertiesFormat - Resource navigation link properties format. - *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLink. -func (sal ServiceAssociationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sal.ServiceAssociationLinkPropertiesFormat != nil { - objectMap["properties"] = sal.ServiceAssociationLinkPropertiesFormat - } - if sal.Name != nil { - objectMap["name"] = sal.Name - } - if sal.ID != nil { - objectMap["id"] = sal.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceAssociationLink struct. -func (sal *ServiceAssociationLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceAssociationLinkPropertiesFormat ServiceAssociationLinkPropertiesFormat - err = json.Unmarshal(*v, &serviceAssociationLinkPropertiesFormat) - if err != nil { - return err - } - sal.ServiceAssociationLinkPropertiesFormat = &serviceAssociationLinkPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sal.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sal.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sal.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sal.ID = &ID - } - } - } - - return nil -} - -// ServiceAssociationLinkPropertiesFormat properties of ServiceAssociationLink. -type ServiceAssociationLinkPropertiesFormat struct { - // LinkedResourceType - Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - // Link - Link to the external resource. - Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service association link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // AllowDelete - If true, the resource can be deleted. - AllowDelete *bool `json:"allowDelete,omitempty"` - // Locations - A list of locations. - Locations *[]string `json:"locations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLinkPropertiesFormat. -func (salpf ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if salpf.LinkedResourceType != nil { - objectMap["linkedResourceType"] = salpf.LinkedResourceType - } - if salpf.Link != nil { - objectMap["link"] = salpf.Link - } - if salpf.AllowDelete != nil { - objectMap["allowDelete"] = salpf.AllowDelete - } - if salpf.Locations != nil { - objectMap["locations"] = salpf.Locations - } - return json.Marshal(objectMap) -} - -// ServiceAssociationLinksListResult response for ServiceAssociationLinks_List operation. -type ServiceAssociationLinksListResult struct { - autorest.Response `json:"-"` - // Value - The service association links in a subnet. - Value *[]ServiceAssociationLink `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLinksListResult. -func (sallr ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sallr.Value != nil { - objectMap["value"] = sallr.Value - } - return json.Marshal(objectMap) -} - -// ServiceDelegationPropertiesFormat properties of a service delegation. -type ServiceDelegationPropertiesFormat struct { - // ServiceName - The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). - ServiceName *string `json:"serviceName,omitempty"` - // Actions - READ-ONLY; The actions permitted to the service upon delegation. - Actions *[]string `json:"actions,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service delegation resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceDelegationPropertiesFormat. -func (sdpf ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sdpf.ServiceName != nil { - objectMap["serviceName"] = sdpf.ServiceName - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServiceEndpointPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPoliciesClient) (ServiceEndpointPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPoliciesCreateOrUpdateFuture.Result. -func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sep.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sep.Response.Response, err = future.GetResult(sender); err == nil && sep.Response.Response.StatusCode != http.StatusNoContent { - sep, err = client.CreateOrUpdateResponder(sep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", sep.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceEndpointPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServiceEndpointPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPoliciesDeleteFuture.Result. -func (future *ServiceEndpointPoliciesDeleteFuture) result(client ServiceEndpointPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServiceEndpointPolicy service End point policy resource. -type ServiceEndpointPolicy struct { - autorest.Response `json:"-"` - // ServiceEndpointPolicyPropertiesFormat - Properties of the service end point policy. - *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicy. -func (sep ServiceEndpointPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sep.ServiceEndpointPolicyPropertiesFormat != nil { - objectMap["properties"] = sep.ServiceEndpointPolicyPropertiesFormat - } - if sep.ID != nil { - objectMap["id"] = sep.ID - } - if sep.Location != nil { - objectMap["location"] = sep.Location - } - if sep.Tags != nil { - objectMap["tags"] = sep.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceEndpointPolicy struct. -func (sep *ServiceEndpointPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceEndpointPolicyPropertiesFormat ServiceEndpointPolicyPropertiesFormat - err = json.Unmarshal(*v, &serviceEndpointPolicyPropertiesFormat) - if err != nil { - return err - } - sep.ServiceEndpointPolicyPropertiesFormat = &serviceEndpointPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sep.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sep.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sep.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sep.Tags = tags - } - } - } - - return nil -} - -// ServiceEndpointPolicyDefinition service Endpoint policy definitions. -type ServiceEndpointPolicyDefinition struct { - autorest.Response `json:"-"` - // ServiceEndpointPolicyDefinitionPropertiesFormat - Properties of the service endpoint policy definition. - *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinition. -func (sepd ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepd.ServiceEndpointPolicyDefinitionPropertiesFormat != nil { - objectMap["properties"] = sepd.ServiceEndpointPolicyDefinitionPropertiesFormat - } - if sepd.Name != nil { - objectMap["name"] = sepd.Name - } - if sepd.ID != nil { - objectMap["id"] = sepd.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceEndpointPolicyDefinition struct. -func (sepd *ServiceEndpointPolicyDefinition) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceEndpointPolicyDefinitionPropertiesFormat ServiceEndpointPolicyDefinitionPropertiesFormat - err = json.Unmarshal(*v, &serviceEndpointPolicyDefinitionPropertiesFormat) - if err != nil { - return err - } - sepd.ServiceEndpointPolicyDefinitionPropertiesFormat = &serviceEndpointPolicyDefinitionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sepd.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sepd.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sepd.ID = &ID - } - } - } - - return nil -} - -// ServiceEndpointPolicyDefinitionListResult response for ListServiceEndpointPolicyDefinition API service -// call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. -type ServiceEndpointPolicyDefinitionListResult struct { - autorest.Response `json:"-"` - // Value - The service endpoint policy definition in a service endpoint policy. - Value *[]ServiceEndpointPolicyDefinition `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServiceEndpointPolicyDefinitionListResultIterator provides access to a complete listing of -// ServiceEndpointPolicyDefinition values. -type ServiceEndpointPolicyDefinitionListResultIterator struct { - i int - page ServiceEndpointPolicyDefinitionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServiceEndpointPolicyDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServiceEndpointPolicyDefinitionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) Response() ServiceEndpointPolicyDefinitionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) Value() ServiceEndpointPolicyDefinition { - if !iter.page.NotDone() { - return ServiceEndpointPolicyDefinition{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceEndpointPolicyDefinitionListResultIterator type. -func NewServiceEndpointPolicyDefinitionListResultIterator(page ServiceEndpointPolicyDefinitionListResultPage) ServiceEndpointPolicyDefinitionListResultIterator { - return ServiceEndpointPolicyDefinitionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) IsEmpty() bool { - return sepdlr.Value == nil || len(*sepdlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) hasNextLink() bool { - return sepdlr.NextLink != nil && len(*sepdlr.NextLink) != 0 -} - -// serviceEndpointPolicyDefinitionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) serviceEndpointPolicyDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sepdlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sepdlr.NextLink))) -} - -// ServiceEndpointPolicyDefinitionListResultPage contains a page of ServiceEndpointPolicyDefinition values. -type ServiceEndpointPolicyDefinitionListResultPage struct { - fn func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error) - sepdlr ServiceEndpointPolicyDefinitionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServiceEndpointPolicyDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sepdlr) - if err != nil { - return err - } - page.sepdlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServiceEndpointPolicyDefinitionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceEndpointPolicyDefinitionListResultPage) NotDone() bool { - return !page.sepdlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceEndpointPolicyDefinitionListResultPage) Response() ServiceEndpointPolicyDefinitionListResult { - return page.sepdlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceEndpointPolicyDefinitionListResultPage) Values() []ServiceEndpointPolicyDefinition { - if page.sepdlr.IsEmpty() { - return nil - } - return *page.sepdlr.Value -} - -// Creates a new instance of the ServiceEndpointPolicyDefinitionListResultPage type. -func NewServiceEndpointPolicyDefinitionListResultPage(cur ServiceEndpointPolicyDefinitionListResult, getNextPage func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)) ServiceEndpointPolicyDefinitionListResultPage { - return ServiceEndpointPolicyDefinitionListResultPage{ - fn: getNextPage, - sepdlr: cur, - } -} - -// ServiceEndpointPolicyDefinitionPropertiesFormat service Endpoint policy definition resource. -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - // Description - A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Service - Service endpoint name. - Service *string `json:"service,omitempty"` - // ServiceResources - A list of service resources. - ServiceResources *[]string `json:"serviceResources,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy definition resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinitionPropertiesFormat. -func (sepdpf ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepdpf.Description != nil { - objectMap["description"] = sepdpf.Description - } - if sepdpf.Service != nil { - objectMap["service"] = sepdpf.Service - } - if sepdpf.ServiceResources != nil { - objectMap["serviceResources"] = sepdpf.ServiceResources - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPolicyDefinitionsClient) (ServiceEndpointPolicyDefinition, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.Result. -func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) result(client ServiceEndpointPolicyDefinitionsClient) (sepd ServiceEndpointPolicyDefinition, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sepd.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sepd.Response.Response, err = future.GetResult(sender); err == nil && sepd.Response.Response.StatusCode != http.StatusNoContent { - sepd, err = client.CreateOrUpdateResponder(sepd.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", sepd.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceEndpointPolicyDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServiceEndpointPolicyDefinitionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPolicyDefinitionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPolicyDefinitionsDeleteFuture.Result. -func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) result(client ServiceEndpointPolicyDefinitionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServiceEndpointPolicyListResult response for ListServiceEndpointPolicies API service call. -type ServiceEndpointPolicyListResult struct { - autorest.Response `json:"-"` - // Value - A list of ServiceEndpointPolicy resources. - Value *[]ServiceEndpointPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyListResult. -func (seplr ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if seplr.Value != nil { - objectMap["value"] = seplr.Value - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPolicyListResultIterator provides access to a complete listing of ServiceEndpointPolicy -// values. -type ServiceEndpointPolicyListResultIterator struct { - i int - page ServiceEndpointPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServiceEndpointPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServiceEndpointPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceEndpointPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServiceEndpointPolicyListResultIterator) Response() ServiceEndpointPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServiceEndpointPolicyListResultIterator) Value() ServiceEndpointPolicy { - if !iter.page.NotDone() { - return ServiceEndpointPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceEndpointPolicyListResultIterator type. -func NewServiceEndpointPolicyListResultIterator(page ServiceEndpointPolicyListResultPage) ServiceEndpointPolicyListResultIterator { - return ServiceEndpointPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (seplr ServiceEndpointPolicyListResult) IsEmpty() bool { - return seplr.Value == nil || len(*seplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (seplr ServiceEndpointPolicyListResult) hasNextLink() bool { - return seplr.NextLink != nil && len(*seplr.NextLink) != 0 -} - -// serviceEndpointPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (seplr ServiceEndpointPolicyListResult) serviceEndpointPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !seplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(seplr.NextLink))) -} - -// ServiceEndpointPolicyListResultPage contains a page of ServiceEndpointPolicy values. -type ServiceEndpointPolicyListResultPage struct { - fn func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error) - seplr ServiceEndpointPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServiceEndpointPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.seplr) - if err != nil { - return err - } - page.seplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServiceEndpointPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceEndpointPolicyListResultPage) NotDone() bool { - return !page.seplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceEndpointPolicyListResultPage) Response() ServiceEndpointPolicyListResult { - return page.seplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceEndpointPolicyListResultPage) Values() []ServiceEndpointPolicy { - if page.seplr.IsEmpty() { - return nil - } - return *page.seplr.Value -} - -// Creates a new instance of the ServiceEndpointPolicyListResultPage type. -func NewServiceEndpointPolicyListResultPage(cur ServiceEndpointPolicyListResult, getNextPage func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)) ServiceEndpointPolicyListResultPage { - return ServiceEndpointPolicyListResultPage{ - fn: getNextPage, - seplr: cur, - } -} - -// ServiceEndpointPolicyPropertiesFormat service Endpoint Policy resource. -type ServiceEndpointPolicyPropertiesFormat struct { - // ServiceEndpointPolicyDefinitions - A collection of service endpoint policy definitions of the service endpoint policy. - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the service endpoint policy resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyPropertiesFormat. -func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if seppf.ServiceEndpointPolicyDefinitions != nil { - objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPropertiesFormat the service endpoint properties. -type ServiceEndpointPropertiesFormat struct { - // Service - The type of the endpoint service. - Service *string `json:"service,omitempty"` - // Locations - A list of locations. - Locations *[]string `json:"locations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPropertiesFormat. -func (sepf ServiceEndpointPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepf.Service != nil { - objectMap["service"] = sepf.Service - } - if sepf.Locations != nil { - objectMap["locations"] = sepf.Locations - } - return json.Marshal(objectMap) -} - -// ServiceTagInformation the service tag information. -type ServiceTagInformation struct { - // Properties - READ-ONLY; Properties of the service tag information. - Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of service tag. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; The ID of service tag. - ID *string `json:"id,omitempty"` -} - -// ServiceTagInformationPropertiesFormat properties of the service tag information. -type ServiceTagInformationPropertiesFormat struct { - // ChangeNumber - READ-ONLY; The iteration number of service tag. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Region - READ-ONLY; The region of service tag. - Region *string `json:"region,omitempty"` - // SystemService - READ-ONLY; The name of system service. - SystemService *string `json:"systemService,omitempty"` - // AddressPrefixes - READ-ONLY; The list of IP address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} - -// ServiceTagsListResult response for the ListServiceTags API service call. -type ServiceTagsListResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The name of the cloud. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; The ID of the cloud. - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; The azure resource type. - Type *string `json:"type,omitempty"` - // ChangeNumber - READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Cloud - READ-ONLY; The name of the cloud. - Cloud *string `json:"cloud,omitempty"` - // Values - READ-ONLY; The list of service tag information resources. - Values *[]ServiceTagInformation `json:"values,omitempty"` -} - -// SessionIds list of session IDs. -type SessionIds struct { - // SessionIds - List of session IDs. - SessionIds *[]string `json:"sessionIds,omitempty"` -} - -// StaticRoute list of all Static Routes. -type StaticRoute struct { - // Name - The name of the StaticRoute that is unique within a VnetRoute. - Name *string `json:"name,omitempty"` - // AddressPrefixes - List of all address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHopIPAddress - The ip address of the next hop. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - -// Subnet subnet in a virtual network resource. -type Subnet struct { - autorest.Response `json:"-"` - // SubnetPropertiesFormat - Properties of the subnet. - *SubnetPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Subnet. -func (s Subnet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.SubnetPropertiesFormat != nil { - objectMap["properties"] = s.SubnetPropertiesFormat - } - if s.Name != nil { - objectMap["name"] = s.Name - } - if s.ID != nil { - objectMap["id"] = s.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Subnet struct. -func (s *Subnet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var subnetPropertiesFormat SubnetPropertiesFormat - err = json.Unmarshal(*v, &subnetPropertiesFormat) - if err != nil { - return err - } - s.SubnetPropertiesFormat = &subnetPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - s.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - } - } - - return nil -} - -// SubnetAssociation subnet and it's custom security rules. -type SubnetAssociation struct { - // ID - READ-ONLY; Subnet ID. - ID *string `json:"id,omitempty"` - // SecurityRules - Collection of custom security rules. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubnetAssociation. -func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sa.SecurityRules != nil { - objectMap["securityRules"] = sa.SecurityRules - } - return json.Marshal(objectMap) -} - -// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual -// network. -type SubnetListResult struct { - autorest.Response `json:"-"` - // Value - The subnets in a virtual network. - Value *[]Subnet `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SubnetListResultIterator provides access to a complete listing of Subnet values. -type SubnetListResultIterator struct { - i int - page SubnetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SubnetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SubnetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SubnetListResultIterator) Response() SubnetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SubnetListResultIterator) Value() Subnet { - if !iter.page.NotDone() { - return Subnet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SubnetListResultIterator type. -func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator { - return SubnetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (slr SubnetListResult) IsEmpty() bool { - return slr.Value == nil || len(*slr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (slr SubnetListResult) hasNextLink() bool { - return slr.NextLink != nil && len(*slr.NextLink) != 0 -} - -// subnetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !slr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(slr.NextLink))) -} - -// SubnetListResultPage contains a page of Subnet values. -type SubnetListResultPage struct { - fn func(context.Context, SubnetListResult) (SubnetListResult, error) - slr SubnetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.slr) - if err != nil { - return err - } - page.slr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SubnetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SubnetListResultPage) NotDone() bool { - return !page.slr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SubnetListResultPage) Response() SubnetListResult { - return page.slr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SubnetListResultPage) Values() []Subnet { - if page.slr.IsEmpty() { - return nil - } - return *page.slr.Value -} - -// Creates a new instance of the SubnetListResultPage type. -func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { - return SubnetListResultPage{ - fn: getNextPage, - slr: cur, - } -} - -// SubnetPropertiesFormat properties of the subnet. -type SubnetPropertiesFormat struct { - // AddressPrefix - The address prefix for the subnet. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // AddressPrefixes - List of address prefixes for the subnet. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NetworkSecurityGroup - The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - // RouteTable - The reference to the RouteTable resource. - RouteTable *RouteTable `json:"routeTable,omitempty"` - // NatGateway - Nat gateway associated with this subnet. - NatGateway *SubResource `json:"natGateway,omitempty"` - // ServiceEndpoints - An array of service endpoints. - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` - // ServiceEndpointPolicies - An array of service endpoint policies. - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - // PrivateEndpoints - READ-ONLY; An array of references to private endpoints. - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - // IPConfigurations - READ-ONLY; An array of references to the network interface IP configurations using subnet. - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - // IPConfigurationProfiles - READ-ONLY; Array of IP configuration profiles which reference this subnet. - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - // IPAllocations - Array of IpAllocation which reference this subnet. - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - // ResourceNavigationLinks - READ-ONLY; An array of references to the external resources using subnet. - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - // ServiceAssociationLinks - READ-ONLY; An array of references to services injecting into this subnet. - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - // Delegations - An array of references to the delegations on the subnet. - Delegations *[]Delegation `json:"delegations,omitempty"` - // Purpose - READ-ONLY; A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. - Purpose *string `json:"purpose,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the subnet resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. - PrivateEndpointNetworkPolicies *string `json:"privateEndpointNetworkPolicies,omitempty"` - // PrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the subnet. - PrivateLinkServiceNetworkPolicies *string `json:"privateLinkServiceNetworkPolicies,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. -func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spf.AddressPrefix != nil { - objectMap["addressPrefix"] = spf.AddressPrefix - } - if spf.AddressPrefixes != nil { - objectMap["addressPrefixes"] = spf.AddressPrefixes - } - if spf.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup - } - if spf.RouteTable != nil { - objectMap["routeTable"] = spf.RouteTable - } - if spf.NatGateway != nil { - objectMap["natGateway"] = spf.NatGateway - } - if spf.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = spf.ServiceEndpoints - } - if spf.ServiceEndpointPolicies != nil { - objectMap["serviceEndpointPolicies"] = spf.ServiceEndpointPolicies - } - if spf.IPAllocations != nil { - objectMap["ipAllocations"] = spf.IPAllocations - } - if spf.Delegations != nil { - objectMap["delegations"] = spf.Delegations - } - if spf.PrivateEndpointNetworkPolicies != nil { - objectMap["privateEndpointNetworkPolicies"] = spf.PrivateEndpointNetworkPolicies - } - if spf.PrivateLinkServiceNetworkPolicies != nil { - objectMap["privateLinkServiceNetworkPolicies"] = spf.PrivateLinkServiceNetworkPolicies - } - return json.Marshal(objectMap) -} - -// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SubnetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (Subnet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. -func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SubnetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsDeleteFuture.Result. -func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SubnetsPrepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SubnetsPrepareNetworkPoliciesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsPrepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsPrepareNetworkPoliciesFuture.Result. -func (future *SubnetsPrepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsPrepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsPrepareNetworkPoliciesFuture") - return - } - ar.Response = future.Response() - return -} - -// SubnetsUnprepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SubnetsUnprepareNetworkPoliciesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsUnprepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsUnprepareNetworkPoliciesFuture.Result. -func (future *SubnetsUnprepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsUnprepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsUnprepareNetworkPoliciesFuture") - return - } - ar.Response = future.Response() - return -} - -// SubResource reference to another subresource. -type SubResource struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// TagsObject tags object for patch operations. -type TagsObject struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for TagsObject. -func (toVar TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if toVar.Tags != nil { - objectMap["tags"] = toVar.Tags - } - return json.Marshal(objectMap) -} - -// Topology topology of the specified resource group. -type Topology struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; GUID representing the operation id. - ID *string `json:"id,omitempty"` - // CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group. - CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` - // LastModified - READ-ONLY; The datetime when the topology was last modified. - LastModified *date.Time `json:"lastModified,omitempty"` - // Resources - A list of topology resources. - Resources *[]TopologyResource `json:"resources,omitempty"` -} - -// MarshalJSON is the custom marshaler for Topology. -func (t Topology) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if t.Resources != nil { - objectMap["resources"] = t.Resources - } - return json.Marshal(objectMap) -} - -// TopologyAssociation resources that have an association with the parent resource. -type TopologyAssociation struct { - // Name - The name of the resource that is associated with the parent resource. - Name *string `json:"name,omitempty"` - // ResourceID - The ID of the resource that is associated with the parent resource. - ResourceID *string `json:"resourceId,omitempty"` - // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' - AssociationType AssociationType `json:"associationType,omitempty"` -} - -// TopologyParameters parameters that define the representation of topology. -type TopologyParameters struct { - // TargetResourceGroupName - The name of the target resource group to perform topology on. - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - // TargetVirtualNetwork - The reference to the Virtual Network resource. - TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` - // TargetSubnet - The reference to the Subnet resource. - TargetSubnet *SubResource `json:"targetSubnet,omitempty"` -} - -// TopologyResource the network resource topology information for the given resource group. -type TopologyResource struct { - // Name - Name of the resource. - Name *string `json:"name,omitempty"` - // ID - ID of the resource. - ID *string `json:"id,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Associations - Holds the associations the resource has with other resources in the resource group. - Associations *[]TopologyAssociation `json:"associations,omitempty"` -} - -// TrafficAnalyticsConfigurationProperties parameters that define the configuration of traffic analytics. -type TrafficAnalyticsConfigurationProperties struct { - // Enabled - Flag to enable/disable traffic analytics. - Enabled *bool `json:"enabled,omitempty"` - // WorkspaceID - The resource guid of the attached workspace. - WorkspaceID *string `json:"workspaceId,omitempty"` - // WorkspaceRegion - The location of the attached workspace. - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - // WorkspaceResourceID - Resource Id of the attached workspace. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` - // TrafficAnalyticsInterval - The interval in minutes which would decide how frequently TA service should do flow analytics. - TrafficAnalyticsInterval *int32 `json:"trafficAnalyticsInterval,omitempty"` -} - -// TrafficAnalyticsProperties parameters that define the configuration of traffic analytics. -type TrafficAnalyticsProperties struct { - // NetworkWatcherFlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} - -// TrafficSelectorPolicy an traffic selector policy for a virtual network gateway connection. -type TrafficSelectorPolicy struct { - // LocalAddressRanges - A collection of local address spaces in CIDR format. - LocalAddressRanges *[]string `json:"localAddressRanges,omitempty"` - // RemoteAddressRanges - A collection of remote address spaces in CIDR format. - RemoteAddressRanges *[]string `json:"remoteAddressRanges,omitempty"` -} - -// TroubleshootingDetails information gained from troubleshooting of specified resource. -type TroubleshootingDetails struct { - // ID - The id of the get troubleshoot operation. - ID *string `json:"id,omitempty"` - // ReasonType - Reason type of failure. - ReasonType *string `json:"reasonType,omitempty"` - // Summary - A summary of troubleshooting. - Summary *string `json:"summary,omitempty"` - // Detail - Details on troubleshooting results. - Detail *string `json:"detail,omitempty"` - // RecommendedActions - List of recommended actions. - RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` -} - -// TroubleshootingParameters parameters that define the resource to troubleshoot. -type TroubleshootingParameters struct { - // TargetResourceID - The target resource to troubleshoot. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // TroubleshootingProperties - Properties of the troubleshooting resource. - *TroubleshootingProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for TroubleshootingParameters. -func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tp.TargetResourceID != nil { - objectMap["targetResourceId"] = tp.TargetResourceID - } - if tp.TroubleshootingProperties != nil { - objectMap["properties"] = tp.TroubleshootingProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. -func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "targetResourceId": - if v != nil { - var targetResourceID string - err = json.Unmarshal(*v, &targetResourceID) - if err != nil { - return err - } - tp.TargetResourceID = &targetResourceID - } - case "properties": - if v != nil { - var troubleshootingProperties TroubleshootingProperties - err = json.Unmarshal(*v, &troubleshootingProperties) - if err != nil { - return err - } - tp.TroubleshootingProperties = &troubleshootingProperties - } - } - } - - return nil -} - -// TroubleshootingProperties storage location provided for troubleshoot. -type TroubleshootingProperties struct { - // StorageID - The ID for the storage account to save the troubleshoot result. - StorageID *string `json:"storageId,omitempty"` - // StoragePath - The path to the blob to save the troubleshoot result in. - StoragePath *string `json:"storagePath,omitempty"` -} - -// TroubleshootingRecommendedActions recommended actions based on discovered issues. -type TroubleshootingRecommendedActions struct { - // ActionID - ID of the recommended action. - ActionID *string `json:"actionId,omitempty"` - // ActionText - Description of recommended actions. - ActionText *string `json:"actionText,omitempty"` - // ActionURI - The uri linking to a documentation for the recommended troubleshooting actions. - ActionURI *string `json:"actionUri,omitempty"` - // ActionURIText - The information from the URI for the recommended troubleshooting actions. - ActionURIText *string `json:"actionUriText,omitempty"` -} - -// TroubleshootingResult troubleshooting information gained from specified resource. -type TroubleshootingResult struct { - autorest.Response `json:"-"` - // StartTime - The start time of the troubleshooting. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time of the troubleshooting. - EndTime *date.Time `json:"endTime,omitempty"` - // Code - The result code of the troubleshooting. - Code *string `json:"code,omitempty"` - // Results - Information from troubleshooting. - Results *[]TroubleshootingDetails `json:"results,omitempty"` -} - -// TunnelConnectionHealth virtualNetworkGatewayConnection properties. -type TunnelConnectionHealth struct { - // Tunnel - READ-ONLY; Tunnel name. - Tunnel *string `json:"tunnel,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format. - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` -} - -// UnprepareNetworkPoliciesRequest details of UnprepareNetworkPolicies for Subnet. -type UnprepareNetworkPoliciesRequest struct { - // ServiceName - The name of the service for which subnet is being unprepared for. - ServiceName *string `json:"serviceName,omitempty"` -} - -// Usage the network resource usage. -type Usage struct { - // ID - READ-ONLY; Resource identifier. - ID *string `json:"id,omitempty"` - // Unit - An enum describing the unit of measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current value of the usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - The limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if u.Unit != nil { - objectMap["unit"] = u.Unit - } - if u.CurrentValue != nil { - objectMap["currentValue"] = u.CurrentValue - } - if u.Limit != nil { - objectMap["limit"] = u.Limit - } - if u.Name != nil { - objectMap["name"] = u.Name - } - return json.Marshal(objectMap) -} - -// UsageName the usage names. -type UsageName struct { - // Value - A string describing the resource name. - Value *string `json:"value,omitempty"` - // LocalizedValue - A localized string describing the resource name. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UsagesListResult the list usages operation response. -type UsagesListResult struct { - autorest.Response `json:"-"` - // Value - The list network resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// UsagesListResultIterator provides access to a complete listing of Usage values. -type UsagesListResultIterator struct { - i int - page UsagesListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *UsagesListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter UsagesListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter UsagesListResultIterator) Response() UsagesListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter UsagesListResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the UsagesListResultIterator type. -func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator { - return UsagesListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ulr UsagesListResult) IsEmpty() bool { - return ulr.Value == nil || len(*ulr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ulr UsagesListResult) hasNextLink() bool { - return ulr.NextLink != nil && len(*ulr.NextLink) != 0 -} - -// usagesListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ulr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ulr.NextLink))) -} - -// UsagesListResultPage contains a page of Usage values. -type UsagesListResultPage struct { - fn func(context.Context, UsagesListResult) (UsagesListResult, error) - ulr UsagesListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ulr) - if err != nil { - return err - } - page.ulr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *UsagesListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page UsagesListResultPage) NotDone() bool { - return !page.ulr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page UsagesListResultPage) Response() UsagesListResult { - return page.ulr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page UsagesListResultPage) Values() []Usage { - if page.ulr.IsEmpty() { - return nil - } - return *page.ulr.Value -} - -// Creates a new instance of the UsagesListResultPage type. -func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { - return UsagesListResultPage{ - fn: getNextPage, - ulr: cur, - } -} - -// VerificationIPFlowParameters parameters that define the IP flow to be verified. -type VerificationIPFlowParameters struct { - // TargetResourceID - The ID of the target resource to perform next-hop on. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // Protocol - Protocol to be verified on. Possible values include: 'IPFlowProtocolTCP', 'IPFlowProtocolUDP' - Protocol IPFlowProtocol `json:"protocol,omitempty"` - // LocalPort - The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. - LocalPort *string `json:"localPort,omitempty"` - // RemotePort - The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. - RemotePort *string `json:"remotePort,omitempty"` - // LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - // RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// VerificationIPFlowResult results of IP flow verification on the target resource. -type VerificationIPFlowResult struct { - autorest.Response `json:"-"` - // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' - Access Access `json:"access,omitempty"` - // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. - RuleName *string `json:"ruleName,omitempty"` -} - -// VirtualAppliance networkVirtualAppliance Resource. -type VirtualAppliance struct { - autorest.Response `json:"-"` - // VirtualAppliancePropertiesFormat - Properties of the Network Virtual Appliance. - *VirtualAppliancePropertiesFormat `json:"properties,omitempty"` - // Identity - The service principal that has read access to cloud-init and config blob. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualAppliance. -func (va VirtualAppliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if va.VirtualAppliancePropertiesFormat != nil { - objectMap["properties"] = va.VirtualAppliancePropertiesFormat - } - if va.Identity != nil { - objectMap["identity"] = va.Identity - } - if va.ID != nil { - objectMap["id"] = va.ID - } - if va.Location != nil { - objectMap["location"] = va.Location - } - if va.Tags != nil { - objectMap["tags"] = va.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualAppliance struct. -func (va *VirtualAppliance) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualAppliancePropertiesFormat VirtualAppliancePropertiesFormat - err = json.Unmarshal(*v, &virtualAppliancePropertiesFormat) - if err != nil { - return err - } - va.VirtualAppliancePropertiesFormat = &virtualAppliancePropertiesFormat - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - va.Identity = &identity - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - va.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - va.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - va.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - va.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - va.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - va.Tags = tags - } - } - } - - return nil -} - -// VirtualApplianceListResult response for ListNetworkVirtualAppliances API service call. -type VirtualApplianceListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliances. - Value *[]VirtualAppliance `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceListResultIterator provides access to a complete listing of VirtualAppliance values. -type VirtualApplianceListResultIterator struct { - i int - page VirtualApplianceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceListResultIterator) Response() VirtualApplianceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceListResultIterator) Value() VirtualAppliance { - if !iter.page.NotDone() { - return VirtualAppliance{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceListResultIterator type. -func NewVirtualApplianceListResultIterator(page VirtualApplianceListResultPage) VirtualApplianceListResultIterator { - return VirtualApplianceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (valr VirtualApplianceListResult) IsEmpty() bool { - return valr.Value == nil || len(*valr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (valr VirtualApplianceListResult) hasNextLink() bool { - return valr.NextLink != nil && len(*valr.NextLink) != 0 -} - -// virtualApplianceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (valr VirtualApplianceListResult) virtualApplianceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !valr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(valr.NextLink))) -} - -// VirtualApplianceListResultPage contains a page of VirtualAppliance values. -type VirtualApplianceListResultPage struct { - fn func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error) - valr VirtualApplianceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.valr) - if err != nil { - return err - } - page.valr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceListResultPage) NotDone() bool { - return !page.valr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceListResultPage) Response() VirtualApplianceListResult { - return page.valr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceListResultPage) Values() []VirtualAppliance { - if page.valr.IsEmpty() { - return nil - } - return *page.valr.Value -} - -// Creates a new instance of the VirtualApplianceListResultPage type. -func NewVirtualApplianceListResultPage(cur VirtualApplianceListResult, getNextPage func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error)) VirtualApplianceListResultPage { - return VirtualApplianceListResultPage{ - fn: getNextPage, - valr: cur, - } -} - -// VirtualApplianceNicProperties network Virtual Appliance NIC properties. -type VirtualApplianceNicProperties struct { - // Name - READ-ONLY; NIC name. - Name *string `json:"name,omitempty"` - // PublicIPAddress - READ-ONLY; Public IP address. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP address. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` -} - -// VirtualAppliancePropertiesFormat network Virtual Appliance definition. -type VirtualAppliancePropertiesFormat struct { - // NvaSku - Network Virtual Appliance SKU. - NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` - // BootStrapConfigurationBlobs - BootStrapConfigurationBlobs storage URLs. - BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` - // VirtualHub - The Virtual Hub where Network Virtual Appliance is being deployed. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // CloudInitConfigurationBlobs - CloudInitConfigurationBlob storage URLs. - CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` - // CloudInitConfiguration - CloudInitConfiguration string in plain text. - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - // VirtualApplianceAsn - VirtualAppliance ASN. - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - // VirtualApplianceNics - READ-ONLY; List of Virtual Appliance Network Interfaces. - VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` - // VirtualApplianceSites - READ-ONLY; List of references to VirtualApplianceSite. - VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualAppliancePropertiesFormat. -func (vapf VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vapf.NvaSku != nil { - objectMap["nvaSku"] = vapf.NvaSku - } - if vapf.BootStrapConfigurationBlobs != nil { - objectMap["bootStrapConfigurationBlobs"] = vapf.BootStrapConfigurationBlobs - } - if vapf.VirtualHub != nil { - objectMap["virtualHub"] = vapf.VirtualHub - } - if vapf.CloudInitConfigurationBlobs != nil { - objectMap["cloudInitConfigurationBlobs"] = vapf.CloudInitConfigurationBlobs - } - if vapf.CloudInitConfiguration != nil { - objectMap["cloudInitConfiguration"] = vapf.CloudInitConfiguration - } - if vapf.VirtualApplianceAsn != nil { - objectMap["virtualApplianceAsn"] = vapf.VirtualApplianceAsn - } - return json.Marshal(objectMap) -} - -// VirtualAppliancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualAppliancesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualAppliancesClient) (VirtualAppliance, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualAppliancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualAppliancesCreateOrUpdateFuture.Result. -func (future *VirtualAppliancesCreateOrUpdateFuture) result(client VirtualAppliancesClient) (va VirtualAppliance, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - va.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if va.Response.Response, err = future.GetResult(sender); err == nil && va.Response.Response.StatusCode != http.StatusNoContent { - va, err = client.CreateOrUpdateResponder(va.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", va.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualAppliancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualAppliancesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualAppliancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualAppliancesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualAppliancesDeleteFuture.Result. -func (future *VirtualAppliancesDeleteFuture) result(client VirtualAppliancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualApplianceSite virtual Appliance Site resource. -type VirtualApplianceSite struct { - autorest.Response `json:"-"` - // VirtualApplianceSiteProperties - The properties of the Virtual Appliance Sites. - *VirtualApplianceSiteProperties `json:"properties,omitempty"` - // Name - Name of the virtual appliance site. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Site type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSite. -func (vas VirtualApplianceSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vas.VirtualApplianceSiteProperties != nil { - objectMap["properties"] = vas.VirtualApplianceSiteProperties - } - if vas.Name != nil { - objectMap["name"] = vas.Name - } - if vas.ID != nil { - objectMap["id"] = vas.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualApplianceSite struct. -func (vas *VirtualApplianceSite) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualApplianceSiteProperties VirtualApplianceSiteProperties - err = json.Unmarshal(*v, &virtualApplianceSiteProperties) - if err != nil { - return err - } - vas.VirtualApplianceSiteProperties = &virtualApplianceSiteProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vas.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vas.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vas.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vas.ID = &ID - } - } - } - - return nil -} - -// VirtualApplianceSiteListResult response for ListNetworkVirtualApplianceSites API service call. -type VirtualApplianceSiteListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliance sites. - Value *[]VirtualApplianceSite `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceSiteListResultIterator provides access to a complete listing of VirtualApplianceSite -// values. -type VirtualApplianceSiteListResultIterator struct { - i int - page VirtualApplianceSiteListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceSiteListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSiteListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceSiteListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceSiteListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceSiteListResultIterator) Response() VirtualApplianceSiteListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceSiteListResultIterator) Value() VirtualApplianceSite { - if !iter.page.NotDone() { - return VirtualApplianceSite{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceSiteListResultIterator type. -func NewVirtualApplianceSiteListResultIterator(page VirtualApplianceSiteListResultPage) VirtualApplianceSiteListResultIterator { - return VirtualApplianceSiteListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vaslr VirtualApplianceSiteListResult) IsEmpty() bool { - return vaslr.Value == nil || len(*vaslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vaslr VirtualApplianceSiteListResult) hasNextLink() bool { - return vaslr.NextLink != nil && len(*vaslr.NextLink) != 0 -} - -// virtualApplianceSiteListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vaslr VirtualApplianceSiteListResult) virtualApplianceSiteListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vaslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vaslr.NextLink))) -} - -// VirtualApplianceSiteListResultPage contains a page of VirtualApplianceSite values. -type VirtualApplianceSiteListResultPage struct { - fn func(context.Context, VirtualApplianceSiteListResult) (VirtualApplianceSiteListResult, error) - vaslr VirtualApplianceSiteListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceSiteListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSiteListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vaslr) - if err != nil { - return err - } - page.vaslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceSiteListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceSiteListResultPage) NotDone() bool { - return !page.vaslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceSiteListResultPage) Response() VirtualApplianceSiteListResult { - return page.vaslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceSiteListResultPage) Values() []VirtualApplianceSite { - if page.vaslr.IsEmpty() { - return nil - } - return *page.vaslr.Value -} - -// Creates a new instance of the VirtualApplianceSiteListResultPage type. -func NewVirtualApplianceSiteListResultPage(cur VirtualApplianceSiteListResult, getNextPage func(context.Context, VirtualApplianceSiteListResult) (VirtualApplianceSiteListResult, error)) VirtualApplianceSiteListResultPage { - return VirtualApplianceSiteListResultPage{ - fn: getNextPage, - vaslr: cur, - } -} - -// VirtualApplianceSiteProperties properties of the rule group. -type VirtualApplianceSiteProperties struct { - // AddressPrefix - Address Prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // O365Policy - Office 365 Policy. - O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSiteProperties. -func (vasp VirtualApplianceSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vasp.AddressPrefix != nil { - objectMap["addressPrefix"] = vasp.AddressPrefix - } - if vasp.O365Policy != nil { - objectMap["o365Policy"] = vasp.O365Policy - } - return json.Marshal(objectMap) -} - -// VirtualApplianceSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualApplianceSitesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualApplianceSitesClient) (VirtualApplianceSite, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualApplianceSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualApplianceSitesCreateOrUpdateFuture.Result. -func (future *VirtualApplianceSitesCreateOrUpdateFuture) result(client VirtualApplianceSitesClient) (vas VirtualApplianceSite, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vas.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualApplianceSitesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vas.Response.Response, err = future.GetResult(sender); err == nil && vas.Response.Response.StatusCode != http.StatusNoContent { - vas, err = client.CreateOrUpdateResponder(vas.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesCreateOrUpdateFuture", "Result", vas.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualApplianceSitesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualApplianceSitesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualApplianceSitesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualApplianceSitesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualApplianceSitesDeleteFuture.Result. -func (future *VirtualApplianceSitesDeleteFuture) result(client VirtualApplianceSitesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualApplianceSitesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualApplianceSku definition of the NetworkVirtualApplianceSkus resource. -type VirtualApplianceSku struct { - autorest.Response `json:"-"` - // VirtualApplianceSkuPropertiesFormat - NetworkVirtualApplianceSku properties. - *VirtualApplianceSkuPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSku. -func (vas VirtualApplianceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vas.VirtualApplianceSkuPropertiesFormat != nil { - objectMap["properties"] = vas.VirtualApplianceSkuPropertiesFormat - } - if vas.ID != nil { - objectMap["id"] = vas.ID - } - if vas.Location != nil { - objectMap["location"] = vas.Location - } - if vas.Tags != nil { - objectMap["tags"] = vas.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualApplianceSku struct. -func (vas *VirtualApplianceSku) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualApplianceSkuPropertiesFormat VirtualApplianceSkuPropertiesFormat - err = json.Unmarshal(*v, &virtualApplianceSkuPropertiesFormat) - if err != nil { - return err - } - vas.VirtualApplianceSkuPropertiesFormat = &virtualApplianceSkuPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vas.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vas.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vas.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vas.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vas.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vas.Tags = tags - } - } - } - - return nil -} - -// VirtualApplianceSkuInstances list of available Sku and instances. -type VirtualApplianceSkuInstances struct { - // ScaleUnit - READ-ONLY; Scale Unit. - ScaleUnit *string `json:"scaleUnit,omitempty"` - // InstanceCount - READ-ONLY; Instance Count. - InstanceCount *int32 `json:"instanceCount,omitempty"` -} - -// VirtualApplianceSkuListResult response for ListNetworkVirtualApplianceSkus API service call. -type VirtualApplianceSkuListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliance Skus that are available. - Value *[]VirtualApplianceSku `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceSkuListResultIterator provides access to a complete listing of VirtualApplianceSku -// values. -type VirtualApplianceSkuListResultIterator struct { - i int - page VirtualApplianceSkuListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceSkuListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkuListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceSkuListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceSkuListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceSkuListResultIterator) Response() VirtualApplianceSkuListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceSkuListResultIterator) Value() VirtualApplianceSku { - if !iter.page.NotDone() { - return VirtualApplianceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceSkuListResultIterator type. -func NewVirtualApplianceSkuListResultIterator(page VirtualApplianceSkuListResultPage) VirtualApplianceSkuListResultIterator { - return VirtualApplianceSkuListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vaslr VirtualApplianceSkuListResult) IsEmpty() bool { - return vaslr.Value == nil || len(*vaslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vaslr VirtualApplianceSkuListResult) hasNextLink() bool { - return vaslr.NextLink != nil && len(*vaslr.NextLink) != 0 -} - -// virtualApplianceSkuListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vaslr VirtualApplianceSkuListResult) virtualApplianceSkuListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vaslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vaslr.NextLink))) -} - -// VirtualApplianceSkuListResultPage contains a page of VirtualApplianceSku values. -type VirtualApplianceSkuListResultPage struct { - fn func(context.Context, VirtualApplianceSkuListResult) (VirtualApplianceSkuListResult, error) - vaslr VirtualApplianceSkuListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceSkuListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkuListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vaslr) - if err != nil { - return err - } - page.vaslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceSkuListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceSkuListResultPage) NotDone() bool { - return !page.vaslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceSkuListResultPage) Response() VirtualApplianceSkuListResult { - return page.vaslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceSkuListResultPage) Values() []VirtualApplianceSku { - if page.vaslr.IsEmpty() { - return nil - } - return *page.vaslr.Value -} - -// Creates a new instance of the VirtualApplianceSkuListResultPage type. -func NewVirtualApplianceSkuListResultPage(cur VirtualApplianceSkuListResult, getNextPage func(context.Context, VirtualApplianceSkuListResult) (VirtualApplianceSkuListResult, error)) VirtualApplianceSkuListResultPage { - return VirtualApplianceSkuListResultPage{ - fn: getNextPage, - vaslr: cur, - } -} - -// VirtualApplianceSkuProperties network Virtual Appliance Sku Properties. -type VirtualApplianceSkuProperties struct { - // Vendor - Virtual Appliance Vendor. - Vendor *string `json:"vendor,omitempty"` - // BundledScaleUnit - Virtual Appliance Scale Unit. - BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"` - // MarketPlaceVersion - Virtual Appliance Version. - MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"` -} - -// VirtualApplianceSkuPropertiesFormat properties specific to NetworkVirtualApplianceSkus. -type VirtualApplianceSkuPropertiesFormat struct { - // Vendor - READ-ONLY; Network Virtual Appliance Sku vendor. - Vendor *string `json:"vendor,omitempty"` - // AvailableVersions - READ-ONLY; Available Network Virtual Appliance versions. - AvailableVersions *[]string `json:"availableVersions,omitempty"` - // AvailableScaleUnits - The list of scale units available. - AvailableScaleUnits *[]VirtualApplianceSkuInstances `json:"availableScaleUnits,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSkuPropertiesFormat. -func (vaspf VirtualApplianceSkuPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vaspf.AvailableScaleUnits != nil { - objectMap["availableScaleUnits"] = vaspf.AvailableScaleUnits - } - return json.Marshal(objectMap) -} - -// VirtualHub virtualHub Resource. -type VirtualHub struct { - autorest.Response `json:"-"` - // VirtualHubProperties - Properties of the virtual hub. - *VirtualHubProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualHub. -func (vh VirtualHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vh.VirtualHubProperties != nil { - objectMap["properties"] = vh.VirtualHubProperties - } - if vh.ID != nil { - objectMap["id"] = vh.ID - } - if vh.Location != nil { - objectMap["location"] = vh.Location - } - if vh.Tags != nil { - objectMap["tags"] = vh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualHub struct. -func (vh *VirtualHub) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualHubProperties VirtualHubProperties - err = json.Unmarshal(*v, &virtualHubProperties) - if err != nil { - return err - } - vh.VirtualHubProperties = &virtualHubProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vh.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vh.Tags = tags - } - } - } - - return nil -} - -// VirtualHubBgpConnectionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualHubBgpConnectionCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionClient) (BgpConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionCreateOrUpdateFuture.Result. -func (future *VirtualHubBgpConnectionCreateOrUpdateFuture) result(client VirtualHubBgpConnectionClient) (bc BgpConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bc.Response.Response, err = future.GetResult(sender); err == nil && bc.Response.Response.StatusCode != http.StatusNoContent { - bc, err = client.CreateOrUpdateResponder(bc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionCreateOrUpdateFuture", "Result", bc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubBgpConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubBgpConnectionDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionDeleteFuture.Result. -func (future *VirtualHubBgpConnectionDeleteFuture) result(client VirtualHubBgpConnectionClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubEffectiveRoute the effective route configured on the virtual hub or specified resource. -type VirtualHubEffectiveRoute struct { - // AddressPrefixes - The list of address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHops - The list of next hops. - NextHops *[]string `json:"nextHops,omitempty"` - // NextHopType - The type of the next hop. - NextHopType *string `json:"nextHopType,omitempty"` - // AsPath - The ASPath of this route. - AsPath *string `json:"asPath,omitempty"` - // RouteOrigin - The origin of this route. - RouteOrigin *string `json:"routeOrigin,omitempty"` -} - -// VirtualHubEffectiveRouteList effectiveRoutes List. -type VirtualHubEffectiveRouteList struct { - // Value - The list of effective routes configured on the virtual hub or the specified resource. - Value *[]VirtualHubEffectiveRoute `json:"value,omitempty"` -} - -// VirtualHubID virtual Hub identifier. -type VirtualHubID struct { - // ID - The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. - ID *string `json:"id,omitempty"` -} - -// VirtualHubIPConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualHubIPConfigurationCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubIPConfigurationClient) (HubIPConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubIPConfigurationCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubIPConfigurationCreateOrUpdateFuture.Result. -func (future *VirtualHubIPConfigurationCreateOrUpdateFuture) result(client VirtualHubIPConfigurationClient) (hic HubIPConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hic.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubIPConfigurationCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hic.Response.Response, err = future.GetResult(sender); err == nil && hic.Response.Response.StatusCode != http.StatusNoContent { - hic, err = client.CreateOrUpdateResponder(hic.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationCreateOrUpdateFuture", "Result", hic.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubIPConfigurationDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubIPConfigurationDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubIPConfigurationClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubIPConfigurationDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubIPConfigurationDeleteFuture.Result. -func (future *VirtualHubIPConfigurationDeleteFuture) result(client VirtualHubIPConfigurationClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubIPConfigurationDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubProperties parameters for VirtualHub. -type VirtualHubProperties struct { - // VirtualWan - The VirtualWAN to which the VirtualHub belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - // VpnGateway - The VpnGateway associated with this VirtualHub. - VpnGateway *SubResource `json:"vpnGateway,omitempty"` - // P2SVpnGateway - The P2SVpnGateway associated with this VirtualHub. - P2SVpnGateway *SubResource `json:"p2SVpnGateway,omitempty"` - // ExpressRouteGateway - The expressRouteGateway associated with this VirtualHub. - ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"` - // AzureFirewall - The azureFirewall associated with this VirtualHub. - AzureFirewall *SubResource `json:"azureFirewall,omitempty"` - // SecurityPartnerProvider - The securityPartnerProvider associated with this VirtualHub. - SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"` - // AddressPrefix - Address-prefix for this VirtualHub. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // RouteTable - The routeTable associated with this virtual hub. - RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The Security Provider name. - SecurityProviderName *string `json:"securityProviderName,omitempty"` - // VirtualHubRouteTableV2s - List of all virtual hub route table v2s associated with this VirtualHub. - VirtualHubRouteTableV2s *[]VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"` - // Sku - The sku of this VirtualHub. - Sku *string `json:"sku,omitempty"` - // RoutingState - The routing state. Possible values include: 'RoutingStateNone', 'RoutingStateProvisioned', 'RoutingStateProvisioning', 'RoutingStateFailed' - RoutingState RoutingState `json:"routingState,omitempty"` - // BgpConnections - READ-ONLY; List of references to Bgp Connections. - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - // IPConfigurations - READ-ONLY; List of references to IpConfigurations. - IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"` - // VirtualRouterAsn - VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - // VirtualRouterIps - VirtualRouter IPs. - VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubProperties. -func (vhp VirtualHubProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhp.VirtualWan != nil { - objectMap["virtualWan"] = vhp.VirtualWan - } - if vhp.VpnGateway != nil { - objectMap["vpnGateway"] = vhp.VpnGateway - } - if vhp.P2SVpnGateway != nil { - objectMap["p2SVpnGateway"] = vhp.P2SVpnGateway - } - if vhp.ExpressRouteGateway != nil { - objectMap["expressRouteGateway"] = vhp.ExpressRouteGateway - } - if vhp.AzureFirewall != nil { - objectMap["azureFirewall"] = vhp.AzureFirewall - } - if vhp.SecurityPartnerProvider != nil { - objectMap["securityPartnerProvider"] = vhp.SecurityPartnerProvider - } - if vhp.AddressPrefix != nil { - objectMap["addressPrefix"] = vhp.AddressPrefix - } - if vhp.RouteTable != nil { - objectMap["routeTable"] = vhp.RouteTable - } - if vhp.SecurityProviderName != nil { - objectMap["securityProviderName"] = vhp.SecurityProviderName - } - if vhp.VirtualHubRouteTableV2s != nil { - objectMap["virtualHubRouteTableV2s"] = vhp.VirtualHubRouteTableV2s - } - if vhp.Sku != nil { - objectMap["sku"] = vhp.Sku - } - if vhp.RoutingState != "" { - objectMap["routingState"] = vhp.RoutingState - } - if vhp.VirtualRouterAsn != nil { - objectMap["virtualRouterAsn"] = vhp.VirtualRouterAsn - } - if vhp.VirtualRouterIps != nil { - objectMap["virtualRouterIps"] = vhp.VirtualRouterIps - } - return json.Marshal(objectMap) -} - -// VirtualHubRoute virtualHub route. -type VirtualHubRoute struct { - // AddressPrefixes - List of all addressPrefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHopIPAddress - NextHop ip address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// VirtualHubRouteTable virtualHub route table. -type VirtualHubRouteTable struct { - // Routes - List of all routes. - Routes *[]VirtualHubRoute `json:"routes,omitempty"` -} - -// VirtualHubRouteTableV2 virtualHubRouteTableV2 Resource. -type VirtualHubRouteTableV2 struct { - autorest.Response `json:"-"` - // VirtualHubRouteTableV2Properties - Properties of the virtual hub route table v2. - *VirtualHubRouteTableV2Properties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubRouteTableV2. -func (vhrtv VirtualHubRouteTableV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhrtv.VirtualHubRouteTableV2Properties != nil { - objectMap["properties"] = vhrtv.VirtualHubRouteTableV2Properties - } - if vhrtv.Name != nil { - objectMap["name"] = vhrtv.Name - } - if vhrtv.ID != nil { - objectMap["id"] = vhrtv.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualHubRouteTableV2 struct. -func (vhrtv *VirtualHubRouteTableV2) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualHubRouteTableV2Properties VirtualHubRouteTableV2Properties - err = json.Unmarshal(*v, &virtualHubRouteTableV2Properties) - if err != nil { - return err - } - vhrtv.VirtualHubRouteTableV2Properties = &virtualHubRouteTableV2Properties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vhrtv.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vhrtv.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vhrtv.ID = &ID - } - } - } - - return nil -} - -// VirtualHubRouteTableV2Properties parameters for VirtualHubRouteTableV2. -type VirtualHubRouteTableV2Properties struct { - // Routes - List of all routes. - Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"` - // AttachedConnections - List of all connections attached to this route table v2. - AttachedConnections *[]string `json:"attachedConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub route table v2 resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubRouteTableV2Properties. -func (vhrtvp VirtualHubRouteTableV2Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhrtvp.Routes != nil { - objectMap["routes"] = vhrtvp.Routes - } - if vhrtvp.AttachedConnections != nil { - objectMap["attachedConnections"] = vhrtvp.AttachedConnections - } - return json.Marshal(objectMap) -} - -// VirtualHubRouteTableV2sCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualHubRouteTableV2sCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubRouteTableV2sClient) (VirtualHubRouteTableV2, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubRouteTableV2sCreateOrUpdateFuture.Result. -func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) result(client VirtualHubRouteTableV2sClient) (vhrtv VirtualHubRouteTableV2, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vhrtv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vhrtv.Response.Response, err = future.GetResult(sender); err == nil && vhrtv.Response.Response.StatusCode != http.StatusNoContent { - vhrtv, err = client.CreateOrUpdateResponder(vhrtv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", vhrtv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubRouteTableV2sDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubRouteTableV2sDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubRouteTableV2sClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubRouteTableV2sDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubRouteTableV2sDeleteFuture.Result. -func (future *VirtualHubRouteTableV2sDeleteFuture) result(client VirtualHubRouteTableV2sClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubRouteV2 virtualHubRouteTableV2 route. -type VirtualHubRouteV2 struct { - // DestinationType - The type of destinations. - DestinationType *string `json:"destinationType,omitempty"` - // Destinations - List of all destinations. - Destinations *[]string `json:"destinations,omitempty"` - // NextHopType - The type of next hops. - NextHopType *string `json:"nextHopType,omitempty"` - // NextHops - NextHops ip address. - NextHops *[]string `json:"nextHops,omitempty"` -} - -// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (VirtualHub, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsCreateOrUpdateFuture.Result. -func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { - vh, err = client.CreateOrUpdateResponder(vh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", vh.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualHubsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsDeleteFuture.Result. -func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubsGetEffectiveVirtualHubRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualHubsGetEffectiveVirtualHubRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsGetEffectiveVirtualHubRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsGetEffectiveVirtualHubRoutesFuture.Result. -func (future *VirtualHubsGetEffectiveVirtualHubRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsGetEffectiveVirtualHubRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetEffectiveVirtualHubRoutesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetwork virtual Network resource. -type VirtualNetwork struct { - autorest.Response `json:"-"` - // VirtualNetworkPropertiesFormat - Properties of the virtual network. - *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetwork. -func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vn.VirtualNetworkPropertiesFormat != nil { - objectMap["properties"] = vn.VirtualNetworkPropertiesFormat - } - if vn.ID != nil { - objectMap["id"] = vn.ID - } - if vn.Location != nil { - objectMap["location"] = vn.Location - } - if vn.Tags != nil { - objectMap["tags"] = vn.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. -func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) - if err != nil { - return err - } - vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vn.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vn.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vn.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vn.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vn.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vn.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkBgpCommunities bgp Communities sent over ExpressRoute with each route corresponding to a -// prefix in this VNET. -type VirtualNetworkBgpCommunities struct { - // VirtualNetworkCommunity - The BGP community associated with the virtual network. - VirtualNetworkCommunity *string `json:"virtualNetworkCommunity,omitempty"` - // RegionalCommunity - READ-ONLY; The BGP community associated with the region of the virtual network. - RegionalCommunity *string `json:"regionalCommunity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkBgpCommunities. -func (vnbc VirtualNetworkBgpCommunities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnbc.VirtualNetworkCommunity != nil { - objectMap["virtualNetworkCommunity"] = vnbc.VirtualNetworkCommunity - } - return json.Marshal(objectMap) -} - -// VirtualNetworkConnectionGatewayReference a reference to VirtualNetworkGateway or LocalNetworkGateway -// resource. -type VirtualNetworkConnectionGatewayReference struct { - // ID - The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - ID *string `json:"id,omitempty"` -} - -// VirtualNetworkGateway a common class for general resource information. -type VirtualNetworkGateway struct { - autorest.Response `json:"-"` - // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. - *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGateway. -func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vng.VirtualNetworkGatewayPropertiesFormat != nil { - objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat - } - if vng.ID != nil { - objectMap["id"] = vng.ID - } - if vng.Location != nil { - objectMap["location"] = vng.Location - } - if vng.Tags != nil { - objectMap["tags"] = vng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. -func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) - if err != nil { - return err - } - vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vng.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnection a common class for general resource information. -type VirtualNetworkGatewayConnection struct { - autorest.Response `json:"-"` - // VirtualNetworkGatewayConnectionPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. -func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { - objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat - } - if vngc.ID != nil { - objectMap["id"] = vngc.ID - } - if vngc.Location != nil { - objectMap["location"] = vngc.Location - } - if vngc.Tags != nil { - objectMap["tags"] = vngc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. -func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) - if err != nil { - return err - } - vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vngc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vngc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vngc.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnectionListEntity a common class for general resource information. -type VirtualNetworkGatewayConnectionListEntity struct { - // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntity. -func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat != nil { - objectMap["properties"] = vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat - } - if vngcle.ID != nil { - objectMap["id"] = vngcle.ID - } - if vngcle.Location != nil { - objectMap["location"] = vngcle.Location - } - if vngcle.Tags != nil { - objectMap["tags"] = vngcle.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnectionListEntity struct. -func (vngcle *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayConnectionListEntityPropertiesFormat VirtualNetworkGatewayConnectionListEntityPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionListEntityPropertiesFormat) - if err != nil { - return err - } - vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &virtualNetworkGatewayConnectionListEntityPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngcle.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngcle.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngcle.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vngcle.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vngcle.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vngcle.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnectionListEntityPropertiesFormat virtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { - // AuthorizationKey - The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // VirtualNetworkGateway1 - The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"` - // VirtualNetworkGateway2 - The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` - // LocalNetworkGateway2 - The reference to local network gateway resource. - LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - // RoutingWeight - The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // SharedKey - The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // Peer - The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. -func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngclepf.AuthorizationKey != nil { - objectMap["authorizationKey"] = vngclepf.AuthorizationKey - } - if vngclepf.VirtualNetworkGateway1 != nil { - objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1 - } - if vngclepf.VirtualNetworkGateway2 != nil { - objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2 - } - if vngclepf.LocalNetworkGateway2 != nil { - objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2 - } - if vngclepf.ConnectionType != "" { - objectMap["connectionType"] = vngclepf.ConnectionType - } - if vngclepf.ConnectionProtocol != "" { - objectMap["connectionProtocol"] = vngclepf.ConnectionProtocol - } - if vngclepf.RoutingWeight != nil { - objectMap["routingWeight"] = vngclepf.RoutingWeight - } - if vngclepf.SharedKey != nil { - objectMap["sharedKey"] = vngclepf.SharedKey - } - if vngclepf.Peer != nil { - objectMap["peer"] = vngclepf.Peer - } - if vngclepf.EnableBgp != nil { - objectMap["enableBgp"] = vngclepf.EnableBgp - } - if vngclepf.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors - } - if vngclepf.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies - } - if vngclepf.TrafficSelectorPolicies != nil { - objectMap["trafficSelectorPolicies"] = vngclepf.TrafficSelectorPolicies - } - if vngclepf.ExpressRouteGatewayBypass != nil { - objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API -// service call. -type VirtualNetworkGatewayConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListResult. -func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngclr.Value != nil { - objectMap["value"] = vngclr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of -// VirtualNetworkGatewayConnection values. -type VirtualNetworkGatewayConnectionListResultIterator struct { - i int - page VirtualNetworkGatewayConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { - if !iter.page.NotDone() { - return VirtualNetworkGatewayConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type. -func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator { - return VirtualNetworkGatewayConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { - return vngclr.Value == nil || len(*vngclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { - return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 -} - -// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vngclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vngclr.NextLink))) -} - -// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. -type VirtualNetworkGatewayConnectionListResultPage struct { - fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) - vngclr VirtualNetworkGatewayConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vngclr) - if err != nil { - return err - } - page.vngclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { - return !page.vngclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { - return page.vngclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { - if page.vngclr.IsEmpty() { - return nil - } - return *page.vngclr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. -func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { - return VirtualNetworkGatewayConnectionListResultPage{ - fn: getNextPage, - vngclr: cur, - } -} - -// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionPropertiesFormat struct { - // AuthorizationKey - The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // VirtualNetworkGateway1 - The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` - // VirtualNetworkGateway2 - The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` - // LocalNetworkGateway2 - The reference to local network gateway resource. - LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - // RoutingWeight - The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // DpdTimeoutSeconds - The dead peer detection timeout of this connection in seconds. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - // SharedKey - The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // Peer - The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // UseLocalAzureIPAddress - Use private local Azure IP for the connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. -func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngcpf.AuthorizationKey != nil { - objectMap["authorizationKey"] = vngcpf.AuthorizationKey - } - if vngcpf.VirtualNetworkGateway1 != nil { - objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 - } - if vngcpf.VirtualNetworkGateway2 != nil { - objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 - } - if vngcpf.LocalNetworkGateway2 != nil { - objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 - } - if vngcpf.ConnectionType != "" { - objectMap["connectionType"] = vngcpf.ConnectionType - } - if vngcpf.ConnectionProtocol != "" { - objectMap["connectionProtocol"] = vngcpf.ConnectionProtocol - } - if vngcpf.RoutingWeight != nil { - objectMap["routingWeight"] = vngcpf.RoutingWeight - } - if vngcpf.DpdTimeoutSeconds != nil { - objectMap["dpdTimeoutSeconds"] = vngcpf.DpdTimeoutSeconds - } - if vngcpf.SharedKey != nil { - objectMap["sharedKey"] = vngcpf.SharedKey - } - if vngcpf.Peer != nil { - objectMap["peer"] = vngcpf.Peer - } - if vngcpf.EnableBgp != nil { - objectMap["enableBgp"] = vngcpf.EnableBgp - } - if vngcpf.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vngcpf.UseLocalAzureIPAddress - } - if vngcpf.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors - } - if vngcpf.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies - } - if vngcpf.TrafficSelectorPolicies != nil { - objectMap["trafficSelectorPolicies"] = vngcpf.TrafficSelectorPolicies - } - if vngcpf.ExpressRouteGatewayBypass != nil { - objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vngc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { - vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewayConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. -func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. -func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - crsk.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent { - crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. -func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - csk.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent { - csk, err = client.SetSharedKeyResponder(csk.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsStartPacketCaptureFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualNetworkGatewayConnectionsStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsStartPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsStopPacketCaptureFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsStopPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsUpdateTagsFuture.Result. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vngc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { - vngc, err = client.UpdateTagsResponder(vngc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway. -type VirtualNetworkGatewayIPConfiguration struct { - // VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of the virtual network gateway ip configuration. - *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. -func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat - } - if vngic.Name != nil { - objectMap["name"] = vngic.Name - } - if vngic.ID != nil { - objectMap["id"] = vngic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. -func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) - if err != nil { - return err - } - vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngic.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration. -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP Address for this gateway. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. -func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod - } - if vngicpf.Subnet != nil { - objectMap["subnet"] = vngicpf.Subnet - } - if vngicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = vngicpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API -// service call. -type VirtualNetworkGatewayListConnectionsResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListConnectionsResult. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnglcr.Value != nil { - objectMap["value"] = vnglcr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListConnectionsResultIterator provides access to a complete listing of -// VirtualNetworkGatewayConnectionListEntity values. -type VirtualNetworkGatewayListConnectionsResultIterator struct { - i int - page VirtualNetworkGatewayListConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayListConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayListConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) Response() VirtualNetworkGatewayListConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) Value() VirtualNetworkGatewayConnectionListEntity { - if !iter.page.NotDone() { - return VirtualNetworkGatewayConnectionListEntity{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultIterator type. -func NewVirtualNetworkGatewayListConnectionsResultIterator(page VirtualNetworkGatewayListConnectionsResultPage) VirtualNetworkGatewayListConnectionsResultIterator { - return VirtualNetworkGatewayListConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool { - return vnglcr.Value == nil || len(*vnglcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool { - return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0 -} - -// virtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnglcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnglcr.NextLink))) -} - -// VirtualNetworkGatewayListConnectionsResultPage contains a page of -// VirtualNetworkGatewayConnectionListEntity values. -type VirtualNetworkGatewayListConnectionsResultPage struct { - fn func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error) - vnglcr VirtualNetworkGatewayListConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnglcr) - if err != nil { - return err - } - page.vnglcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayListConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayListConnectionsResultPage) NotDone() bool { - return !page.vnglcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayListConnectionsResultPage) Response() VirtualNetworkGatewayListConnectionsResult { - return page.vnglcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayListConnectionsResultPage) Values() []VirtualNetworkGatewayConnectionListEntity { - if page.vnglcr.IsEmpty() { - return nil - } - return *page.vnglcr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultPage type. -func NewVirtualNetworkGatewayListConnectionsResultPage(cur VirtualNetworkGatewayListConnectionsResult, getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage { - return VirtualNetworkGatewayListConnectionsResultPage{ - fn: getNextPage, - vnglcr: cur, - } -} - -// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. -type VirtualNetworkGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGateway resources that exists in a resource group. - Value *[]VirtualNetworkGateway `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListResult. -func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnglr.Value != nil { - objectMap["value"] = vnglr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway -// values. -type VirtualNetworkGatewayListResultIterator struct { - i int - page VirtualNetworkGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { - if !iter.page.NotDone() { - return VirtualNetworkGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayListResultIterator type. -func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator { - return VirtualNetworkGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { - return vnglr.Value == nil || len(*vnglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { - return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 -} - -// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnglr.NextLink))) -} - -// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. -type VirtualNetworkGatewayListResultPage struct { - fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) - vnglr VirtualNetworkGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnglr) - if err != nil { - return err - } - page.vnglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayListResultPage) NotDone() bool { - return !page.vnglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { - return page.vnglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { - if page.vnglr.IsEmpty() { - return nil - } - return *page.vnglr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayListResultPage type. -func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { - return VirtualNetworkGatewayListResultPage{ - fn: getNextPage, - vnglr: cur, - } -} - -// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties. -type VirtualNetworkGatewayPropertiesFormat struct { - // IPConfigurations - IP configurations for virtual network gateway. - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - // GatewayType - The type of this virtual network gateway. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute' - GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - // VpnType - The type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' - VpnType VpnType `json:"vpnType,omitempty"` - // VpnGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. Possible values include: 'VpnGatewayGenerationNone', 'VpnGatewayGenerationGeneration1', 'VpnGatewayGenerationGeneration2' - VpnGatewayGeneration VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - // EnableBgp - Whether BGP is enabled for this virtual network gateway or not. - EnableBgp *bool `json:"enableBgp,omitempty"` - // EnablePrivateIPAddress - Whether private IP needs to be enabled on this gateway for connections or not. - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - // ActiveActive - ActiveActive flag. - ActiveActive *bool `json:"activeActive,omitempty"` - // GatewayDefaultSite - The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - // Sku - The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - // VpnClientConfiguration - The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - // BgpSettings - Virtual network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // CustomRoutes - The reference to the address space resource which represents the custom routes address space specified by the customer for virtual network gateway and VpnClient. - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // EnableDNSForwarding - Whether dns forwarding is enabled or not. - EnableDNSForwarding *bool `json:"enableDnsForwarding,omitempty"` - // InboundDNSForwardingEndpoint - READ-ONLY; The IP address allocated by the gateway to which dns requests can be sent. - InboundDNSForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. -func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = vngpf.IPConfigurations - } - if vngpf.GatewayType != "" { - objectMap["gatewayType"] = vngpf.GatewayType - } - if vngpf.VpnType != "" { - objectMap["vpnType"] = vngpf.VpnType - } - if vngpf.VpnGatewayGeneration != "" { - objectMap["vpnGatewayGeneration"] = vngpf.VpnGatewayGeneration - } - if vngpf.EnableBgp != nil { - objectMap["enableBgp"] = vngpf.EnableBgp - } - if vngpf.EnablePrivateIPAddress != nil { - objectMap["enablePrivateIpAddress"] = vngpf.EnablePrivateIPAddress - } - if vngpf.ActiveActive != nil { - objectMap["activeActive"] = vngpf.ActiveActive - } - if vngpf.GatewayDefaultSite != nil { - objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite - } - if vngpf.Sku != nil { - objectMap["sku"] = vngpf.Sku - } - if vngpf.VpnClientConfiguration != nil { - objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration - } - if vngpf.BgpSettings != nil { - objectMap["bgpSettings"] = vngpf.BgpSettings - } - if vngpf.CustomRoutes != nil { - objectMap["customRoutes"] = vngpf.CustomRoutes - } - if vngpf.EnableDNSForwarding != nil { - objectMap["enableDnsForwarding"] = vngpf.EnableDNSForwarding - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. -func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.CreateOrUpdateResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. -func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture an abstraction for monitoring -// and retrieving the results of a long-running operation. -type VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture.Result. -func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result. -func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GeneratevpnclientpackageResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysGenerateVpnProfileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGenerateVpnProfileFuture.Result. -func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GenerateVpnProfileResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result. -func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - grlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { - grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result. -func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bpslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent { - bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result. -func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - grlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { - grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientConnectionHealthDetailListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) result(client VirtualNetworkGatewaysClient) (vcchdlr VpnClientConnectionHealthDetailListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcchdlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcchdlr.Response.Response, err = future.GetResult(sender); err == nil && vcchdlr.Response.Response.StatusCode != http.StatusNoContent { - vcchdlr, err = client.GetVpnclientConnectionHealthResponder(vcchdlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", vcchdlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcipp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { - vcipp, err = client.GetVpnclientIpsecParametersResponder(vcipp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GetVpnProfilePackageURLResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaySku virtualNetworkGatewaySku details. -type VirtualNetworkGatewaySku struct { - // Name - Gateway SKU name. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance', 'VirtualNetworkGatewaySkuNameVpnGw1', 'VirtualNetworkGatewaySkuNameVpnGw2', 'VirtualNetworkGatewaySkuNameVpnGw3', 'VirtualNetworkGatewaySkuNameVpnGw4', 'VirtualNetworkGatewaySkuNameVpnGw5', 'VirtualNetworkGatewaySkuNameVpnGw1AZ', 'VirtualNetworkGatewaySkuNameVpnGw2AZ', 'VirtualNetworkGatewaySkuNameVpnGw3AZ', 'VirtualNetworkGatewaySkuNameVpnGw4AZ', 'VirtualNetworkGatewaySkuNameVpnGw5AZ', 'VirtualNetworkGatewaySkuNameErGw1AZ', 'VirtualNetworkGatewaySkuNameErGw2AZ', 'VirtualNetworkGatewaySkuNameErGw3AZ' - Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` - // Tier - Gateway SKU tier. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance', 'VirtualNetworkGatewaySkuTierVpnGw1', 'VirtualNetworkGatewaySkuTierVpnGw2', 'VirtualNetworkGatewaySkuTierVpnGw3', 'VirtualNetworkGatewaySkuTierVpnGw4', 'VirtualNetworkGatewaySkuTierVpnGw5', 'VirtualNetworkGatewaySkuTierVpnGw1AZ', 'VirtualNetworkGatewaySkuTierVpnGw2AZ', 'VirtualNetworkGatewaySkuTierVpnGw3AZ', 'VirtualNetworkGatewaySkuTierVpnGw4AZ', 'VirtualNetworkGatewaySkuTierVpnGw5AZ', 'VirtualNetworkGatewaySkuTierErGw1AZ', 'VirtualNetworkGatewaySkuTierErGw2AZ', 'VirtualNetworkGatewaySkuTierErGw3AZ' - Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` - // Capacity - READ-ONLY; The capacity. - Capacity *int32 `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewaySku. -func (vngs VirtualNetworkGatewaySku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngs.Name != "" { - objectMap["name"] = vngs.Name - } - if vngs.Tier != "" { - objectMap["tier"] = vngs.Tier - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysResetFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. -func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.ResetResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysResetVpnClientSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysResetVpnClientSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.Result. -func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.Result. -func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcipp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { - vcipp, err = client.SetVpnclientIpsecParametersResponder(vcipp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysStartPacketCaptureFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysStartPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysStopPacketCaptureFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysStopPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysUpdateTagsFuture.Result. -func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.UpdateTagsResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkListResult response for the ListVirtualNetworks API service call. -type VirtualNetworkListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetwork resources in a resource group. - Value *[]VirtualNetwork `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. -type VirtualNetworkListResultIterator struct { - i int - page VirtualNetworkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { - if !iter.page.NotDone() { - return VirtualNetwork{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkListResultIterator type. -func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator { - return VirtualNetworkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnlr VirtualNetworkListResult) IsEmpty() bool { - return vnlr.Value == nil || len(*vnlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnlr VirtualNetworkListResult) hasNextLink() bool { - return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 -} - -// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnlr.NextLink))) -} - -// VirtualNetworkListResultPage contains a page of VirtualNetwork values. -type VirtualNetworkListResultPage struct { - fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error) - vnlr VirtualNetworkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnlr) - if err != nil { - return err - } - page.vnlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkListResultPage) NotDone() bool { - return !page.vnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { - return page.vnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { - if page.vnlr.IsEmpty() { - return nil - } - return *page.vnlr.Value -} - -// Creates a new instance of the VirtualNetworkListResultPage type. -func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { - return VirtualNetworkListResultPage{ - fn: getNextPage, - vnlr: cur, - } -} - -// VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call. -type VirtualNetworkListUsageResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; VirtualNetwork usage stats. - Value *[]VirtualNetworkUsage `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkListUsageResult. -func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnlur.NextLink != nil { - objectMap["nextLink"] = vnlur.NextLink - } - return json.Marshal(objectMap) -} - -// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage -// values. -type VirtualNetworkListUsageResultIterator struct { - i int - page VirtualNetworkListUsageResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkListUsageResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkListUsageResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkListUsageResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkListUsageResultIterator) Response() VirtualNetworkListUsageResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkListUsageResultIterator) Value() VirtualNetworkUsage { - if !iter.page.NotDone() { - return VirtualNetworkUsage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkListUsageResultIterator type. -func NewVirtualNetworkListUsageResultIterator(page VirtualNetworkListUsageResultPage) VirtualNetworkListUsageResultIterator { - return VirtualNetworkListUsageResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { - return vnlur.Value == nil || len(*vnlur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool { - return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0 -} - -// virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnlur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnlur.NextLink))) -} - -// VirtualNetworkListUsageResultPage contains a page of VirtualNetworkUsage values. -type VirtualNetworkListUsageResultPage struct { - fn func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error) - vnlur VirtualNetworkListUsageResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnlur) - if err != nil { - return err - } - page.vnlur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkListUsageResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkListUsageResultPage) NotDone() bool { - return !page.vnlur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkListUsageResultPage) Response() VirtualNetworkListUsageResult { - return page.vnlur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { - if page.vnlur.IsEmpty() { - return nil - } - return *page.vnlur.Value -} - -// Creates a new instance of the VirtualNetworkListUsageResultPage type. -func NewVirtualNetworkListUsageResultPage(cur VirtualNetworkListUsageResult, getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage { - return VirtualNetworkListUsageResultPage{ - fn: getNextPage, - vnlur: cur, - } -} - -// VirtualNetworkPeering peerings in a virtual network resource. -type VirtualNetworkPeering struct { - autorest.Response `json:"-"` - // VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. - *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPeering. -func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnp.VirtualNetworkPeeringPropertiesFormat != nil { - objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat - } - if vnp.Name != nil { - objectMap["name"] = vnp.Name - } - if vnp.ID != nil { - objectMap["id"] = vnp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. -func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) - if err != nil { - return err - } - vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vnp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnp.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that -// belong to a virtual network. -type VirtualNetworkPeeringListResult struct { - autorest.Response `json:"-"` - // Value - The peerings in a virtual network. - Value *[]VirtualNetworkPeering `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering -// values. -type VirtualNetworkPeeringListResultIterator struct { - i int - page VirtualNetworkPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering { - if !iter.page.NotDone() { - return VirtualNetworkPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkPeeringListResultIterator type. -func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator { - return VirtualNetworkPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { - return vnplr.Value == nil || len(*vnplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { - return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 -} - -// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnplr.NextLink))) -} - -// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values. -type VirtualNetworkPeeringListResultPage struct { - fn func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error) - vnplr VirtualNetworkPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnplr) - if err != nil { - return err - } - page.vnplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkPeeringListResultPage) NotDone() bool { - return !page.vnplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult { - return page.vnplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering { - if page.vnplr.IsEmpty() { - return nil - } - return *page.vnplr.Value -} - -// Creates a new instance of the VirtualNetworkPeeringListResultPage type. -func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { - return VirtualNetworkPeeringListResultPage{ - fn: getNextPage, - vnplr: cur, - } -} - -// VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering. -type VirtualNetworkPeeringPropertiesFormat struct { - // AllowVirtualNetworkAccess - Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` - // RemoteVirtualNetwork - The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - // RemoteAddressSpace - The reference to the remote virtual network address space. - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - // PeeringState - The status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' - PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPeeringPropertiesFormat. -func (vnppf VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnppf.AllowVirtualNetworkAccess != nil { - objectMap["allowVirtualNetworkAccess"] = vnppf.AllowVirtualNetworkAccess - } - if vnppf.AllowForwardedTraffic != nil { - objectMap["allowForwardedTraffic"] = vnppf.AllowForwardedTraffic - } - if vnppf.AllowGatewayTransit != nil { - objectMap["allowGatewayTransit"] = vnppf.AllowGatewayTransit - } - if vnppf.UseRemoteGateways != nil { - objectMap["useRemoteGateways"] = vnppf.UseRemoteGateways - } - if vnppf.RemoteVirtualNetwork != nil { - objectMap["remoteVirtualNetwork"] = vnppf.RemoteVirtualNetwork - } - if vnppf.RemoteAddressSpace != nil { - objectMap["remoteAddressSpace"] = vnppf.RemoteAddressSpace - } - if vnppf.PeeringState != "" { - objectMap["peeringState"] = vnppf.PeeringState - } - return json.Marshal(objectMap) -} - -// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vnp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent { - vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result. -func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkPropertiesFormat properties of the virtual network. -type VirtualNetworkPropertiesFormat struct { - // AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - // DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - // Subnets - A list of subnets in a Virtual Network. - Subnets *[]Subnet `json:"subnets,omitempty"` - // VirtualNetworkPeerings - A list of peerings in a Virtual Network. - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` - // ResourceGUID - READ-ONLY; The resourceGuid property of the Virtual Network resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // EnableDdosProtection - Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - // EnableVMProtection - Indicates if VM protection is enabled for all the subnets in the virtual network. - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - // DdosProtectionPlan - The DDoS protection plan associated with the virtual network. - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - // BgpCommunities - Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - // IPAllocations - Array of IpAllocation which reference this VNET. - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPropertiesFormat. -func (vnpf VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnpf.AddressSpace != nil { - objectMap["addressSpace"] = vnpf.AddressSpace - } - if vnpf.DhcpOptions != nil { - objectMap["dhcpOptions"] = vnpf.DhcpOptions - } - if vnpf.Subnets != nil { - objectMap["subnets"] = vnpf.Subnets - } - if vnpf.VirtualNetworkPeerings != nil { - objectMap["virtualNetworkPeerings"] = vnpf.VirtualNetworkPeerings - } - if vnpf.EnableDdosProtection != nil { - objectMap["enableDdosProtection"] = vnpf.EnableDdosProtection - } - if vnpf.EnableVMProtection != nil { - objectMap["enableVmProtection"] = vnpf.EnableVMProtection - } - if vnpf.DdosProtectionPlan != nil { - objectMap["ddosProtectionPlan"] = vnpf.DdosProtectionPlan - } - if vnpf.BgpCommunities != nil { - objectMap["bgpCommunities"] = vnpf.BgpCommunities - } - if vnpf.IPAllocations != nil { - objectMap["ipAllocations"] = vnpf.IPAllocations - } - return json.Marshal(objectMap) -} - -// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (VirtualNetwork, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. -func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vn.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { - vn, err = client.CreateOrUpdateResponder(vn.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksDeleteFuture.Result. -func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkTap virtual Network Tap resource. -type VirtualNetworkTap struct { - autorest.Response `json:"-"` - // VirtualNetworkTapPropertiesFormat - Virtual Network Tap Properties. - *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkTap. -func (vnt VirtualNetworkTap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnt.VirtualNetworkTapPropertiesFormat != nil { - objectMap["properties"] = vnt.VirtualNetworkTapPropertiesFormat - } - if vnt.ID != nil { - objectMap["id"] = vnt.ID - } - if vnt.Location != nil { - objectMap["location"] = vnt.Location - } - if vnt.Tags != nil { - objectMap["tags"] = vnt.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkTap struct. -func (vnt *VirtualNetworkTap) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkTapPropertiesFormat VirtualNetworkTapPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkTapPropertiesFormat) - if err != nil { - return err - } - vnt.VirtualNetworkTapPropertiesFormat = &virtualNetworkTapPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vnt.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnt.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vnt.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vnt.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkTapListResult response for ListVirtualNetworkTap API service call. -type VirtualNetworkTapListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkTaps in a resource group. - Value *[]VirtualNetworkTap `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkTapListResultIterator provides access to a complete listing of VirtualNetworkTap values. -type VirtualNetworkTapListResultIterator struct { - i int - page VirtualNetworkTapListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkTapListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkTapListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkTapListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkTapListResultIterator) Response() VirtualNetworkTapListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkTapListResultIterator) Value() VirtualNetworkTap { - if !iter.page.NotDone() { - return VirtualNetworkTap{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkTapListResultIterator type. -func NewVirtualNetworkTapListResultIterator(page VirtualNetworkTapListResultPage) VirtualNetworkTapListResultIterator { - return VirtualNetworkTapListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vntlr VirtualNetworkTapListResult) IsEmpty() bool { - return vntlr.Value == nil || len(*vntlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vntlr VirtualNetworkTapListResult) hasNextLink() bool { - return vntlr.NextLink != nil && len(*vntlr.NextLink) != 0 -} - -// virtualNetworkTapListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vntlr VirtualNetworkTapListResult) virtualNetworkTapListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vntlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vntlr.NextLink))) -} - -// VirtualNetworkTapListResultPage contains a page of VirtualNetworkTap values. -type VirtualNetworkTapListResultPage struct { - fn func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error) - vntlr VirtualNetworkTapListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkTapListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vntlr) - if err != nil { - return err - } - page.vntlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkTapListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkTapListResultPage) NotDone() bool { - return !page.vntlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkTapListResultPage) Response() VirtualNetworkTapListResult { - return page.vntlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkTapListResultPage) Values() []VirtualNetworkTap { - if page.vntlr.IsEmpty() { - return nil - } - return *page.vntlr.Value -} - -// Creates a new instance of the VirtualNetworkTapListResultPage type. -func NewVirtualNetworkTapListResultPage(cur VirtualNetworkTapListResult, getNextPage func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)) VirtualNetworkTapListResultPage { - return VirtualNetworkTapListResultPage{ - fn: getNextPage, - vntlr: cur, - } -} - -// VirtualNetworkTapPropertiesFormat virtual Network Tap properties. -type VirtualNetworkTapPropertiesFormat struct { - // NetworkInterfaceTapConfigurations - READ-ONLY; Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. - NetworkInterfaceTapConfigurations *[]InterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network tap resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network tap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DestinationNetworkInterfaceIPConfiguration - The reference to the private IP Address of the collector nic that will receive the tap. - DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - // DestinationLoadBalancerFrontEndIPConfiguration - The reference to the private IP address on the internal Load Balancer that will receive the tap. - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - // DestinationPort - The VXLAN destination port that will receive the tapped traffic. - DestinationPort *int32 `json:"destinationPort,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkTapPropertiesFormat. -func (vntpf VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vntpf.DestinationNetworkInterfaceIPConfiguration != nil { - objectMap["destinationNetworkInterfaceIPConfiguration"] = vntpf.DestinationNetworkInterfaceIPConfiguration - } - if vntpf.DestinationLoadBalancerFrontEndIPConfiguration != nil { - objectMap["destinationLoadBalancerFrontEndIPConfiguration"] = vntpf.DestinationLoadBalancerFrontEndIPConfiguration - } - if vntpf.DestinationPort != nil { - objectMap["destinationPort"] = vntpf.DestinationPort - } - return json.Marshal(objectMap) -} - -// VirtualNetworkTapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkTapsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkTapsClient) (VirtualNetworkTap, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkTapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkTapsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkTapsCreateOrUpdateFuture) result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vnt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnt.Response.Response, err = future.GetResult(sender); err == nil && vnt.Response.Response.StatusCode != http.StatusNoContent { - vnt, err = client.CreateOrUpdateResponder(vnt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", vnt.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkTapsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkTapsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkTapsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkTapsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkTapsDeleteFuture.Result. -func (future *VirtualNetworkTapsDeleteFuture) result(client VirtualNetworkTapsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkUsage usage details for subnet. -type VirtualNetworkUsage struct { - // CurrentValue - READ-ONLY; Indicates number of IPs used from the Subnet. - CurrentValue *float64 `json:"currentValue,omitempty"` - // ID - READ-ONLY; Subnet identifier. - ID *string `json:"id,omitempty"` - // Limit - READ-ONLY; Indicates the size of the subnet. - Limit *float64 `json:"limit,omitempty"` - // Name - READ-ONLY; The name containing common and localized value for usage. - Name *VirtualNetworkUsageName `json:"name,omitempty"` - // Unit - READ-ONLY; Usage units. Returns 'Count'. - Unit *string `json:"unit,omitempty"` -} - -// VirtualNetworkUsageName usage strings container. -type VirtualNetworkUsageName struct { - // LocalizedValue - READ-ONLY; Localized subnet size and usage string. - LocalizedValue *string `json:"localizedValue,omitempty"` - // Value - READ-ONLY; Subnet size and usage string. - Value *string `json:"value,omitempty"` -} - -// VirtualRouter virtualRouter Resource. -type VirtualRouter struct { - autorest.Response `json:"-"` - // VirtualRouterPropertiesFormat - Properties of the Virtual Router. - *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualRouter. -func (vr VirtualRouter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vr.VirtualRouterPropertiesFormat != nil { - objectMap["properties"] = vr.VirtualRouterPropertiesFormat - } - if vr.ID != nil { - objectMap["id"] = vr.ID - } - if vr.Location != nil { - objectMap["location"] = vr.Location - } - if vr.Tags != nil { - objectMap["tags"] = vr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualRouter struct. -func (vr *VirtualRouter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualRouterPropertiesFormat VirtualRouterPropertiesFormat - err = json.Unmarshal(*v, &virtualRouterPropertiesFormat) - if err != nil { - return err - } - vr.VirtualRouterPropertiesFormat = &virtualRouterPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vr.Tags = tags - } - } - } - - return nil -} - -// VirtualRouterListResult response for ListVirtualRouters API service call. -type VirtualRouterListResult struct { - autorest.Response `json:"-"` - // Value - List of Virtual Routers. - Value *[]VirtualRouter `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualRouterListResultIterator provides access to a complete listing of VirtualRouter values. -type VirtualRouterListResultIterator struct { - i int - page VirtualRouterListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualRouterListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualRouterListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualRouterListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualRouterListResultIterator) Response() VirtualRouterListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualRouterListResultIterator) Value() VirtualRouter { - if !iter.page.NotDone() { - return VirtualRouter{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualRouterListResultIterator type. -func NewVirtualRouterListResultIterator(page VirtualRouterListResultPage) VirtualRouterListResultIterator { - return VirtualRouterListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vrlr VirtualRouterListResult) IsEmpty() bool { - return vrlr.Value == nil || len(*vrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vrlr VirtualRouterListResult) hasNextLink() bool { - return vrlr.NextLink != nil && len(*vrlr.NextLink) != 0 -} - -// virtualRouterListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vrlr VirtualRouterListResult) virtualRouterListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vrlr.NextLink))) -} - -// VirtualRouterListResultPage contains a page of VirtualRouter values. -type VirtualRouterListResultPage struct { - fn func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error) - vrlr VirtualRouterListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualRouterListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vrlr) - if err != nil { - return err - } - page.vrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualRouterListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualRouterListResultPage) NotDone() bool { - return !page.vrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualRouterListResultPage) Response() VirtualRouterListResult { - return page.vrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualRouterListResultPage) Values() []VirtualRouter { - if page.vrlr.IsEmpty() { - return nil - } - return *page.vrlr.Value -} - -// Creates a new instance of the VirtualRouterListResultPage type. -func NewVirtualRouterListResultPage(cur VirtualRouterListResult, getNextPage func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error)) VirtualRouterListResultPage { - return VirtualRouterListResultPage{ - fn: getNextPage, - vrlr: cur, - } -} - -// VirtualRouterPeering virtual Router Peering resource. -type VirtualRouterPeering struct { - autorest.Response `json:"-"` - // VirtualRouterPeeringProperties - The properties of the Virtual Router Peering. - *VirtualRouterPeeringProperties `json:"properties,omitempty"` - // Name - Name of the virtual router peering that is unique within a virtual router. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Peering type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPeering. -func (vrp VirtualRouterPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrp.VirtualRouterPeeringProperties != nil { - objectMap["properties"] = vrp.VirtualRouterPeeringProperties - } - if vrp.Name != nil { - objectMap["name"] = vrp.Name - } - if vrp.ID != nil { - objectMap["id"] = vrp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualRouterPeering struct. -func (vrp *VirtualRouterPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualRouterPeeringProperties VirtualRouterPeeringProperties - err = json.Unmarshal(*v, &virtualRouterPeeringProperties) - if err != nil { - return err - } - vrp.VirtualRouterPeeringProperties = &virtualRouterPeeringProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vrp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vrp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vrp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vrp.ID = &ID - } - } - } - - return nil -} - -// VirtualRouterPeeringListResult response for ListVirtualRouterPeerings API service call. -type VirtualRouterPeeringListResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualRouterPeerings in a VirtualRouter. - Value *[]VirtualRouterPeering `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualRouterPeeringListResultIterator provides access to a complete listing of VirtualRouterPeering -// values. -type VirtualRouterPeeringListResultIterator struct { - i int - page VirtualRouterPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualRouterPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualRouterPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualRouterPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualRouterPeeringListResultIterator) Response() VirtualRouterPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualRouterPeeringListResultIterator) Value() VirtualRouterPeering { - if !iter.page.NotDone() { - return VirtualRouterPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualRouterPeeringListResultIterator type. -func NewVirtualRouterPeeringListResultIterator(page VirtualRouterPeeringListResultPage) VirtualRouterPeeringListResultIterator { - return VirtualRouterPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vrplr VirtualRouterPeeringListResult) IsEmpty() bool { - return vrplr.Value == nil || len(*vrplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vrplr VirtualRouterPeeringListResult) hasNextLink() bool { - return vrplr.NextLink != nil && len(*vrplr.NextLink) != 0 -} - -// virtualRouterPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vrplr VirtualRouterPeeringListResult) virtualRouterPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vrplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vrplr.NextLink))) -} - -// VirtualRouterPeeringListResultPage contains a page of VirtualRouterPeering values. -type VirtualRouterPeeringListResultPage struct { - fn func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error) - vrplr VirtualRouterPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualRouterPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vrplr) - if err != nil { - return err - } - page.vrplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualRouterPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualRouterPeeringListResultPage) NotDone() bool { - return !page.vrplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualRouterPeeringListResultPage) Response() VirtualRouterPeeringListResult { - return page.vrplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualRouterPeeringListResultPage) Values() []VirtualRouterPeering { - if page.vrplr.IsEmpty() { - return nil - } - return *page.vrplr.Value -} - -// Creates a new instance of the VirtualRouterPeeringListResultPage type. -func NewVirtualRouterPeeringListResultPage(cur VirtualRouterPeeringListResult, getNextPage func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error)) VirtualRouterPeeringListResultPage { - return VirtualRouterPeeringListResultPage{ - fn: getNextPage, - vrplr: cur, - } -} - -// VirtualRouterPeeringProperties properties of the rule group. -type VirtualRouterPeeringProperties struct { - // PeerAsn - Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - // PeerIP - Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPeeringProperties. -func (vrpp VirtualRouterPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrpp.PeerAsn != nil { - objectMap["peerAsn"] = vrpp.PeerAsn - } - if vrpp.PeerIP != nil { - objectMap["peerIp"] = vrpp.PeerIP - } - return json.Marshal(objectMap) -} - -// VirtualRouterPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRouterPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRouterPeeringsClient) (VirtualRouterPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRouterPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRouterPeeringsCreateOrUpdateFuture.Result. -func (future *VirtualRouterPeeringsCreateOrUpdateFuture) result(client VirtualRouterPeeringsClient) (vrp VirtualRouterPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vrp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vrp.Response.Response, err = future.GetResult(sender); err == nil && vrp.Response.Response.StatusCode != http.StatusNoContent { - vrp, err = client.CreateOrUpdateResponder(vrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", vrp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualRouterPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRouterPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRouterPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRouterPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRouterPeeringsDeleteFuture.Result. -func (future *VirtualRouterPeeringsDeleteFuture) result(client VirtualRouterPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualRouterPropertiesFormat virtual Router definition. -type VirtualRouterPropertiesFormat struct { - // VirtualRouterAsn - VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - // VirtualRouterIps - VirtualRouter IPs. - VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"` - // HostedSubnet - The Subnet on which VirtualRouter is hosted. - HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` - // HostedGateway - The Gateway on which VirtualRouter is hosted. - HostedGateway *SubResource `json:"hostedGateway,omitempty"` - // Peerings - READ-ONLY; List of references to VirtualRouterPeerings. - Peerings *[]SubResource `json:"peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPropertiesFormat. -func (vrpf VirtualRouterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrpf.VirtualRouterAsn != nil { - objectMap["virtualRouterAsn"] = vrpf.VirtualRouterAsn - } - if vrpf.VirtualRouterIps != nil { - objectMap["virtualRouterIps"] = vrpf.VirtualRouterIps - } - if vrpf.HostedSubnet != nil { - objectMap["hostedSubnet"] = vrpf.HostedSubnet - } - if vrpf.HostedGateway != nil { - objectMap["hostedGateway"] = vrpf.HostedGateway - } - return json.Marshal(objectMap) -} - -// VirtualRoutersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRoutersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRoutersClient) (VirtualRouter, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRoutersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRoutersCreateOrUpdateFuture.Result. -func (future *VirtualRoutersCreateOrUpdateFuture) result(client VirtualRoutersClient) (vr VirtualRouter, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vr.Response.Response, err = future.GetResult(sender); err == nil && vr.Response.Response.StatusCode != http.StatusNoContent { - vr, err = client.CreateOrUpdateResponder(vr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", vr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualRoutersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualRoutersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRoutersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRoutersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRoutersDeleteFuture.Result. -func (future *VirtualRoutersDeleteFuture) result(client VirtualRoutersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualWAN virtualWAN Resource. -type VirtualWAN struct { - autorest.Response `json:"-"` - // VirtualWanProperties - Properties of the virtual WAN. - *VirtualWanProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualWAN. -func (vw VirtualWAN) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vw.VirtualWanProperties != nil { - objectMap["properties"] = vw.VirtualWanProperties - } - if vw.ID != nil { - objectMap["id"] = vw.ID - } - if vw.Location != nil { - objectMap["location"] = vw.Location - } - if vw.Tags != nil { - objectMap["tags"] = vw.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualWAN struct. -func (vw *VirtualWAN) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualWanProperties VirtualWanProperties - err = json.Unmarshal(*v, &virtualWanProperties) - if err != nil { - return err - } - vw.VirtualWanProperties = &virtualWanProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vw.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vw.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vw.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vw.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vw.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vw.Tags = tags - } - } - } - - return nil -} - -// VirtualWanProperties parameters for VirtualWAN. -type VirtualWanProperties struct { - // DisableVpnEncryption - Vpn encryption to be disabled or not. - DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` - // VirtualHubs - READ-ONLY; List of VirtualHubs in the VirtualWAN. - VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` - // VpnSites - READ-ONLY; List of VpnSites in the VirtualWAN. - VpnSites *[]SubResource `json:"vpnSites,omitempty"` - // AllowBranchToBranchTraffic - True if branch to branch traffic is allowed. - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - // AllowVnetToVnetTraffic - True if Vnet to Vnet traffic is allowed. - AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` - // Office365LocalBreakoutCategory - The office local breakout category. Possible values include: 'OfficeTrafficCategoryOptimize', 'OfficeTrafficCategoryOptimizeAndAllow', 'OfficeTrafficCategoryAll', 'OfficeTrafficCategoryNone' - Office365LocalBreakoutCategory OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual WAN resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Type - The type of the VirtualWAN. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualWanProperties. -func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vwp.DisableVpnEncryption != nil { - objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption - } - if vwp.AllowBranchToBranchTraffic != nil { - objectMap["allowBranchToBranchTraffic"] = vwp.AllowBranchToBranchTraffic - } - if vwp.AllowVnetToVnetTraffic != nil { - objectMap["allowVnetToVnetTraffic"] = vwp.AllowVnetToVnetTraffic - } - if vwp.Office365LocalBreakoutCategory != "" { - objectMap["office365LocalBreakoutCategory"] = vwp.Office365LocalBreakoutCategory - } - if vwp.Type != nil { - objectMap["type"] = vwp.Type - } - return json.Marshal(objectMap) -} - -// VirtualWansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualWansCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualWansClient) (VirtualWAN, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualWansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualWansCreateOrUpdateFuture.Result. -func (future *VirtualWansCreateOrUpdateFuture) result(client VirtualWansClient) (vw VirtualWAN, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vw.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualWansCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { - vw, err = client.CreateOrUpdateResponder(vw.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", vw.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualWansDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualWansDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualWansClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualWansDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualWansDeleteFuture.Result. -func (future *VirtualWansDeleteFuture) result(client VirtualWansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualWansDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualWanSecurityProvider collection of SecurityProviders. -type VirtualWanSecurityProvider struct { - // Name - Name of the security provider. - Name *string `json:"name,omitempty"` - // URL - Url of the security provider. - URL *string `json:"url,omitempty"` - // Type - Name of the security provider. Possible values include: 'External', 'Native' - Type VirtualWanSecurityProviderType `json:"type,omitempty"` -} - -// VirtualWanSecurityProviders collection of SecurityProviders. -type VirtualWanSecurityProviders struct { - autorest.Response `json:"-"` - // SupportedProviders - List of VirtualWAN security providers. - SupportedProviders *[]VirtualWanSecurityProvider `json:"supportedProviders,omitempty"` -} - -// VirtualWanVpnProfileParameters virtual Wan Vpn profile parameters Vpn profile generation. -type VirtualWanVpnProfileParameters struct { - // VpnServerConfigurationResourceID - VpnServerConfiguration partial resource uri with which VirtualWan is associated to. - VpnServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` -} - -// VM describes a Virtual Machine. -type VM struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VM. -func (vVar VM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.ID != nil { - objectMap["id"] = vVar.ID - } - if vVar.Location != nil { - objectMap["location"] = vVar.Location - } - if vVar.Tags != nil { - objectMap["tags"] = vVar.Tags - } - return json.Marshal(objectMap) -} - -// VnetRoute list of routes that control routing from VirtualHub into a virtual network connection. -type VnetRoute struct { - // StaticRoutes - List of all Static Routes. - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` -} - -// VpnClientConfiguration vpnClientConfiguration for P2S client. -type VpnClientConfiguration struct { - // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - // VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway. - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - // VpnClientProtocols - VpnClientProtocols for Virtual network gateway. - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - // VpnClientIpsecPolicies - VpnClientIpsecPolicies for virtual network gateway P2S client. - VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - // RadiusServerAddress - The radius server address property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerSecret - The radius secret property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - // RadiusServers - The radiusServers property for multiple radius server configuration. - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - // AadTenant - The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadTenant *string `json:"aadTenant,omitempty"` - // AadAudience - The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadAudience *string `json:"aadAudience,omitempty"` - // AadIssuer - The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadIssuer *string `json:"aadIssuer,omitempty"` -} - -// VpnClientConnectionHealth vpnClientConnectionHealth properties. -type VpnClientConnectionHealth struct { - // TotalIngressBytesTransferred - READ-ONLY; Total of the Ingress Bytes Transferred in this P2S Vpn connection. - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - // TotalEgressBytesTransferred - READ-ONLY; Total of the Egress Bytes Transferred in this connection. - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - // VpnClientConnectionsCount - The total of p2s vpn clients connected at this time to this P2SVpnGateway. - VpnClientConnectionsCount *int32 `json:"vpnClientConnectionsCount,omitempty"` - // AllocatedIPAddresses - List of allocated ip addresses to the connected p2s vpn clients. - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientConnectionHealth. -func (vcch VpnClientConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcch.VpnClientConnectionsCount != nil { - objectMap["vpnClientConnectionsCount"] = vcch.VpnClientConnectionsCount - } - if vcch.AllocatedIPAddresses != nil { - objectMap["allocatedIpAddresses"] = vcch.AllocatedIPAddresses - } - return json.Marshal(objectMap) -} - -// VpnClientConnectionHealthDetail VPN client connection health detail. -type VpnClientConnectionHealthDetail struct { - // VpnConnectionID - READ-ONLY; The vpn client Id. - VpnConnectionID *string `json:"vpnConnectionId,omitempty"` - // VpnConnectionDuration - READ-ONLY; The duration time of a connected vpn client. - VpnConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty"` - // VpnConnectionTime - READ-ONLY; The start time of a connected vpn client. - VpnConnectionTime *string `json:"vpnConnectionTime,omitempty"` - // PublicIPAddress - READ-ONLY; The public Ip of a connected vpn client. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; The assigned private Ip of a connected vpn client. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - // VpnUserName - READ-ONLY; The user name of a connected vpn client. - VpnUserName *string `json:"vpnUserName,omitempty"` - // MaxBandwidth - READ-ONLY; The max band width. - MaxBandwidth *int64 `json:"maxBandwidth,omitempty"` - // EgressPacketsTransferred - READ-ONLY; The egress packets per second. - EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes per second. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressPacketsTransferred - READ-ONLY; The ingress packets per second. - IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes per second. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // MaxPacketsPerSecond - READ-ONLY; The max packets transferred per second. - MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"` -} - -// VpnClientConnectionHealthDetailListResult list of virtual network gateway vpn client connection health. -type VpnClientConnectionHealthDetailListResult struct { - autorest.Response `json:"-"` - // Value - List of vpn client connection health. - Value *[]VpnClientConnectionHealthDetail `json:"value,omitempty"` -} - -// VpnClientIPsecParameters an IPSec parameters for a virtual network gateway P2S connection. -type VpnClientIPsecParameters struct { - autorest.Response `json:"-"` - // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` - // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' - IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` - // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' - IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` - // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' - IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` - // DhGroup - The DH Group used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - DhGroup DhGroup `json:"dhGroup,omitempty"` - // PfsGroup - The Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' - PfsGroup PfsGroup `json:"pfsGroup,omitempty"` -} - -// VpnClientParameters vpn Client Parameters for package generation. -type VpnClientParameters struct { - // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'Amd64', 'X86' - ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` - // RadiusServerAuthCertificate - The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. - RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` - // ClientRootCertificates - A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. - ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` -} - -// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. -type VpnClientRevokedCertificate struct { - // VpnClientRevokedCertificatePropertiesFormat - Properties of the vpn client revoked certificate. - *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. -func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { - objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat - } - if vcrc.Name != nil { - objectMap["name"] = vcrc.Name - } - if vcrc.ID != nil { - objectMap["id"] = vcrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. -func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat - err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) - if err != nil { - return err - } - vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vcrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vcrc.ID = &ID - } - } - } - - return nil -} - -// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual -// network gateway. -type VpnClientRevokedCertificatePropertiesFormat struct { - // Thumbprint - The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. -func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrcpf.Thumbprint != nil { - objectMap["thumbprint"] = vcrcpf.Thumbprint - } - return json.Marshal(objectMap) -} - -// VpnClientRootCertificate VPN client root certificate of virtual network gateway. -type VpnClientRootCertificate struct { - // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. - *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRootCertificate. -func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrc.VpnClientRootCertificatePropertiesFormat != nil { - objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat - } - if vcrc.Name != nil { - objectMap["name"] = vcrc.Name - } - if vcrc.ID != nil { - objectMap["id"] = vcrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. -func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat - err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) - if err != nil { - return err - } - vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vcrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vcrc.ID = &ID - } - } - } - - return nil -} - -// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway. -type VpnClientRootCertificatePropertiesFormat struct { - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. -func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrcpf.PublicCertData != nil { - objectMap["publicCertData"] = vcrcpf.PublicCertData - } - return json.Marshal(objectMap) -} - -// VpnConnection vpnConnection Resource. -type VpnConnection struct { - autorest.Response `json:"-"` - // VpnConnectionProperties - Properties of the VPN connection. - *VpnConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnConnection. -func (vc VpnConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vc.VpnConnectionProperties != nil { - objectMap["properties"] = vc.VpnConnectionProperties - } - if vc.Name != nil { - objectMap["name"] = vc.Name - } - if vc.ID != nil { - objectMap["id"] = vc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnConnection struct. -func (vc *VpnConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnConnectionProperties VpnConnectionProperties - err = json.Unmarshal(*v, &vpnConnectionProperties) - if err != nil { - return err - } - vc.VpnConnectionProperties = &vpnConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vc.ID = &ID - } - } - } - - return nil -} - -// VpnConnectionProperties parameters for VpnConnection. -type VpnConnectionProperties struct { - // RemoteVpnSite - Id of the connected vpn site. - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - // RoutingWeight - Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // DpdTimeoutSeconds - The dead peer detection timeout for a vpn connection in seconds. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' - ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // ConnectionBandwidth - Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - // SharedKey - SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // EnableRateLimiting - EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // UseLocalAzureIPAddress - Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnLinkConnections - List of all vpn site link connections to the gateway. - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnConnectionProperties. -func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcp.RemoteVpnSite != nil { - objectMap["remoteVpnSite"] = vcp.RemoteVpnSite - } - if vcp.RoutingWeight != nil { - objectMap["routingWeight"] = vcp.RoutingWeight - } - if vcp.DpdTimeoutSeconds != nil { - objectMap["dpdTimeoutSeconds"] = vcp.DpdTimeoutSeconds - } - if vcp.ConnectionStatus != "" { - objectMap["connectionStatus"] = vcp.ConnectionStatus - } - if vcp.VpnConnectionProtocolType != "" { - objectMap["vpnConnectionProtocolType"] = vcp.VpnConnectionProtocolType - } - if vcp.ConnectionBandwidth != nil { - objectMap["connectionBandwidth"] = vcp.ConnectionBandwidth - } - if vcp.SharedKey != nil { - objectMap["sharedKey"] = vcp.SharedKey - } - if vcp.EnableBgp != nil { - objectMap["enableBgp"] = vcp.EnableBgp - } - if vcp.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vcp.UsePolicyBasedTrafficSelectors - } - if vcp.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vcp.IpsecPolicies - } - if vcp.EnableRateLimiting != nil { - objectMap["enableRateLimiting"] = vcp.EnableRateLimiting - } - if vcp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = vcp.EnableInternetSecurity - } - if vcp.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vcp.UseLocalAzureIPAddress - } - if vcp.VpnLinkConnections != nil { - objectMap["vpnLinkConnections"] = vcp.VpnLinkConnections - } - if vcp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = vcp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (VpnConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsCreateOrUpdateFuture.Result. -func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsClient) (vc VpnConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { - vc, err = client.CreateOrUpdateResponder(vc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsDeleteFuture.Result. -func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnDeviceScriptParameters vpn device configuration script generation parameters. -type VpnDeviceScriptParameters struct { - // Vendor - The vendor for the vpn device. - Vendor *string `json:"vendor,omitempty"` - // DeviceFamily - The device family for the vpn device. - DeviceFamily *string `json:"deviceFamily,omitempty"` - // FirmwareVersion - The firmware version for the vpn device. - FirmwareVersion *string `json:"firmwareVersion,omitempty"` -} - -// VpnGateway vpnGateway Resource. -type VpnGateway struct { - autorest.Response `json:"-"` - // VpnGatewayProperties - Properties of the VPN gateway. - *VpnGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnGateway. -func (vg VpnGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vg.VpnGatewayProperties != nil { - objectMap["properties"] = vg.VpnGatewayProperties - } - if vg.ID != nil { - objectMap["id"] = vg.ID - } - if vg.Location != nil { - objectMap["location"] = vg.Location - } - if vg.Tags != nil { - objectMap["tags"] = vg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnGateway struct. -func (vg *VpnGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnGatewayProperties VpnGatewayProperties - err = json.Unmarshal(*v, &vpnGatewayProperties) - if err != nil { - return err - } - vg.VpnGatewayProperties = &vpnGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vg.Tags = tags - } - } - } - - return nil -} - -// VpnGatewayProperties parameters for VpnGateway. -type VpnGatewayProperties struct { - // VirtualHub - The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // Connections - List of all vpn connections to the gateway. - Connections *[]VpnConnection `json:"connections,omitempty"` - // BgpSettings - Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnGatewayScaleUnit - The scale unit for this vpn gateway. - VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnGatewayProperties. -func (vgp VpnGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vgp.VirtualHub != nil { - objectMap["virtualHub"] = vgp.VirtualHub - } - if vgp.Connections != nil { - objectMap["connections"] = vgp.Connections - } - if vgp.BgpSettings != nil { - objectMap["bgpSettings"] = vgp.BgpSettings - } - if vgp.VpnGatewayScaleUnit != nil { - objectMap["vpnGatewayScaleUnit"] = vgp.VpnGatewayScaleUnit - } - return json.Marshal(objectMap) -} - -// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (VpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysCreateOrUpdateFuture.Result. -func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { - vg, err = client.CreateOrUpdateResponder(vg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", vg.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysDeleteFuture.Result. -func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnGatewaysResetFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (VpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysResetFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysResetFuture.Result. -func (future *VpnGatewaysResetFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysResetFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { - vg, err = client.ResetResponder(vg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", vg.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnLinkBgpSettings BGP settings details for a link. -type VpnLinkBgpSettings struct { - // Asn - The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} - -// VpnLinkProviderProperties list of properties of a link provider. -type VpnLinkProviderProperties struct { - // LinkProviderName - Name of the link provider. - LinkProviderName *string `json:"linkProviderName,omitempty"` - // LinkSpeedInMbps - Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// VpnPacketCaptureStartParameters start packet capture parameters on virtual network gateway. -type VpnPacketCaptureStartParameters struct { - // FilterData - Start Packet capture parameters. - FilterData *string `json:"filterData,omitempty"` -} - -// VpnPacketCaptureStopParameters stop packet capture parameters. -type VpnPacketCaptureStopParameters struct { - // SasURL - SAS url for packet capture on virtual network gateway. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VpnProfileResponse vpn Profile Response for package generation. -type VpnProfileResponse struct { - autorest.Response `json:"-"` - // ProfileURL - URL to the VPN profile. - ProfileURL *string `json:"profileUrl,omitempty"` -} - -// VpnServerConfigRadiusClientRootCertificate properties of the Radius client root certificate of -// VpnServerConfiguration. -type VpnServerConfigRadiusClientRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // Thumbprint - The Radius client root certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VpnServerConfigRadiusServerRootCertificate properties of Radius Server root certificate of -// VpnServerConfiguration. -type VpnServerConfigRadiusServerRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VpnServerConfiguration vpnServerConfiguration Resource. -type VpnServerConfiguration struct { - autorest.Response `json:"-"` - // VpnServerConfigurationProperties - Properties of the P2SVpnServer configuration. - *VpnServerConfigurationProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfiguration. -func (vsc VpnServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsc.VpnServerConfigurationProperties != nil { - objectMap["properties"] = vsc.VpnServerConfigurationProperties - } - if vsc.ID != nil { - objectMap["id"] = vsc.ID - } - if vsc.Location != nil { - objectMap["location"] = vsc.Location - } - if vsc.Tags != nil { - objectMap["tags"] = vsc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnServerConfiguration struct. -func (vsc *VpnServerConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnServerConfigurationProperties VpnServerConfigurationProperties - err = json.Unmarshal(*v, &vpnServerConfigurationProperties) - if err != nil { - return err - } - vsc.VpnServerConfigurationProperties = &vpnServerConfigurationProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vsc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vsc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vsc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vsc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vsc.Tags = tags - } - } - } - - return nil -} - -// VpnServerConfigurationProperties parameters for VpnServerConfiguration. -type VpnServerConfigurationProperties struct { - // Name - The name of the VpnServerConfiguration that is unique within a resource group. - Name *string `json:"name,omitempty"` - // VpnProtocols - VPN protocols for the VpnServerConfiguration. - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` - // VpnAuthenticationTypes - VPN authentication types for the VpnServerConfiguration. - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - // VpnClientRootCertificates - VPN client root certificate of VpnServerConfiguration. - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - // VpnClientRevokedCertificates - VPN client revoked certificate of VpnServerConfiguration. - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - // RadiusServerRootCertificates - Radius Server root certificate of VpnServerConfiguration. - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - // RadiusClientRootCertificates - Radius client root certificate of VpnServerConfiguration. - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - // VpnClientIpsecPolicies - VpnClientIpsecPolicies for VpnServerConfiguration. - VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - // RadiusServerAddress - The radius server address property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerSecret - The radius secret property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - // RadiusServers - Multiple Radius Server configuration for VpnServerConfiguration. - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - // AadAuthenticationParameters - The set of aad vpn authentication parameters. - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty"` - // P2SVpnGateways - READ-ONLY; List of references to P2SVpnGateways. - P2SVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfigurationProperties. -func (vscp VpnServerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vscp.Name != nil { - objectMap["name"] = vscp.Name - } - if vscp.VpnProtocols != nil { - objectMap["vpnProtocols"] = vscp.VpnProtocols - } - if vscp.VpnAuthenticationTypes != nil { - objectMap["vpnAuthenticationTypes"] = vscp.VpnAuthenticationTypes - } - if vscp.VpnClientRootCertificates != nil { - objectMap["vpnClientRootCertificates"] = vscp.VpnClientRootCertificates - } - if vscp.VpnClientRevokedCertificates != nil { - objectMap["vpnClientRevokedCertificates"] = vscp.VpnClientRevokedCertificates - } - if vscp.RadiusServerRootCertificates != nil { - objectMap["radiusServerRootCertificates"] = vscp.RadiusServerRootCertificates - } - if vscp.RadiusClientRootCertificates != nil { - objectMap["radiusClientRootCertificates"] = vscp.RadiusClientRootCertificates - } - if vscp.VpnClientIpsecPolicies != nil { - objectMap["vpnClientIpsecPolicies"] = vscp.VpnClientIpsecPolicies - } - if vscp.RadiusServerAddress != nil { - objectMap["radiusServerAddress"] = vscp.RadiusServerAddress - } - if vscp.RadiusServerSecret != nil { - objectMap["radiusServerSecret"] = vscp.RadiusServerSecret - } - if vscp.RadiusServers != nil { - objectMap["radiusServers"] = vscp.RadiusServers - } - if vscp.AadAuthenticationParameters != nil { - objectMap["aadAuthenticationParameters"] = vscp.AadAuthenticationParameters - } - return json.Marshal(objectMap) -} - -// VpnServerConfigurationsAssociatedWithVirtualWanListFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VpnServerConfigurationsAssociatedWithVirtualWanListFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsAssociatedWithVirtualWanClient) (VpnServerConfigurationsResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsAssociatedWithVirtualWanListFuture.Result. -func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) result(client VpnServerConfigurationsAssociatedWithVirtualWanClient) (vscr VpnServerConfigurationsResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vscr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vscr.Response.Response, err = future.GetResult(sender); err == nil && vscr.Response.Response.StatusCode != http.StatusNoContent { - vscr, err = client.ListResponder(vscr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", vscr.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnServerConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VpnServerConfigurationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsClient) (VpnServerConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsCreateOrUpdateFuture.Result. -func (future *VpnServerConfigurationsCreateOrUpdateFuture) result(client VpnServerConfigurationsClient) (vsc VpnServerConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vsc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vsc.Response.Response, err = future.GetResult(sender); err == nil && vsc.Response.Response.StatusCode != http.StatusNoContent { - vsc, err = client.CreateOrUpdateResponder(vsc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", vsc.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnServerConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnServerConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsDeleteFuture.Result. -func (future *VpnServerConfigurationsDeleteFuture) result(client VpnServerConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnServerConfigurationsResponse vpnServerConfigurations list associated with VirtualWan Response. -type VpnServerConfigurationsResponse struct { - autorest.Response `json:"-"` - // VpnServerConfigurationResourceIds - List of VpnServerConfigurations associated with VirtualWan. - VpnServerConfigurationResourceIds *[]string `json:"vpnServerConfigurationResourceIds,omitempty"` -} - -// VpnServerConfigVpnClientRevokedCertificate properties of the revoked VPN client certificate of -// VpnServerConfiguration. -type VpnServerConfigVpnClientRevokedCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // Thumbprint - The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VpnServerConfigVpnClientRootCertificate properties of VPN client root certificate of -// VpnServerConfiguration. -type VpnServerConfigVpnClientRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VpnSite vpnSite Resource. -type VpnSite struct { - autorest.Response `json:"-"` - // VpnSiteProperties - Properties of the VPN site. - *VpnSiteProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnSite. -func (vs VpnSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vs.VpnSiteProperties != nil { - objectMap["properties"] = vs.VpnSiteProperties - } - if vs.ID != nil { - objectMap["id"] = vs.ID - } - if vs.Location != nil { - objectMap["location"] = vs.Location - } - if vs.Tags != nil { - objectMap["tags"] = vs.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSite struct. -func (vs *VpnSite) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteProperties VpnSiteProperties - err = json.Unmarshal(*v, &vpnSiteProperties) - if err != nil { - return err - } - vs.VpnSiteProperties = &vpnSiteProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vs.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vs.Tags = tags - } - } - } - - return nil -} - -// VpnSiteID vpnSite Resource. -type VpnSiteID struct { - // VpnSite - READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. - VpnSite *string `json:"vpnSite,omitempty"` -} - -// VpnSiteLink vpnSiteLink Resource. -type VpnSiteLink struct { - autorest.Response `json:"-"` - // VpnSiteLinkProperties - Properties of the VPN site link. - *VpnSiteLinkProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLink. -func (vsl VpnSiteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsl.VpnSiteLinkProperties != nil { - objectMap["properties"] = vsl.VpnSiteLinkProperties - } - if vsl.Name != nil { - objectMap["name"] = vsl.Name - } - if vsl.ID != nil { - objectMap["id"] = vsl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSiteLink struct. -func (vsl *VpnSiteLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteLinkProperties VpnSiteLinkProperties - err = json.Unmarshal(*v, &vpnSiteLinkProperties) - if err != nil { - return err - } - vsl.VpnSiteLinkProperties = &vpnSiteLinkProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vsl.Etag = &etag - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vsl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vsl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vsl.ID = &ID - } - } - } - - return nil -} - -// VpnSiteLinkConnection vpnSiteLinkConnection Resource. -type VpnSiteLinkConnection struct { - autorest.Response `json:"-"` - // VpnSiteLinkConnectionProperties - Properties of the VPN site link connection. - *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkConnection. -func (vslc VpnSiteLinkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslc.VpnSiteLinkConnectionProperties != nil { - objectMap["properties"] = vslc.VpnSiteLinkConnectionProperties - } - if vslc.Name != nil { - objectMap["name"] = vslc.Name - } - if vslc.ID != nil { - objectMap["id"] = vslc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSiteLinkConnection struct. -func (vslc *VpnSiteLinkConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteLinkConnectionProperties VpnSiteLinkConnectionProperties - err = json.Unmarshal(*v, &vpnSiteLinkConnectionProperties) - if err != nil { - return err - } - vslc.VpnSiteLinkConnectionProperties = &vpnSiteLinkConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vslc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vslc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vslc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vslc.ID = &ID - } - } - } - - return nil -} - -// VpnSiteLinkConnectionProperties parameters for VpnConnection. -type VpnSiteLinkConnectionProperties struct { - // VpnSiteLink - Id of the connected vpn site link. - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` - // RoutingWeight - Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' - ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // ConnectionBandwidth - Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - // SharedKey - SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // EnableRateLimiting - EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - // UseLocalAzureIPAddress - Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkConnectionProperties. -func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslcp.VpnSiteLink != nil { - objectMap["vpnSiteLink"] = vslcp.VpnSiteLink - } - if vslcp.RoutingWeight != nil { - objectMap["routingWeight"] = vslcp.RoutingWeight - } - if vslcp.ConnectionStatus != "" { - objectMap["connectionStatus"] = vslcp.ConnectionStatus - } - if vslcp.VpnConnectionProtocolType != "" { - objectMap["vpnConnectionProtocolType"] = vslcp.VpnConnectionProtocolType - } - if vslcp.ConnectionBandwidth != nil { - objectMap["connectionBandwidth"] = vslcp.ConnectionBandwidth - } - if vslcp.SharedKey != nil { - objectMap["sharedKey"] = vslcp.SharedKey - } - if vslcp.EnableBgp != nil { - objectMap["enableBgp"] = vslcp.EnableBgp - } - if vslcp.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vslcp.UsePolicyBasedTrafficSelectors - } - if vslcp.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vslcp.IpsecPolicies - } - if vslcp.EnableRateLimiting != nil { - objectMap["enableRateLimiting"] = vslcp.EnableRateLimiting - } - if vslcp.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vslcp.UseLocalAzureIPAddress - } - return json.Marshal(objectMap) -} - -// VpnSiteLinkProperties parameters for VpnSite. -type VpnSiteLinkProperties struct { - // LinkProperties - The link provider properties. - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - // IPAddress - The ip-address for the vpn-site-link. - IPAddress *string `json:"ipAddress,omitempty"` - // Fqdn - FQDN of vpn-site-link. - Fqdn *string `json:"fqdn,omitempty"` - // BgpProperties - The set of bgp properties. - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkProperties. -func (vslp VpnSiteLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslp.LinkProperties != nil { - objectMap["linkProperties"] = vslp.LinkProperties - } - if vslp.IPAddress != nil { - objectMap["ipAddress"] = vslp.IPAddress - } - if vslp.Fqdn != nil { - objectMap["fqdn"] = vslp.Fqdn - } - if vslp.BgpProperties != nil { - objectMap["bgpProperties"] = vslp.BgpProperties - } - return json.Marshal(objectMap) -} - -// VpnSiteProperties parameters for VpnSite. -type VpnSiteProperties struct { - // VirtualWan - The VirtualWAN to which the vpnSite belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - // DeviceProperties - The device properties. - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - // IPAddress - The ip-address for the vpn-site. - IPAddress *string `json:"ipAddress,omitempty"` - // SiteKey - The key for vpn-site that can be used for connections. - SiteKey *string `json:"siteKey,omitempty"` - // AddressSpace - The AddressSpace that contains an array of IP address ranges. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - // BgpProperties - The set of bgp properties. - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // IsSecuritySite - IsSecuritySite flag. - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - // VpnSiteLinks - List of all vpn site links. - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteProperties. -func (vsp VpnSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsp.VirtualWan != nil { - objectMap["virtualWan"] = vsp.VirtualWan - } - if vsp.DeviceProperties != nil { - objectMap["deviceProperties"] = vsp.DeviceProperties - } - if vsp.IPAddress != nil { - objectMap["ipAddress"] = vsp.IPAddress - } - if vsp.SiteKey != nil { - objectMap["siteKey"] = vsp.SiteKey - } - if vsp.AddressSpace != nil { - objectMap["addressSpace"] = vsp.AddressSpace - } - if vsp.BgpProperties != nil { - objectMap["bgpProperties"] = vsp.BgpProperties - } - if vsp.IsSecuritySite != nil { - objectMap["isSecuritySite"] = vsp.IsSecuritySite - } - if vsp.VpnSiteLinks != nil { - objectMap["vpnSiteLinks"] = vsp.VpnSiteLinks - } - return json.Marshal(objectMap) -} - -// VpnSitesConfigurationDownloadFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnSitesConfigurationDownloadFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesConfigurationClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesConfigurationDownloadFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesConfigurationDownloadFuture.Result. -func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationDownloadFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnSitesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesClient) (VpnSite, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesCreateOrUpdateFuture.Result. -func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs VpnSite, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { - vs, err = client.CreateOrUpdateResponder(vs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", vs.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnSitesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesDeleteFuture.Result. -func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// Watcher network watcher in a resource group. -type Watcher struct { - autorest.Response `json:"-"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // WatcherPropertiesFormat - Properties of the network watcher. - *WatcherPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Watcher. -func (w Watcher) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.WatcherPropertiesFormat != nil { - objectMap["properties"] = w.WatcherPropertiesFormat - } - if w.ID != nil { - objectMap["id"] = w.ID - } - if w.Location != nil { - objectMap["location"] = w.Location - } - if w.Tags != nil { - objectMap["tags"] = w.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Watcher struct. -func (w *Watcher) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - w.Etag = &etag - } - case "properties": - if v != nil { - var watcherPropertiesFormat WatcherPropertiesFormat - err = json.Unmarshal(*v, &watcherPropertiesFormat) - if err != nil { - return err - } - w.WatcherPropertiesFormat = &watcherPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - w.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - w.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - w.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - w.Tags = tags - } - } - } - - return nil -} - -// WatcherListResult response for ListNetworkWatchers API service call. -type WatcherListResult struct { - autorest.Response `json:"-"` - // Value - List of network watcher resources. - Value *[]Watcher `json:"value,omitempty"` -} - -// WatcherPropertiesFormat the network watcher properties. -type WatcherPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the network watcher resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersCheckConnectivityFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (ConnectivityInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersCheckConnectivityFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersCheckConnectivityFuture.Result. -func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci ConnectivityInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ci.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent { - ci, err = client.CheckConnectivityResponder(ci.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", ci.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersDeleteFuture.Result. -func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetAzureReachabilityReportFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (AzureReachabilityReport, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetAzureReachabilityReportFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetAzureReachabilityReportFuture.Result. -func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersClient) (arr AzureReachabilityReport, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - arr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if arr.Response.Response, err = future.GetResult(sender); err == nil && arr.Response.Response.StatusCode != http.StatusNoContent { - arr, err = client.GetAzureReachabilityReportResponder(arr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", arr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetFlowLogStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (FlowLogInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetFlowLogStatusFuture.Result. -func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fli.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { - fli, err = client.GetFlowLogStatusResponder(fli.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetNetworkConfigurationDiagnosticFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type WatchersGetNetworkConfigurationDiagnosticFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (ConfigurationDiagnosticResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetNetworkConfigurationDiagnosticFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetNetworkConfigurationDiagnosticFuture.Result. -func (future *WatchersGetNetworkConfigurationDiagnosticFuture) result(client WatchersClient) (cdr ConfigurationDiagnosticResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cdr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetNetworkConfigurationDiagnosticFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cdr.Response.Response, err = future.GetResult(sender); err == nil && cdr.Response.Response.StatusCode != http.StatusNoContent { - cdr, err = client.GetNetworkConfigurationDiagnosticResponder(cdr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", cdr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersGetNextHopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (NextHopResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetNextHopFuture.Result. -func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - nhr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent { - nhr, err = client.GetNextHopResponder(nhr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetTroubleshootingFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (TroubleshootingResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetTroubleshootingFuture.Result. -func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - tr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { - tr, err = client.GetTroubleshootingResponder(tr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetTroubleshootingResultFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (TroubleshootingResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result. -func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - tr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { - tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetVMSecurityRulesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (SecurityGroupViewResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result. -func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sgvr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent { - sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersListAvailableProvidersFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersListAvailableProvidersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (AvailableProvidersList, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersListAvailableProvidersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersListAvailableProvidersFuture.Result. -func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient) (apl AvailableProvidersList, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - apl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if apl.Response.Response, err = future.GetResult(sender); err == nil && apl.Response.Response.StatusCode != http.StatusNoContent { - apl, err = client.ListAvailableProvidersResponder(apl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", apl.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersSetFlowLogConfigurationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (FlowLogInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result. -func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fli.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { - fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersVerifyIPFlowFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (VerificationIPFlowResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersVerifyIPFlowFuture.Result. -func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vifr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent { - vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request") - } - } - return -} - -// WebApplicationFirewallCustomRule defines contents of a web application rule. -type WebApplicationFirewallCustomRule struct { - // Name - The name of the resource that is unique within a policy. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Priority - Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. - Priority *int32 `json:"priority,omitempty"` - // RuleType - The rule type. Possible values include: 'WebApplicationFirewallRuleTypeMatchRule', 'WebApplicationFirewallRuleTypeInvalid' - RuleType WebApplicationFirewallRuleType `json:"ruleType,omitempty"` - // MatchConditions - List of match conditions. - MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` - // Action - Type of Actions. Possible values include: 'WebApplicationFirewallActionAllow', 'WebApplicationFirewallActionBlock', 'WebApplicationFirewallActionLog' - Action WebApplicationFirewallAction `json:"action,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallCustomRule. -func (wafcr WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafcr.Name != nil { - objectMap["name"] = wafcr.Name - } - if wafcr.Priority != nil { - objectMap["priority"] = wafcr.Priority - } - if wafcr.RuleType != "" { - objectMap["ruleType"] = wafcr.RuleType - } - if wafcr.MatchConditions != nil { - objectMap["matchConditions"] = wafcr.MatchConditions - } - if wafcr.Action != "" { - objectMap["action"] = wafcr.Action - } - return json.Marshal(objectMap) -} - -// WebApplicationFirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WebApplicationFirewallPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WebApplicationFirewallPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WebApplicationFirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WebApplicationFirewallPoliciesDeleteFuture.Result. -func (future *WebApplicationFirewallPoliciesDeleteFuture) result(client WebApplicationFirewallPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WebApplicationFirewallPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WebApplicationFirewallPolicy defines web application firewall policy. -type WebApplicationFirewallPolicy struct { - autorest.Response `json:"-"` - // WebApplicationFirewallPolicyPropertiesFormat - Properties of the web application firewall policy. - *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. -func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafp.WebApplicationFirewallPolicyPropertiesFormat != nil { - objectMap["properties"] = wafp.WebApplicationFirewallPolicyPropertiesFormat - } - if wafp.ID != nil { - objectMap["id"] = wafp.ID - } - if wafp.Location != nil { - objectMap["location"] = wafp.Location - } - if wafp.Tags != nil { - objectMap["tags"] = wafp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. -func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var webApplicationFirewallPolicyPropertiesFormat WebApplicationFirewallPolicyPropertiesFormat - err = json.Unmarshal(*v, &webApplicationFirewallPolicyPropertiesFormat) - if err != nil { - return err - } - wafp.WebApplicationFirewallPolicyPropertiesFormat = &webApplicationFirewallPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - wafp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wafp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wafp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wafp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wafp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - wafp.Tags = tags - } - } - } - - return nil -} - -// WebApplicationFirewallPolicyListResult result of the request to list WebApplicationFirewallPolicies. It -// contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. -type WebApplicationFirewallPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. - Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of WebApplicationFirewallPolicy objects if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// WebApplicationFirewallPolicyListResultIterator provides access to a complete listing of -// WebApplicationFirewallPolicy values. -type WebApplicationFirewallPolicyListResultIterator struct { - i int - page WebApplicationFirewallPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WebApplicationFirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WebApplicationFirewallPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WebApplicationFirewallPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WebApplicationFirewallPolicyListResultIterator) Response() WebApplicationFirewallPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WebApplicationFirewallPolicyListResultIterator) Value() WebApplicationFirewallPolicy { - if !iter.page.NotDone() { - return WebApplicationFirewallPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WebApplicationFirewallPolicyListResultIterator type. -func NewWebApplicationFirewallPolicyListResultIterator(page WebApplicationFirewallPolicyListResultPage) WebApplicationFirewallPolicyListResultIterator { - return WebApplicationFirewallPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wafplr WebApplicationFirewallPolicyListResult) IsEmpty() bool { - return wafplr.Value == nil || len(*wafplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wafplr WebApplicationFirewallPolicyListResult) hasNextLink() bool { - return wafplr.NextLink != nil && len(*wafplr.NextLink) != 0 -} - -// webApplicationFirewallPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wafplr WebApplicationFirewallPolicyListResult) webApplicationFirewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !wafplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wafplr.NextLink))) -} - -// WebApplicationFirewallPolicyListResultPage contains a page of WebApplicationFirewallPolicy values. -type WebApplicationFirewallPolicyListResultPage struct { - fn func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error) - wafplr WebApplicationFirewallPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WebApplicationFirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wafplr) - if err != nil { - return err - } - page.wafplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WebApplicationFirewallPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WebApplicationFirewallPolicyListResultPage) NotDone() bool { - return !page.wafplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WebApplicationFirewallPolicyListResultPage) Response() WebApplicationFirewallPolicyListResult { - return page.wafplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WebApplicationFirewallPolicyListResultPage) Values() []WebApplicationFirewallPolicy { - if page.wafplr.IsEmpty() { - return nil - } - return *page.wafplr.Value -} - -// Creates a new instance of the WebApplicationFirewallPolicyListResultPage type. -func NewWebApplicationFirewallPolicyListResultPage(cur WebApplicationFirewallPolicyListResult, getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage { - return WebApplicationFirewallPolicyListResultPage{ - fn: getNextPage, - wafplr: cur, - } -} - -// WebApplicationFirewallPolicyPropertiesFormat defines web application firewall policy properties. -type WebApplicationFirewallPolicyPropertiesFormat struct { - // PolicySettings - The PolicySettings for policy. - PolicySettings *PolicySettings `json:"policySettings,omitempty"` - // CustomRules - The custom rules inside the policy. - CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"` - // ApplicationGateways - READ-ONLY; A collection of references to application gateways. - ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ResourceState - READ-ONLY; Resource status of the policy. Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' - ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` - // ManagedRules - Describes the managedRules structure. - ManagedRules *ManagedRulesDefinition `json:"managedRules,omitempty"` - // HTTPListeners - READ-ONLY; A collection of references to application gateway http listeners. - HTTPListeners *[]SubResource `json:"httpListeners,omitempty"` - // PathBasedRules - READ-ONLY; A collection of references to application gateway path rules. - PathBasedRules *[]SubResource `json:"pathBasedRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPropertiesFormat. -func (wafppf WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafppf.PolicySettings != nil { - objectMap["policySettings"] = wafppf.PolicySettings - } - if wafppf.CustomRules != nil { - objectMap["customRules"] = wafppf.CustomRules - } - if wafppf.ManagedRules != nil { - objectMap["managedRules"] = wafppf.ManagedRules - } - return json.Marshal(objectMap) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/natgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/natgateways.go deleted file mode 100644 index 312e402a0c9c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/natgateways.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// NatGatewaysClient is the network Client -type NatGatewaysClient struct { - BaseClient -} - -// NewNatGatewaysClient creates an instance of the NatGatewaysClient client. -func NewNatGatewaysClient(subscriptionID string) NatGatewaysClient { - return NewNatGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNatGatewaysClientWithBaseURI creates an instance of the NatGatewaysClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewNatGatewaysClientWithBaseURI(baseURI string, subscriptionID string) NatGatewaysClient { - return NatGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a nat gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// parameters - parameters supplied to the create or update nat gateway operation. -func (client NatGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway) (result NatGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, natGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client NatGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) CreateOrUpdateSender(req *http.Request) (future NatGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified nat gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -func (client NatGatewaysClient) Delete(ctx context.Context, resourceGroupName string, natGatewayName string) (result NatGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, natGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client NatGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, natGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) DeleteSender(req *http.Request) (future NatGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified nat gateway in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// expand - expands referenced resources. -func (client NatGatewaysClient) Get(ctx context.Context, resourceGroupName string, natGatewayName string, expand string) (result NatGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, natGatewayName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NatGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, natGatewayName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) GetResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all nat gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client NatGatewaysClient) List(ctx context.Context, resourceGroupName string) (result NatGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.List") - defer func() { - sc := -1 - if result.nglr.Response.Response != nil { - sc = result.nglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.nglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.nglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.nglr.hasNextLink() && result.nglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client NatGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) ListResponder(resp *http.Response) (result NatGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client NatGatewaysClient) listNextResults(ctx context.Context, lastResults NatGatewayListResult) (result NatGatewayListResult, err error) { - req, err := lastResults.natGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client NatGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result NatGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Nat Gateways in a subscription. -func (client NatGatewaysClient) ListAll(ctx context.Context) (result NatGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.nglr.Response.Response != nil { - sc = result.nglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.nglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", resp, "Failure sending request") - return - } - - result.nglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", resp, "Failure responding to request") - return - } - if result.nglr.hasNextLink() && result.nglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client NatGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) ListAllResponder(resp *http.Response) (result NatGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client NatGatewaysClient) listAllNextResults(ctx context.Context, lastResults NatGatewayListResult) (result NatGatewayListResult, err error) { - req, err := lastResults.natGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client NatGatewaysClient) ListAllComplete(ctx context.Context) (result NatGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates nat gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// parameters - parameters supplied to update nat gateway tags. -func (client NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject) (result NatGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, natGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client NatGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) UpdateTagsResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/operations.go deleted file mode 100644 index fa772163d3c4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the network Client -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Network Rest API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.olr.Response.Response != nil { - sc = result.olr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.olr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.olr.hasNextLink() && result.olr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Network/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { - req, err := lastResults.operationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/p2svpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/p2svpngateways.go deleted file mode 100644 index 7095e590f53f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/p2svpngateways.go +++ /dev/null @@ -1,897 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// P2sVpnGatewaysClient is the network Client -type P2sVpnGatewaysClient struct { - BaseClient -} - -// NewP2sVpnGatewaysClient creates an instance of the P2sVpnGatewaysClient client. -func NewP2sVpnGatewaysClient(subscriptionID string) P2sVpnGatewaysClient { - return NewP2sVpnGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewP2sVpnGatewaysClientWithBaseURI creates an instance of the P2sVpnGatewaysClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewP2sVpnGatewaysClientWithBaseURI(baseURI string, subscriptionID string) P2sVpnGatewaysClient { - return P2sVpnGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -// p2SVpnGatewayParameters - parameters supplied to create or Update a virtual wan p2s vpn gateway. -func (client P2sVpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters P2SVpnGateway) (result P2sVpnGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, p2SVpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client P2sVpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters P2SVpnGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - p2SVpnGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(p2SVpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future P2sVpnGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a virtual wan p2s vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -func (client P2sVpnGatewaysClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string) (result P2sVpnGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client P2sVpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) DeleteSender(req *http.Request) (future P2sVpnGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectP2sVpnConnections disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// p2sVpnGatewayName - the name of the P2S Vpn Gateway. -// request - the parameters are supplied to disconnect p2s vpn connections. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnections(ctx context.Context, resourceGroupName string, p2sVpnGatewayName string, request P2SVpnConnectionRequest) (result P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.DisconnectP2sVpnConnections") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisconnectP2sVpnConnectionsPreparer(ctx, resourceGroupName, p2sVpnGatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "DisconnectP2sVpnConnections", nil, "Failure preparing request") - return - } - - result, err = client.DisconnectP2sVpnConnectionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "DisconnectP2sVpnConnections", nil, "Failure sending request") - return - } - - return -} - -// DisconnectP2sVpnConnectionsPreparer prepares the DisconnectP2sVpnConnections request. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsPreparer(ctx context.Context, resourceGroupName string, p2sVpnGatewayName string, request P2SVpnConnectionRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "p2sVpnGatewayName": autorest.Encode("path", p2sVpnGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectP2sVpnConnectionsSender sends the DisconnectP2sVpnConnections request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsSender(req *http.Request) (future P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DisconnectP2sVpnConnectionsResponder handles the response to the DisconnectP2sVpnConnections request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateVpnProfile generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -// parameters - parameters supplied to the generate P2SVpnGateway VPN client package operation. -func (client P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVpnProfileParameters) (result P2sVpnGatewaysGenerateVpnProfileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GenerateVpnProfile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, gatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", nil, "Failure preparing request") - return - } - - result, err = client.GenerateVpnProfileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", nil, "Failure sending request") - return - } - - return -} - -// GenerateVpnProfilePreparer prepares the GenerateVpnProfile request. -func (client P2sVpnGatewaysClient) GenerateVpnProfilePreparer(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVpnProfileParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future P2sVpnGatewaysGenerateVpnProfileFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result VpnProfileResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves the details of a virtual wan p2s vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -func (client P2sVpnGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string) (result P2SVpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client P2sVpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetP2sVpnConnectionHealth gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the -// specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string) (result P2sVpnGatewaysGetP2sVpnConnectionHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GetP2sVpnConnectionHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetP2sVpnConnectionHealthPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", nil, "Failure preparing request") - return - } - - result, err = client.GetP2sVpnConnectionHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", nil, "Failure sending request") - return - } - - return -} - -// GetP2sVpnConnectionHealthPreparer prepares the GetP2sVpnConnectionHealth request. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetP2sVpnConnectionHealthSender sends the GetP2sVpnConnectionHealth request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthSender(req *http.Request) (future P2sVpnGatewaysGetP2sVpnConnectionHealthFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetP2sVpnConnectionHealthResponder handles the response to the GetP2sVpnConnectionHealth request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetP2sVpnConnectionHealthDetailed gets the sas url to get the connection health detail of P2S clients of the virtual -// wan P2SVpnGateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -// request - request parameters supplied to get p2s vpn connections detailed health. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVpnConnectionHealthRequest) (result P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetP2sVpnConnectionHealthDetailedPreparer(ctx, resourceGroupName, gatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealthDetailed", nil, "Failure preparing request") - return - } - - result, err = client.GetP2sVpnConnectionHealthDetailedSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealthDetailed", nil, "Failure sending request") - return - } - - return -} - -// GetP2sVpnConnectionHealthDetailedPreparer prepares the GetP2sVpnConnectionHealthDetailed request. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedPreparer(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVpnConnectionHealthRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetP2sVpnConnectionHealthDetailedSender sends the GetP2sVpnConnectionHealthDetailed request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedSender(req *http.Request) (future P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetP2sVpnConnectionHealthDetailedResponder handles the response to the GetP2sVpnConnectionHealthDetailed request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedResponder(resp *http.Response) (result P2SVpnConnectionHealth, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the P2SVpnGateways in a subscription. -func (client P2sVpnGatewaysClient) List(ctx context.Context) (result ListP2SVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.List") - defer func() { - sc := -1 - if result.lpvgr.Response.Response != nil { - sc = result.lpvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lpvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lpvgr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client P2sVpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) ListResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client P2sVpnGatewaysClient) listNextResults(ctx context.Context, lastResults ListP2SVpnGatewaysResult) (result ListP2SVpnGatewaysResult, err error) { - req, err := lastResults.listP2SVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client P2sVpnGatewaysClient) ListComplete(ctx context.Context) (result ListP2SVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the P2SVpnGateways in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -func (client P2sVpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListP2SVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lpvgr.Response.Response != nil { - sc = result.lpvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lpvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lpvgr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client P2sVpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client P2sVpnGatewaysClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListP2SVpnGatewaysResult) (result ListP2SVpnGatewaysResult, err error) { - req, err := lastResults.listP2SVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client P2sVpnGatewaysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListP2SVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates virtual wan p2s vpn gateway tags. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -// p2SVpnGatewayParameters - parameters supplied to update a virtual wan p2s vpn gateway tags. -func (client P2sVpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters TagsObject) (result P2SVpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, gatewayName, p2SVpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client P2sVpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(p2SVpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/packetcaptures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/packetcaptures.go deleted file mode 100644 index 74578fa67cda..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/packetcaptures.go +++ /dev/null @@ -1,516 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PacketCapturesClient is the network Client -type PacketCapturesClient struct { - BaseClient -} - -// NewPacketCapturesClient creates an instance of the PacketCapturesClient client. -func NewPacketCapturesClient(subscriptionID string) PacketCapturesClient { - return NewPacketCapturesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPacketCapturesClientWithBaseURI creates an instance of the PacketCapturesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) PacketCapturesClient { - return PacketCapturesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create and start a packet capture on the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -// parameters - parameters that define the create packet capture operation. -func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (result PacketCapturesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PacketCaptureParameters", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.Target", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.PacketCaptureParameters.StorageLocation", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.PacketCapturesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", nil, "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) CreateSender(req *http.Request) (future PacketCapturesCreateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result PacketCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) DeleteSender(req *http.Request) (future PacketCapturesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a packet capture session by name. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCaptureResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PacketCapturesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) GetResponder(resp *http.Response) (result PacketCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStatus query the status of a running packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the Network Watcher resource. -// packetCaptureName - the name given to the packet capture session. -func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesGetStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.GetStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetStatusPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", nil, "Failure sending request") - return - } - - return -} - -// GetStatusPreparer prepares the GetStatus request. -func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatusSender sends the GetStatus request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future PacketCapturesGetStatusFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetStatusResponder handles the response to the GetStatus request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (result PacketCaptureQueryStatusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all packet capture sessions within the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the Network Watcher resource. -func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PacketCapturesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) ListResponder(resp *http.Response) (result PacketCaptureListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Stop stops a specified packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", nil, "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketCapturesStopFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/peerexpressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/peerexpressroutecircuitconnections.go deleted file mode 100644 index 8112fc7d233c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/peerexpressroutecircuitconnections.go +++ /dev/null @@ -1,233 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PeerExpressRouteCircuitConnectionsClient is the network Client -type PeerExpressRouteCircuitConnectionsClient struct { - BaseClient -} - -// NewPeerExpressRouteCircuitConnectionsClient creates an instance of the PeerExpressRouteCircuitConnectionsClient -// client. -func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string) PeerExpressRouteCircuitConnectionsClient { - return NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPeerExpressRouteCircuitConnectionsClientWithBaseURI creates an instance of the -// PeerExpressRouteCircuitConnectionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PeerExpressRouteCircuitConnectionsClient { - return PeerExpressRouteCircuitConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified Peer Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the peer express route circuit connection. -func (client PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result PeerExpressRouteCircuitConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PeerExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PeerExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PeerExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result PeerExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all global reach peer connections associated with a private peering in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// peeringName - the name of the peering. -func (client PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result PeerExpressRouteCircuitConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.percclr.Response.Response != nil { - sc = result.percclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.percclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.percclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.percclr.hasNextLink() && result.percclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PeerExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PeerExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PeerExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result PeerExpressRouteCircuitConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PeerExpressRouteCircuitConnectionsClient) listNextResults(ctx context.Context, lastResults PeerExpressRouteCircuitConnectionListResult) (result PeerExpressRouteCircuitConnectionListResult, err error) { - req, err := lastResults.peerExpressRouteCircuitConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PeerExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result PeerExpressRouteCircuitConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName, peeringName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatelinkservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatelinkservices.go deleted file mode 100644 index 570ba2936444..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatelinkservices.go +++ /dev/null @@ -1,1261 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkServicesClient is the network Client -type PrivateLinkServicesClient struct { - BaseClient -} - -// NewPrivateLinkServicesClient creates an instance of the PrivateLinkServicesClient client. -func NewPrivateLinkServicesClient(subscriptionID string) PrivateLinkServicesClient { - return NewPrivateLinkServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkServicesClientWithBaseURI creates an instance of the PrivateLinkServicesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateLinkServicesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkServicesClient { - return PrivateLinkServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckPrivateLinkServiceVisibility checks whether the subscription is visible to private link service. -// Parameters: -// location - the location of the domain name. -// parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckPrivateLinkServiceVisibilityPreparer(ctx, location, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure preparing request") - return - } - - result, err = client.CheckPrivateLinkServiceVisibilitySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure sending request") - return - } - - return -} - -// CheckPrivateLinkServiceVisibilityPreparer prepares the CheckPrivateLinkServiceVisibility request. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPreparer(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckPrivateLinkServiceVisibilitySender sends the CheckPrivateLinkServiceVisibility request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckPrivateLinkServiceVisibilityResponder handles the response to the CheckPrivateLinkServiceVisibility request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroup checks whether the subscription is visible to private link service -// in the specified resource group. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -// parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx, location, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure preparing request") - return - } - - result, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure sending request") - return - } - - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupPreparer prepares the CheckPrivateLinkServiceVisibilityByResourceGroup request. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupSender sends the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupSender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupResponder handles the response to the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates an private link service in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// parameters - parameters supplied to the create or update private link service operation. -func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (result PrivateLinkServicesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CreateOrUpdateSender(req *http.Request) (future PrivateLinkServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private link service. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -func (client PrivateLinkServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateLinkServicesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) DeleteSender(req *http.Request) (future PrivateLinkServicesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeletePrivateEndpointConnection delete private end point connection for a private link service in a subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (result PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.DeletePrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.DeletePrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure sending request") - return - } - - return -} - -// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private link service by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// expand - expands referenced resources. -func (client PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, expand string) (result PrivateLinkService, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) GetResponder(resp *http.Response) (result PrivateLinkService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrivateEndpointConnection get the specific private end point connection by specific private link service in the -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -// expand - expands referenced resources. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, expand string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.GetPrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.GetPrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private link services in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PrivateLinkServicesClient) List(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") - defer func() { - sc := -1 - if result.plslr.Response.Response != nil { - sc = result.plslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.plslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure sending request") - return - } - - result.plslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure responding to request") - return - } - if result.plslr.hasNextLink() && result.plslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { - req, err := lastResults.privateLinkServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAutoApprovedPrivateLinkServices returns all of the private link service ids that can be linked to a Private -// Endpoint with auto approved in this subscription in this region. -// Parameters: -// location - the location of the domain name. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") - defer func() { - sc := -1 - if result.aaplsr.Response.Response != nil { - sc = result.aaplsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAutoApprovedPrivateLinkServicesNextResults - req, err := client.ListAutoApprovedPrivateLinkServicesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", nil, "Failure preparing request") - return - } - - resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) - if err != nil { - result.aaplsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure sending request") - return - } - - result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure responding to request") - return - } - if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAutoApprovedPrivateLinkServicesPreparer prepares the ListAutoApprovedPrivateLinkServices request. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAutoApprovedPrivateLinkServicesSender sends the ListAutoApprovedPrivateLinkServices request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAutoApprovedPrivateLinkServicesResponder handles the response to the ListAutoApprovedPrivateLinkServices request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAutoApprovedPrivateLinkServicesNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { - req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAutoApprovedPrivateLinkServicesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesComplete(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAutoApprovedPrivateLinkServices(ctx, location) - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroup returns all of the private link service ids that can be linked to -// a Private Endpoint with auto approved in this subscription in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") - defer func() { - sc := -1 - if result.aaplsr.Response.Response != nil { - sc = result.aaplsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAutoApprovedPrivateLinkServicesByResourceGroupNextResults - req, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) - if err != nil { - result.aaplsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure sending request") - return - } - - result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure responding to request") - return - } - if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer prepares the ListAutoApprovedPrivateLinkServicesByResourceGroup request. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupSender sends the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupResponder handles the response to the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAutoApprovedPrivateLinkServicesByResourceGroupNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { - req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, location, resourceGroupName) - return -} - -// ListBySubscription gets all private link service in a subscription. -func (client PrivateLinkServicesClient) ListBySubscription(ctx context.Context) (result PrivateLinkServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") - defer func() { - sc := -1 - if result.plslr.Response.Response != nil { - sc = result.plslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.plslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.plslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.plslr.hasNextLink() && result.plslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { - req, err := lastResults.privateLinkServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateLinkServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// ListPrivateEndpointConnections gets all private end point connections for a specific private link service. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listPrivateEndpointConnectionsNextResults - req, err := client.ListPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", resp, "Failure responding to request") - return - } - if result.peclr.hasNextLink() && result.peclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPrivateEndpointConnectionsPreparer prepares the ListPrivateEndpointConnections request. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrivateEndpointConnectionsSender sends the ListPrivateEndpointConnections request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPrivateEndpointConnectionsResponder handles the response to the ListPrivateEndpointConnections request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPrivateEndpointConnectionsNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listPrivateEndpointConnectionsNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPrivateEndpointConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListPrivateEndpointConnections(ctx, resourceGroupName, serviceName) - return -} - -// UpdatePrivateEndpointConnection approve or reject private end point connection for a private link service in a -// subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -// parameters - parameters supplied to approve or reject the private end point connection. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.UpdatePrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.UpdatePrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePrivateEndpointConnectionPreparer prepares the UpdatePrivateEndpointConnection request. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Type = nil - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePrivateEndpointConnectionSender sends the UpdatePrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdatePrivateEndpointConnectionResponder handles the response to the UpdatePrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/profiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/profiles.go deleted file mode 100644 index e014cdd9242b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/profiles.go +++ /dev/null @@ -1,576 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProfilesClient is the network Client -type ProfilesClient struct { - BaseClient -} - -// NewProfilesClient creates an instance of the ProfilesClient client. -func NewProfilesClient(subscriptionID string) ProfilesClient { - return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient { - return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network profile. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the network profile. -// parameters - parameters supplied to the create or update network profile operation. -func (client ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkProfileName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network profile. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the NetworkProfile. -func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName string, networkProfileName string) (result ProfilesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkProfileName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkProfileName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network profile in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the public IP prefix. -// expand - expands referenced resources. -func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, networkProfileName string, expand string) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkProfileName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkProfileName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network profiles in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProfilesClient) List(ctx context.Context, resourceGroupName string) (result ProfileListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.List") - defer func() { - sc := -1 - if result.plr.Response.Response != nil { - sc = result.plr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.plr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure sending request") - return - } - - result.plr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure responding to request") - return - } - if result.plr.hasNextLink() && result.plr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ProfilesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ProfilesClient) listNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { - req, err := lastResults.profileListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProfilesClient) ListComplete(ctx context.Context, resourceGroupName string) (result ProfileListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the network profiles in a subscription. -func (client ProfilesClient) ListAll(ctx context.Context) (result ProfileListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListAll") - defer func() { - sc := -1 - if result.plr.Response.Response != nil { - sc = result.plr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.plr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure sending request") - return - } - - result.plr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.plr.hasNextLink() && result.plr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ProfilesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ProfilesClient) ListAllResponder(resp *http.Response) (result ProfileListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ProfilesClient) listAllNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { - req, err := lastResults.profileListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProfilesClient) ListAllComplete(ctx context.Context) (result ProfileListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates network profile tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the network profile. -// parameters - parameters supplied to update network profile tags. -func (client ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkProfileName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ProfilesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ProfilesClient) UpdateTagsResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipaddresses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipaddresses.go deleted file mode 100644 index f7ca0f331e70..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipaddresses.go +++ /dev/null @@ -1,923 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PublicIPAddressesClient is the network Client -type PublicIPAddressesClient struct { - BaseClient -} - -// NewPublicIPAddressesClient creates an instance of the PublicIPAddressesClient client. -func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient { - return NewPublicIPAddressesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPublicIPAddressesClientWithBaseURI creates an instance of the PublicIPAddressesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPAddressesClient { - return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a static or dynamic public IP address. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// parameters - parameters supplied to the create or update public IP address operation. -func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (result PublicIPAddressesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.PublicIPAddressesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, publicIPAddressName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (future PublicIPAddressesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified public IP address. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -func (client PublicIPAddressesClient) Delete(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result PublicIPAddressesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, publicIPAddressName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future PublicIPAddressesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified public IP address in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// expand - expands referenced resources. -func (client PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, publicIPAddressName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PublicIPAddressesClient) GetPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetPublicIPAddress get the specified public IP address in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the IP configuration. -// publicIPAddressName - the name of the public IP Address. -// expand - expands referenced resources. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetPublicIPAddressSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetPublicIPAddressResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetPublicIPAddressPreparer prepares the GetVirtualMachineScaleSetPublicIPAddress request. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetPublicIPAddressSender sends the GetVirtualMachineScaleSetPublicIPAddress request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetPublicIPAddressResponder handles the response to the GetVirtualMachineScaleSetPublicIPAddress request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all public IP addresses in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PublicIPAddressesClient) List(ctx context.Context, resourceGroupName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.List") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PublicIPAddressesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the public IP addresses in a subscription. -func (client PublicIPAddressesClient) ListAll(ctx context.Context) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListAll") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client PublicIPAddressesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListAllResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listAllNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListAllComplete(ctx context.Context) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListVirtualMachineScaleSetPublicIPAddresses gets information about all public IP addresses on a virtual machine -// scale set level. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetPublicIPAddressesNextResults - req, err := client.ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetPublicIPAddresses request. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetPublicIPAddressesSender sends the ListVirtualMachineScaleSetPublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetPublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetPublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetPublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetPublicIPAddresses(ctx, resourceGroupName, virtualMachineScaleSetName) - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddresses gets information about all public IP addresses in a virtual machine IP -// configuration in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the network interface name. -// IPConfigurationName - the IP configuration name. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetVMPublicIPAddressesNextResults - req, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetVMPublicIPAddresses request. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesSender sends the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetVMPublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetVMPublicIPAddresses(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) - return -} - -// UpdateTags updates public IP address tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// parameters - parameters supplied to update public IP address tags. -func (client PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, publicIPAddressName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipprefixes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipprefixes.go deleted file mode 100644 index 9aae95aa21e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/publicipprefixes.go +++ /dev/null @@ -1,579 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PublicIPPrefixesClient is the network Client -type PublicIPPrefixesClient struct { - BaseClient -} - -// NewPublicIPPrefixesClient creates an instance of the PublicIPPrefixesClient client. -func NewPublicIPPrefixesClient(subscriptionID string) PublicIPPrefixesClient { - return NewPublicIPPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPublicIPPrefixesClientWithBaseURI creates an instance of the PublicIPPrefixesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPublicIPPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPPrefixesClient { - return PublicIPPrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a static or dynamic public IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// parameters - parameters supplied to the create or update public IP prefix operation. -func (client PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix) (result PublicIPPrefixesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, publicIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PublicIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (future PublicIPPrefixesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified public IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the PublicIpPrefix. -func (client PublicIPPrefixesClient) Delete(ctx context.Context, resourceGroupName string, publicIPPrefixName string) (result PublicIPPrefixesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, publicIPPrefixName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PublicIPPrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) DeleteSender(req *http.Request) (future PublicIPPrefixesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified public IP prefix in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// expand - expands referenced resources. -func (client PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, publicIPPrefixName string, expand string) (result PublicIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, publicIPPrefixName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PublicIPPrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) GetResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all public IP prefixes in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PublicIPPrefixesClient) List(ctx context.Context, resourceGroupName string) (result PublicIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.List") - defer func() { - sc := -1 - if result.piplr.Response.Response != nil { - sc = result.piplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.piplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure sending request") - return - } - - result.piplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure responding to request") - return - } - if result.piplr.hasNextLink() && result.piplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PublicIPPrefixesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) ListResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PublicIPPrefixesClient) listNextResults(ctx context.Context, lastResults PublicIPPrefixListResult) (result PublicIPPrefixListResult, err error) { - req, err := lastResults.publicIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPPrefixesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PublicIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the public IP prefixes in a subscription. -func (client PublicIPPrefixesClient) ListAll(ctx context.Context) (result PublicIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.piplr.Response.Response != nil { - sc = result.piplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.piplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure sending request") - return - } - - result.piplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.piplr.hasNextLink() && result.piplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client PublicIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) ListAllResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client PublicIPPrefixesClient) listAllNextResults(ctx context.Context, lastResults PublicIPPrefixListResult) (result PublicIPPrefixListResult, err error) { - req, err := lastResults.publicIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPPrefixesClient) ListAllComplete(ctx context.Context) (result PublicIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates public IP prefix tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// parameters - parameters supplied to update public IP prefix tags. -func (client PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject) (result PublicIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, publicIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client PublicIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routes.go deleted file mode 100644 index b690f95f02de..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routes.go +++ /dev/null @@ -1,390 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RoutesClient is the network Client -type RoutesClient struct { - BaseClient -} - -// NewRoutesClient creates an instance of the RoutesClient client. -func NewRoutesClient(subscriptionID string) RoutesClient { - return NewRoutesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutesClientWithBaseURI creates an instance of the RoutesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesClient { - return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route in the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -// routeParameters - parameters supplied to the create or update route operation. -func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result RoutesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, routeName, routeParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithJSON(routeParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future RoutesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result Route, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route from a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result RoutesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName, routeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route from a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result Route, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, routeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all routes in a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -func (client RoutesClient) List(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.List") - defer func() { - sc := -1 - if result.rlr.Response.Response != nil { - sc = result.rlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending request") - return - } - - result.rlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to request") - return - } - if result.rlr.hasNextLink() && result.rlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RoutesClient) ListPreparer(ctx context.Context, resourceGroupName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RoutesClient) ListResponder(resp *http.Response) (result RouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RoutesClient) listNextResults(ctx context.Context, lastResults RouteListResult) (result RouteListResult, err error) { - req, err := lastResults.routeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutesClient) ListComplete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, routeTableName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routetables.go deleted file mode 100644 index 46596092ca78..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routetables.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteTablesClient is the network Client -type RouteTablesClient struct { - BaseClient -} - -// NewRouteTablesClient creates an instance of the RouteTablesClient client. -func NewRouteTablesClient(subscriptionID string) RouteTablesClient { - return NewRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteTablesClientWithBaseURI creates an instance of the RouteTablesClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) RouteTablesClient { - return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or updates a route table in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// parameters - parameters supplied to the create or update route table operation. -func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTablesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future RouteTablesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteTablesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTablesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// expand - expands referenced resources. -func (client RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteTablesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all route tables in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RouteTablesClient) List(ctx context.Context, resourceGroupName string) (result RouteTableListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.List") - defer func() { - sc := -1 - if result.rtlr.Response.Response != nil { - sc = result.rtlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rtlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending request") - return - } - - result.rtlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to request") - return - } - if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RouteTablesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) ListResponder(resp *http.Response) (result RouteTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RouteTablesClient) listNextResults(ctx context.Context, lastResults RouteTableListResult) (result RouteTableListResult, err error) { - req, err := lastResults.routeTableListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteTablesClient) ListComplete(ctx context.Context, resourceGroupName string) (result RouteTableListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all route tables in a subscription. -func (client RouteTablesClient) ListAll(ctx context.Context) (result RouteTableListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.ListAll") - defer func() { - sc := -1 - if result.rtlr.Response.Response != nil { - sc = result.rtlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.rtlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending request") - return - } - - result.rtlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client RouteTablesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) ListAllResponder(resp *http.Response) (result RouteTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client RouteTablesClient) listAllNextResults(ctx context.Context, lastResults RouteTableListResult) (result RouteTableListResult, err error) { - req, err := lastResults.routeTableListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteTablesClient) ListAllComplete(ctx context.Context) (result RouteTableListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates a route table tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// parameters - parameters supplied to update route table tags. -func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (result RouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeTableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) UpdateTagsResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicies.go deleted file mode 100644 index 0ca52fb7e0ae..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicies.go +++ /dev/null @@ -1,579 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceEndpointPoliciesClient is the network Client -type ServiceEndpointPoliciesClient struct { - BaseClient -} - -// NewServiceEndpointPoliciesClient creates an instance of the ServiceEndpointPoliciesClient client. -func NewServiceEndpointPoliciesClient(subscriptionID string) ServiceEndpointPoliciesClient { - return NewServiceEndpointPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceEndpointPoliciesClientWithBaseURI creates an instance of the ServiceEndpointPoliciesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceEndpointPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServiceEndpointPoliciesClient { - return ServiceEndpointPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a service Endpoint Policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// parameters - parameters supplied to the create or update service endpoint policy operation. -func (client ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy) (result ServiceEndpointPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServiceEndpointPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServiceEndpointPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -func (client ServiceEndpointPoliciesClient) Delete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceEndpointPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServiceEndpointPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) DeleteSender(req *http.Request) (future ServiceEndpointPoliciesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified service Endpoint Policies in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// expand - expands referenced resources. -func (client ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, expand string) (result ServiceEndpointPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceEndpointPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the service endpoint policies in a subscription. -func (client ServiceEndpointPoliciesClient) List(ctx context.Context) (result ServiceEndpointPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.List") - defer func() { - sc := -1 - if result.seplr.Response.Response != nil { - sc = result.seplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.seplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.seplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.seplr.hasNextLink() && result.seplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceEndpointPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) ListResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPoliciesClient) listNextResults(ctx context.Context, lastResults ServiceEndpointPolicyListResult) (result ServiceEndpointPolicyListResult, err error) { - req, err := lastResults.serviceEndpointPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPoliciesClient) ListComplete(ctx context.Context) (result ServiceEndpointPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all service endpoint Policies in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ServiceEndpointPoliciesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceEndpointPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.seplr.Response.Response != nil { - sc = result.seplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.seplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.seplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.seplr.hasNextLink() && result.seplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPoliciesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceEndpointPolicyListResult) (result ServiceEndpointPolicyListResult, err error) { - req, err := lastResults.serviceEndpointPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceEndpointPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// parameters - parameters supplied to update service endpoint policy tags. -func (client ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject) (result ServiceEndpointPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ServiceEndpointPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) UpdateTagsResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicydefinitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicydefinitions.go deleted file mode 100644 index e78184da2574..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceendpointpolicydefinitions.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceEndpointPolicyDefinitionsClient is the network Client -type ServiceEndpointPolicyDefinitionsClient struct { - BaseClient -} - -// NewServiceEndpointPolicyDefinitionsClient creates an instance of the ServiceEndpointPolicyDefinitionsClient client. -func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string) ServiceEndpointPolicyDefinitionsClient { - return NewServiceEndpointPolicyDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceEndpointPolicyDefinitionsClientWithBaseURI creates an instance of the -// ServiceEndpointPolicyDefinitionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewServiceEndpointPolicyDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) ServiceEndpointPolicyDefinitionsClient { - return ServiceEndpointPolicyDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a service endpoint policy definition in the specified service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition name. -// serviceEndpointPolicyDefinitions - parameters supplied to the create or update service endpoint policy -// operation. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition) (result ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - serviceEndpointPolicyDefinitions.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithJSON(serviceEndpointPolicyDefinitions), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateSender(req *http.Request) (future ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ServiceEndpoint policy definitions. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the Service Endpoint Policy. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition. -func (client ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (result ServiceEndpointPolicyDefinitionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServiceEndpointPolicyDefinitionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) DeleteSender(req *http.Request) (future ServiceEndpointPolicyDefinitionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified service endpoint policy definitions from service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy name. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition name. -func (client ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (result ServiceEndpointPolicyDefinition, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceEndpointPolicyDefinitionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets all service endpoint policy definitions in a service end point policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy name. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPolicyDefinitionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sepdlr.Response.Response != nil { - sc = result.sepdlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, serviceEndpointPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sepdlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sepdlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sepdlr.hasNextLink() && result.sepdlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyDefinitionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPolicyDefinitionsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceEndpointPolicyDefinitionListResult) (result ServiceEndpointPolicyDefinitionListResult, err error) { - req, err := lastResults.serviceEndpointPolicyDefinitionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPolicyDefinitionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, serviceEndpointPolicyName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/servicetags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/servicetags.go deleted file mode 100644 index 1ca13a45289b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/servicetags.go +++ /dev/null @@ -1,107 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceTagsClient is the network Client -type ServiceTagsClient struct { - BaseClient -} - -// NewServiceTagsClient creates an instance of the ServiceTagsClient client. -func NewServiceTagsClient(subscriptionID string) ServiceTagsClient { - return NewServiceTagsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceTagsClientWithBaseURI creates an instance of the ServiceTagsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewServiceTagsClientWithBaseURI(baseURI string, subscriptionID string) ServiceTagsClient { - return ServiceTagsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of service tag information resources. -// Parameters: -// location - the location that will be used as a reference for version (not as a filter based on location, you -// will get the list of service tags with prefix details across all regions but limited to the cloud that your -// subscription belongs to). -func (client ServiceTagsClient) List(ctx context.Context, location string) (result ServiceTagsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceTagsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceTagsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceTagsClient) ListResponder(resp *http.Response) (result ServiceTagsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/usages.go deleted file mode 100644 index fbec6cb9ca25..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/usages.go +++ /dev/null @@ -1,154 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the network Client -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list network usages for a subscription. -// Parameters: -// location - the location where resource usage is queried. -func (client UsagesClient) List(ctx context.Context, location string) (result UsagesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.ulr.Response.Response != nil { - sc = result.ulr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._ ]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.UsagesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ulr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure sending request") - return - } - - result.ulr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to request") - return - } - if result.ulr.hasNextLink() && result.ulr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsagesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListResponder(resp *http.Response) (result UsagesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client UsagesClient) listNextResults(ctx context.Context, lastResults UsagesListResult) (result UsagesListResult, err error) { - req, err := lastResults.usagesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesClient) ListComplete(ctx context.Context, location string) (result UsagesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualapplianceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualapplianceskus.go deleted file mode 100644 index a2629643af97..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualapplianceskus.go +++ /dev/null @@ -1,219 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualApplianceSkusClient is the network Client -type VirtualApplianceSkusClient struct { - BaseClient -} - -// NewVirtualApplianceSkusClient creates an instance of the VirtualApplianceSkusClient client. -func NewVirtualApplianceSkusClient(subscriptionID string) VirtualApplianceSkusClient { - return NewVirtualApplianceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualApplianceSkusClientWithBaseURI creates an instance of the VirtualApplianceSkusClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualApplianceSkusClientWithBaseURI(baseURI string, subscriptionID string) VirtualApplianceSkusClient { - return VirtualApplianceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves a single available sku for network virtual appliance. -// Parameters: -// skuName - name of the Sku. -func (client VirtualApplianceSkusClient) Get(ctx context.Context, skuName string) (result VirtualApplianceSku, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, skuName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualApplianceSkusClient) GetPreparer(ctx context.Context, skuName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "skuName": autorest.Encode("path", skuName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSkusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSkusClient) GetResponder(resp *http.Response) (result VirtualApplianceSku, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all SKUs available for a virtual appliance. -func (client VirtualApplianceSkusClient) List(ctx context.Context) (result VirtualApplianceSkuListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.List") - defer func() { - sc := -1 - if result.vaslr.Response.Response != nil { - sc = result.vaslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vaslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", resp, "Failure sending request") - return - } - - result.vaslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.vaslr.hasNextLink() && result.vaslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualApplianceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSkusClient) ListResponder(resp *http.Response) (result VirtualApplianceSkuListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualApplianceSkusClient) listNextResults(ctx context.Context, lastResults VirtualApplianceSkuListResult) (result VirtualApplianceSkuListResult, err error) { - req, err := lastResults.virtualApplianceSkuListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualApplianceSkusClient) ListComplete(ctx context.Context) (result VirtualApplianceSkuListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnection.go deleted file mode 100644 index 6495db341abd..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnection.go +++ /dev/null @@ -1,287 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubBgpConnectionClient is the network Client -type VirtualHubBgpConnectionClient struct { - BaseClient -} - -// NewVirtualHubBgpConnectionClient creates an instance of the VirtualHubBgpConnectionClient client. -func NewVirtualHubBgpConnectionClient(subscriptionID string) VirtualHubBgpConnectionClient { - return NewVirtualHubBgpConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubBgpConnectionClientWithBaseURI creates an instance of the VirtualHubBgpConnectionClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualHubBgpConnectionClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubBgpConnectionClient { - return VirtualHubBgpConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing -// VirtualHubBgpConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -// parameters - parameters of Bgp connection. -func (client VirtualHubBgpConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection) (result VirtualHubBgpConnectionCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.BgpConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubBgpConnectionClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubBgpConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubBgpConnectionCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result BgpConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubBgpConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubBgpConnection. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -func (client VirtualHubBgpConnectionClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result VirtualHubBgpConnectionDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubBgpConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) DeleteSender(req *http.Request) (future VirtualHubBgpConnectionDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a Virtual Hub Bgp Connection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -func (client VirtualHubBgpConnectionClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result BgpConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubBgpConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) GetResponder(resp *http.Response) (result BgpConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnections.go deleted file mode 100644 index ee09b7c80583..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubbgpconnections.go +++ /dev/null @@ -1,150 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubBgpConnectionsClient is the network Client -type VirtualHubBgpConnectionsClient struct { - BaseClient -} - -// NewVirtualHubBgpConnectionsClient creates an instance of the VirtualHubBgpConnectionsClient client. -func NewVirtualHubBgpConnectionsClient(subscriptionID string) VirtualHubBgpConnectionsClient { - return NewVirtualHubBgpConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubBgpConnectionsClientWithBaseURI creates an instance of the VirtualHubBgpConnectionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualHubBgpConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubBgpConnectionsClient { - return VirtualHubBgpConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List retrieves the details of all VirtualHubBgpConnections. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubBgpConnectionsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubBgpConnectionResultsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.List") - defer func() { - sc := -1 - if result.lvhbcr.Response.Response != nil { - sc = result.lvhbcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhbcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.lvhbcr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.lvhbcr.hasNextLink() && result.lvhbcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubBgpConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionsClient) ListResponder(resp *http.Response) (result ListVirtualHubBgpConnectionResults, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubBgpConnectionsClient) listNextResults(ctx context.Context, lastResults ListVirtualHubBgpConnectionResults) (result ListVirtualHubBgpConnectionResults, err error) { - req, err := lastResults.listVirtualHubBgpConnectionResultsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubBgpConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubBgpConnectionResultsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubipconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubipconfiguration.go deleted file mode 100644 index f05b3c7b3fda..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubipconfiguration.go +++ /dev/null @@ -1,409 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubIPConfigurationClient is the network Client -type VirtualHubIPConfigurationClient struct { - BaseClient -} - -// NewVirtualHubIPConfigurationClient creates an instance of the VirtualHubIPConfigurationClient client. -func NewVirtualHubIPConfigurationClient(subscriptionID string) VirtualHubIPConfigurationClient { - return NewVirtualHubIPConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubIPConfigurationClientWithBaseURI creates an instance of the VirtualHubIPConfigurationClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualHubIPConfigurationClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubIPConfigurationClient { - return VirtualHubIPConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing -// VirtualHubIpConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -// parameters - hub Ip Configuration parameters. -func (client VirtualHubIPConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string, parameters HubIPConfiguration) (result VirtualHubIPConfigurationCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubIPConfigurationClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, IPConfigName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubIPConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string, parameters HubIPConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubIPConfigurationCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result HubIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubIpConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubBgpConnection. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -func (client VirtualHubIPConfigurationClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (result VirtualHubIPConfigurationDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, IPConfigName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubIPConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) DeleteSender(req *http.Request) (future VirtualHubIPConfigurationDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a Virtual Hub Ip configuration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -func (client VirtualHubIPConfigurationClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (result HubIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, IPConfigName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubIPConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) GetResponder(resp *http.Response) (result HubIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all VirtualHubIpConfigurations. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubIPConfigurationClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubIPConfigurationResultsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.List") - defer func() { - sc := -1 - if result.lvhicr.Response.Response != nil { - sc = result.lvhicr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhicr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", resp, "Failure sending request") - return - } - - result.lvhicr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", resp, "Failure responding to request") - return - } - if result.lvhicr.hasNextLink() && result.lvhicr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubIPConfigurationClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) ListResponder(resp *http.Response) (result ListVirtualHubIPConfigurationResults, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubIPConfigurationClient) listNextResults(ctx context.Context, lastResults ListVirtualHubIPConfigurationResults) (result ListVirtualHubIPConfigurationResults, err error) { - req, err := lastResults.listVirtualHubIPConfigurationResultsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubIPConfigurationClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubIPConfigurationResultsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgatewayconnections.go deleted file mode 100644 index cc23b2a7df40..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgatewayconnections.go +++ /dev/null @@ -1,930 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkGatewayConnectionsClient is the network Client -type VirtualNetworkGatewayConnectionsClient struct { - BaseClient -} - -// NewVirtualNetworkGatewayConnectionsClient creates an instance of the VirtualNetworkGatewayConnectionsClient client. -func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient { - return NewVirtualNetworkGatewayConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of the -// VirtualNetworkGatewayConnectionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayConnectionsClient { - return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - parameters supplied to the create or update virtual network gateway connection operation. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (result VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network Gateway connection. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewayConnectionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network gateway connection by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -func (client VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified -// virtual network gateway connection shared key through Network resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection shared key name. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.GetSharedKey") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request") - return - } - - resp, err := client.GetSharedKeySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure sending request") - return - } - - result, err = client.GetSharedKeyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure responding to request") - return - } - - return -} - -// GetSharedKeyPreparer prepares the GetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSharedKeySender sends the GetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetSharedKeyResponder handles the response to the GetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections -// created. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.List") - defer func() { - sc := -1 - if result.vngclr.Response.Response != nil { - sc = result.vngclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vngclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.vngclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.vngclr.hasNextLink() && result.vngclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewayConnectionsClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayConnectionListResult) (result VirtualNetworkGatewayConnectionListResult, err error) { - req, err := lastResults.virtualNetworkGatewayConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway -// connection shared key for passed virtual network gateway connection in the specified resource group through Network -// resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection reset shared key Name. -// parameters - parameters supplied to the begin reset virtual network gateway connection shared key operation -// through network resource provider. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (result VirtualNetworkGatewayConnectionsResetSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.ResetSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) - } - - req, err := client.ResetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.ResetSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure sending request") - return - } - - return -} - -// ResetSharedKeyPreparer prepares the ResetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSharedKeySender sends the ResetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsResetSharedKeyFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetSharedKeyResponder handles the response to the ResetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result ConnectionResetSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group through Network resource -// provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection name. -// parameters - parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation -// throughNetwork resource provider. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (result VirtualNetworkGatewayConnectionsSetSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.SetSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", err.Error()) - } - - req, err := client.SetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.SetSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure sending request") - return - } - - return -} - -// SetSharedKeyPreparer prepares the SetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetSharedKeySender sends the SetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsSetSharedKeyFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetSharedKeyResponder handles the response to the SetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartPacketCapture starts packet capture on virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - virtual network gateway packet capture parameters supplied to start packet capture on gateway -// connection. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters *VpnPacketCaptureStartParameters) (result VirtualNetworkGatewayConnectionsStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StartPacketCapture", nil, "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters *VpnPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewayConnectionsStartPacketCaptureFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. -// parameters - virtual network gateway packet capture parameters supplied to stop packet capture on gateway -// connection. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnPacketCaptureStopParameters) (result VirtualNetworkGatewayConnectionsStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StopPacketCapture", nil, "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewayConnectionsStopPacketCaptureFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a virtual network gateway connection tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - parameters supplied to update virtual network gateway connection tags. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (result VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", nil, "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkpeerings.go deleted file mode 100644 index d8e87d9de291..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkpeerings.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkPeeringsClient is the network Client -type VirtualNetworkPeeringsClient struct { - BaseClient -} - -// NewVirtualNetworkPeeringsClient creates an instance of the VirtualNetworkPeeringsClient client. -func NewVirtualNetworkPeeringsClient(subscriptionID string) VirtualNetworkPeeringsClient { - return NewVirtualNetworkPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkPeeringsClientWithBaseURI creates an instance of the VirtualNetworkPeeringsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkPeeringsClient { - return VirtualNetworkPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the peering. -// virtualNetworkPeeringParameters - parameters supplied to the create or update virtual network peering -// operation. -func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering) (result VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - virtualNetworkPeeringParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithJSON(virtualNetworkPeeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the virtual network peering. -func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (future VirtualNetworkPeeringsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the virtual network peering. -func (client VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual network peerings in a virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.List") - defer func() { - sc := -1 - if result.vnplr.Response.Response != nil { - sc = result.vnplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.vnplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.vnplr.hasNextLink() && result.vnplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (result VirtualNetworkPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkPeeringsClient) listNextResults(ctx context.Context, lastResults VirtualNetworkPeeringListResult) (result VirtualNetworkPeeringListResult, err error) { - req, err := lastResults.virtualNetworkPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualNetworkName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworks.go deleted file mode 100644 index 34fd74c1f50c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworks.go +++ /dev/null @@ -1,860 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworksClient is the network Client -type VirtualNetworksClient struct { - BaseClient -} - -// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient client. -func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient { - return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworksClientWithBaseURI creates an instance of the VirtualNetworksClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworksClient { - return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckIPAddressAvailability checks whether a private IP address is available for use. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// IPAddress - the private IP address to be verified. -func (client VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (result IPAddressAvailabilityResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.CheckIPAddressAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckIPAddressAvailabilityPreparer(ctx, resourceGroupName, virtualNetworkName, IPAddress) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckIPAddressAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckIPAddressAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckIPAddressAvailabilityPreparer prepares the CheckIPAddressAvailability request. -func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "ipAddress": autorest.Encode("query", IPAddress), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckIPAddressAvailabilitySender sends the CheckIPAddressAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) CheckIPAddressAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckIPAddressAvailabilityResponder handles the response to the CheckIPAddressAvailability request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *http.Response) (result IPAddressAvailabilityResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates a virtual network in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// parameters - parameters supplied to the create or update virtual network operation. -func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (result VirtualNetworksCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities.VirtualNetworkCommunity", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworksCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworksDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future VirtualNetworksDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// expand - expands referenced resources. -func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetBastionHosts get a list of bastion hosts accessible from the given network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworksClient) GetBastionHosts(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result BastionHostListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.GetBastionHosts") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetBastionHostsPreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "GetBastionHosts", nil, "Failure preparing request") - return - } - - resp, err := client.GetBastionHostsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "GetBastionHosts", resp, "Failure sending request") - return - } - - result, err = client.GetBastionHostsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "GetBastionHosts", resp, "Failure responding to request") - return - } - - return -} - -// GetBastionHostsPreparer prepares the GetBastionHosts request. -func (client VirtualNetworksClient) GetBastionHostsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/bastionHosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetBastionHostsSender sends the GetBastionHosts request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) GetBastionHostsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetBastionHostsResponder handles the response to the GetBastionHosts request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) GetBastionHostsResponder(resp *http.Response) (result BastionHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual networks in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") - defer func() { - sc := -1 - if result.vnlr.Response.Response != nil { - sc = result.vnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending request") - return - } - - result.vnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to request") - return - } - if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listNextResults(ctx context.Context, lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { - req, err := lastResults.virtualNetworkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all virtual networks in a subscription. -func (client VirtualNetworksClient) ListAll(ctx context.Context) (result VirtualNetworkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListAll") - defer func() { - sc := -1 - if result.vnlr.Response.Response != nil { - sc = result.vnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending request") - return - } - - result.vnlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualNetworksClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListAllResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listAllNextResults(ctx context.Context, lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { - req, err := lastResults.virtualNetworkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListAllComplete(ctx context.Context) (result VirtualNetworkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListUsage lists usage stats. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListUsage") - defer func() { - sc := -1 - if result.vnlur.Response.Response != nil { - sc = result.vnlur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listUsageNextResults - req, err := client.ListUsagePreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageSender(req) - if err != nil { - result.vnlur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure sending request") - return - } - - result.vnlur, err = client.ListUsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to request") - return - } - if result.vnlur.hasNextLink() && result.vnlur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListUsagePreparer prepares the ListUsage request. -func (client VirtualNetworksClient) ListUsagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageSender sends the ListUsage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListUsageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListUsageResponder handles the response to the ListUsage request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListUsageResponder(resp *http.Response) (result VirtualNetworkListUsageResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsageNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listUsageNextResults(ctx context.Context, lastResults VirtualNetworkListUsageResult) (result VirtualNetworkListUsageResult, err error) { - req, err := lastResults.virtualNetworkListUsageResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsageComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListUsageComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListUsage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListUsage(ctx, resourceGroupName, virtualNetworkName) - return -} - -// UpdateTags updates a virtual network tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// parameters - parameters supplied to update virtual network tags. -func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (result VirtualNetwork, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworktaps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworktaps.go deleted file mode 100644 index 6995b88e55bb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworktaps.go +++ /dev/null @@ -1,607 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkTapsClient is the network Client -type VirtualNetworkTapsClient struct { - BaseClient -} - -// NewVirtualNetworkTapsClient creates an instance of the VirtualNetworkTapsClient client. -func NewVirtualNetworkTapsClient(subscriptionID string) VirtualNetworkTapsClient { - return NewVirtualNetworkTapsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkTapsClientWithBaseURI creates an instance of the VirtualNetworkTapsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualNetworkTapsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkTapsClient { - return VirtualNetworkTapsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Virtual Network Tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the virtual network tap. -// parameters - parameters supplied to the create or update virtual network tap operation. -func (client VirtualNetworkTapsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap) (result VirtualNetworkTapsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkTapsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, tapName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkTapsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkTapsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the virtual network tap. -func (client VirtualNetworkTapsClient) Delete(ctx context.Context, resourceGroupName string, tapName string) (result VirtualNetworkTapsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, tapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkTapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, tapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) DeleteSender(req *http.Request) (future VirtualNetworkTapsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified virtual network tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of virtual network tap. -func (client VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string) (result VirtualNetworkTap, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, tapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkTapsClient) GetPreparer(ctx context.Context, resourceGroupName string, tapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) GetResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAll gets all the VirtualNetworkTaps in a subscription. -func (client VirtualNetworkTapsClient) ListAll(ctx context.Context) (result VirtualNetworkTapListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListAll") - defer func() { - sc := -1 - if result.vntlr.Response.Response != nil { - sc = result.vntlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vntlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vntlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualNetworkTapsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) ListAllResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualNetworkTapsClient) listAllNextResults(ctx context.Context, lastResults VirtualNetworkTapListResult) (result VirtualNetworkTapListResult, err error) { - req, err := lastResults.virtualNetworkTapListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkTapsClient) ListAllComplete(ctx context.Context) (result VirtualNetworkTapListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListByResourceGroup gets all the VirtualNetworkTaps in a subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkTapsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualNetworkTapListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vntlr.Response.Response != nil { - sc = result.vntlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vntlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vntlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualNetworkTapsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualNetworkTapsClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualNetworkTapListResult) (result VirtualNetworkTapListResult, err error) { - req, err := lastResults.virtualNetworkTapListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkTapsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkTapListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates an VirtualNetworkTap tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the tap. -// tapParameters - parameters supplied to update VirtualNetworkTap tags. -func (client VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject) (result VirtualNetworkTap, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, tapName, tapParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkTapsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithJSON(tapParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouters.go deleted file mode 100644 index 2c03fbe237c3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouters.go +++ /dev/null @@ -1,511 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualRoutersClient is the network Client -type VirtualRoutersClient struct { - BaseClient -} - -// NewVirtualRoutersClient creates an instance of the VirtualRoutersClient client. -func NewVirtualRoutersClient(subscriptionID string) VirtualRoutersClient { - return NewVirtualRoutersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualRoutersClientWithBaseURI creates an instance of the VirtualRoutersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualRoutersClientWithBaseURI(baseURI string, subscriptionID string) VirtualRoutersClient { - return VirtualRoutersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// parameters - parameters supplied to the create or update Virtual Router. -func (client VirtualRoutersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter) (result VirtualRoutersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualRoutersClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualRouterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualRoutersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) CreateOrUpdateSender(req *http.Request) (future VirtualRoutersCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualRouter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -func (client VirtualRoutersClient) Delete(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRoutersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualRouterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualRoutersClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) DeleteSender(req *http.Request) (future VirtualRoutersDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// expand - expands referenced resources. -func (client VirtualRoutersClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, expand string) (result VirtualRouter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualRouterName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualRoutersClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) GetResponder(resp *http.Response) (result VirtualRouter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the Virtual Routers in a subscription. -func (client VirtualRoutersClient) List(ctx context.Context) (result VirtualRouterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.List") - defer func() { - sc := -1 - if result.vrlr.Response.Response != nil { - sc = result.vrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", resp, "Failure sending request") - return - } - - result.vrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", resp, "Failure responding to request") - return - } - if result.vrlr.hasNextLink() && result.vrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualRoutersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) ListResponder(resp *http.Response) (result VirtualRouterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualRoutersClient) listNextResults(ctx context.Context, lastResults VirtualRouterListResult) (result VirtualRouterListResult, err error) { - req, err := lastResults.virtualRouterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRoutersClient) ListComplete(ctx context.Context) (result VirtualRouterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Virtual Routers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualRoutersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualRouterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vrlr.Response.Response != nil { - sc = result.vrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vrlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.vrlr.hasNextLink() && result.vrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualRoutersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualRouterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualRoutersClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualRouterListResult) (result VirtualRouterListResult, err error) { - req, err := lastResults.virtualRouterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRoutersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualRouterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpngateways.go deleted file mode 100644 index a2fe3adaab10..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpngateways.go +++ /dev/null @@ -1,666 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnGatewaysClient is the network Client -type VpnGatewaysClient struct { - BaseClient -} - -// NewVpnGatewaysClient creates an instance of the VpnGatewaysClient client. -func NewVpnGatewaysClient(subscriptionID string) VpnGatewaysClient { - return NewVpnGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnGatewaysClientWithBaseURI creates an instance of the VpnGatewaysClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VpnGatewaysClient { - return VpnGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// vpnGatewayParameters - parameters supplied to create or Update a virtual wan vpn gateway. -func (client VpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (result VpnGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnGatewayParameters, - Constraints: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VpnGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(vpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VpnGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) GetResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnGateways in a subscription. -func (client VpnGatewaysClient) List(ctx context.Context) (result ListVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.List") - defer func() { - sc := -1 - if result.lvgr.Response.Response != nil { - sc = result.lvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lvgr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ListResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnGatewaysClient) listNextResults(ctx context.Context, lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { - req, err := lastResults.listVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnGatewaysClient) ListComplete(ctx context.Context) (result ListVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VpnGateways in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -func (client VpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvgr.Response.Response != nil { - sc = result.lvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvgr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnGatewaysClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { - req, err := lastResults.listVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnGatewaysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Reset resets the primary of the vpn gateway in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Reset(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGatewaysResetFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Reset") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", nil, "Failure preparing request") - return - } - - result, err = client.ResetSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", nil, "Failure sending request") - return - } - - return -} - -// ResetPreparer prepares the Reset request. -func (client VpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSender sends the Reset request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ResetSender(req *http.Request) (future VpnGatewaysResetFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetResponder handles the response to the Reset request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ResetResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates virtual wan vpn gateway tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// vpnGatewayParameters - parameters supplied to update a virtual wan vpn gateway tags. -func (client VpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (result VpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(vpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnlinkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnlinkconnections.go deleted file mode 100644 index c0163e781fef..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnlinkconnections.go +++ /dev/null @@ -1,152 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnLinkConnectionsClient is the network Client -type VpnLinkConnectionsClient struct { - BaseClient -} - -// NewVpnLinkConnectionsClient creates an instance of the VpnLinkConnectionsClient client. -func NewVpnLinkConnectionsClient(subscriptionID string) VpnLinkConnectionsClient { - return NewVpnLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnLinkConnectionsClientWithBaseURI creates an instance of the VpnLinkConnectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVpnLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnLinkConnectionsClient { - return VpnLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByVpnConnection retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -func (client VpnLinkConnectionsClient) ListByVpnConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.lvslcr.Response.Response != nil { - sc = result.lvslcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnConnectionNextResults - req, err := client.ListByVpnConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.lvslcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure sending request") - return - } - - result.lvslcr, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure responding to request") - return - } - if result.lvslcr.hasNextLink() && result.lvslcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnConnectionPreparer prepares the ListByVpnConnection request. -func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnConnectionSender sends the ListByVpnConnection request. The method will close the -// http.Response Body if it receives an error. -func (client VpnLinkConnectionsClient) ListByVpnConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnConnectionResponder handles the response to the ListByVpnConnection request. The method always -// closes the http.Response Body. -func (client VpnLinkConnectionsClient) ListByVpnConnectionResponder(resp *http.Response) (result ListVpnSiteLinkConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnConnectionNextResults retrieves the next set of results, if any. -func (client VpnLinkConnectionsClient) listByVpnConnectionNextResults(ctx context.Context, lastResults ListVpnSiteLinkConnectionsResult) (result ListVpnSiteLinkConnectionsResult, err error) { - req, err := lastResults.listVpnSiteLinkConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnConnectionComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnLinkConnectionsClient) ListByVpnConnectionComplete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnConnection(ctx, resourceGroupName, gatewayName, connectionName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinkconnections.go deleted file mode 100644 index 90873a61fece..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinkconnections.go +++ /dev/null @@ -1,112 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSiteLinkConnectionsClient is the network Client -type VpnSiteLinkConnectionsClient struct { - BaseClient -} - -// NewVpnSiteLinkConnectionsClient creates an instance of the VpnSiteLinkConnectionsClient client. -func NewVpnSiteLinkConnectionsClient(subscriptionID string) VpnSiteLinkConnectionsClient { - return NewVpnSiteLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSiteLinkConnectionsClientWithBaseURI creates an instance of the VpnSiteLinkConnectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnSiteLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnSiteLinkConnectionsClient { - return VpnSiteLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the details of a vpn site link connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -// linkConnectionName - the name of the vpn connection. -func (client VpnSiteLinkConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnSiteLinkConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinkConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSiteLinkConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "linkConnectionName": autorest.Encode("path", linkConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinkConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSiteLinkConnectionsClient) GetResponder(resp *http.Response) (result VpnSiteLinkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsites.go deleted file mode 100644 index 16cd516906e5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsites.go +++ /dev/null @@ -1,588 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSitesClient is the network Client -type VpnSitesClient struct { - BaseClient -} - -// NewVpnSitesClient creates an instance of the VpnSitesClient client. -func NewVpnSitesClient(subscriptionID string) VpnSitesClient { - return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient { - return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being created or updated. -// vpnSiteParameters - parameters supplied to create or update VpnSite. -func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnSiteParameters, - Constraints: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VpnSitesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnSiteParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithJSON(vpnSiteParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VpnSite. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being deleted. -func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VPN site. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being retrieved. -func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnSites in a subscription. -func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") - defer func() { - sc := -1 - if result.lvsr.Response.Response != nil { - sc = result.lvsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure sending request") - return - } - - result.lvsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") - return - } - if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnSitesClient) listNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { - req, err := lastResults.listVpnSitesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSitesClient) ListComplete(ctx context.Context) (result ListVpnSitesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the vpnSites in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvsr.Response.Response != nil { - sc = result.lvsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvsr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnSitesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { - req, err := lastResults.listVpnSitesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSitesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VpnSite tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being updated. -// vpnSiteParameters - parameters supplied to update VpnSite tags. -func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (result VpnSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithJSON(vpnSiteParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/watchers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/watchers.go deleted file mode 100644 index 37ef90c9b6b8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/watchers.go +++ /dev/null @@ -1,1546 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WatchersClient is the network Client -type WatchersClient struct { - BaseClient -} - -// NewWatchersClient creates an instance of the WatchersClient client. -func NewWatchersClient(subscriptionID string) WatchersClient { - return NewWatchersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWatchersClientWithBaseURI creates an instance of the WatchersClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWatchersClientWithBaseURI(baseURI string, subscriptionID string) WatchersClient { - return WatchersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckConnectivity verifies the possibility of establishing a direct TCP connection from a virtual machine to a given -// endpoint including another VM or an arbitrary remote server. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that determine how the connectivity check will be performed. -func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (result WatchersCheckConnectivityFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.CheckConnectivity") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.Destination", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "CheckConnectivity", err.Error()) - } - - req, err := client.CheckConnectivityPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", nil, "Failure preparing request") - return - } - - result, err = client.CheckConnectivitySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", nil, "Failure sending request") - return - } - - return -} - -// CheckConnectivityPreparer prepares the CheckConnectivity request. -func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckConnectivitySender sends the CheckConnectivity request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future WatchersCheckConnectivityFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckConnectivityResponder handles the response to the CheckConnectivity request. The method always -// closes the http.Response Body. -func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (result ConnectivityInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates a network watcher in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the network watcher resource. -func (client WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network watcher resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -func (client WatchersClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string) (result WatchersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WatchersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network watcher by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -func (client WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WatchersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAzureReachabilityReport nOTE: This feature is currently in preview and still being tested for stability. Gets the -// relative latency score for internet service providers from a specified location to Azure regions. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that determine Azure reachability report configuration. -func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (result WatchersGetAzureReachabilityReportFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetAzureReachabilityReport") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ProviderLocation", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ProviderLocation.Country", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.StartTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetAzureReachabilityReport", err.Error()) - } - - req, err := client.GetAzureReachabilityReportPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", nil, "Failure preparing request") - return - } - - result, err = client.GetAzureReachabilityReportSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", nil, "Failure sending request") - return - } - - return -} - -// GetAzureReachabilityReportPreparer prepares the GetAzureReachabilityReport request. -func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAzureReachabilityReportSender sends the GetAzureReachabilityReport request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) (future WatchersGetAzureReachabilityReportFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetAzureReachabilityReportResponder handles the response to the GetAzureReachabilityReport request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Response) (result AzureReachabilityReport, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetFlowLogStatus queries status of flow log and traffic analytics (optional) on a specified resource. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define a resource to query flow log and traffic analytics (optional) status. -func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (result WatchersGetFlowLogStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetFlowLogStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetFlowLogStatus", err.Error()) - } - - req, err := client.GetFlowLogStatusPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetFlowLogStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", nil, "Failure sending request") - return - } - - return -} - -// GetFlowLogStatusPreparer prepares the GetFlowLogStatus request. -func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFlowLogStatusSender sends the GetFlowLogStatus request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future WatchersGetFlowLogStatusFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetFlowLogStatusResponder handles the response to the GetFlowLogStatus request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (result FlowLogInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetNetworkConfigurationDiagnostic gets Network Configuration Diagnostic data to help customers understand and debug -// network behavior. It provides detailed information on what security rules were applied to a specified traffic flow -// and the result of evaluating these rules. Customers must provide details of a flow like source, destination, -// protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and -// the evaluation results. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters to get network configuration diagnostic. -func (client WatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters) (result WatchersGetNetworkConfigurationDiagnosticFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNetworkConfigurationDiagnostic") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Profiles", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetNetworkConfigurationDiagnostic", err.Error()) - } - - req, err := client.GetNetworkConfigurationDiagnosticPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", nil, "Failure preparing request") - return - } - - result, err = client.GetNetworkConfigurationDiagnosticSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", nil, "Failure sending request") - return - } - - return -} - -// GetNetworkConfigurationDiagnosticPreparer prepares the GetNetworkConfigurationDiagnostic request. -func (client WatchersClient) GetNetworkConfigurationDiagnosticPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNetworkConfigurationDiagnosticSender sends the GetNetworkConfigurationDiagnostic request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetNetworkConfigurationDiagnosticSender(req *http.Request) (future WatchersGetNetworkConfigurationDiagnosticFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetNetworkConfigurationDiagnosticResponder handles the response to the GetNetworkConfigurationDiagnostic request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetNetworkConfigurationDiagnosticResponder(resp *http.Response) (result ConfigurationDiagnosticResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetNextHop gets the next hop from the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the source and destination endpoint. -func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters) (result WatchersGetNextHopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNextHop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SourceIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DestinationIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetNextHop", err.Error()) - } - - req, err := client.GetNextHopPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", nil, "Failure preparing request") - return - } - - result, err = client.GetNextHopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", nil, "Failure sending request") - return - } - - return -} - -// GetNextHopPreparer prepares the GetNextHop request. -func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNextHopSender sends the GetNextHop request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetNextHopSender(req *http.Request) (future WatchersGetNextHopFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetNextHopResponder handles the response to the GetNextHop request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result NextHopResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTopology gets the current network topology by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the representation of topology. -func (client WatchersClient) GetTopology(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (result Topology, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTopology") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetTopologyPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", nil, "Failure preparing request") - return - } - - resp, err := client.GetTopologySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", resp, "Failure sending request") - return - } - - result, err = client.GetTopologyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", resp, "Failure responding to request") - return - } - - return -} - -// GetTopologyPreparer prepares the GetTopology request. -func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTopologySender sends the GetTopology request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTopologySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetTopologyResponder handles the response to the GetTopology request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result Topology, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTroubleshooting initiate troubleshooting on a specified resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the resource to troubleshoot. -func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (result WatchersGetTroubleshootingFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshooting") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TroubleshootingProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.TroubleshootingProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TroubleshootingProperties.StoragePath", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetTroubleshooting", err.Error()) - } - - req, err := client.GetTroubleshootingPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", nil, "Failure preparing request") - return - } - - result, err = client.GetTroubleshootingSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", nil, "Failure sending request") - return - } - - return -} - -// GetTroubleshootingPreparer prepares the GetTroubleshooting request. -func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTroubleshootingSender sends the GetTroubleshooting request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future WatchersGetTroubleshootingFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetTroubleshootingResponder handles the response to the GetTroubleshooting request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (result TroubleshootingResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTroubleshootingResult get the last completed troubleshooting result on a specified resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the resource to query the troubleshooting result. -func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (result WatchersGetTroubleshootingResultFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshootingResult") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetTroubleshootingResult", err.Error()) - } - - req, err := client.GetTroubleshootingResultPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", nil, "Failure preparing request") - return - } - - result, err = client.GetTroubleshootingResultSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", nil, "Failure sending request") - return - } - - return -} - -// GetTroubleshootingResultPreparer prepares the GetTroubleshootingResult request. -func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTroubleshootingResultSender sends the GetTroubleshootingResult request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) (future WatchersGetTroubleshootingResultFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetTroubleshootingResultResponder handles the response to the GetTroubleshootingResult request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Response) (result TroubleshootingResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVMSecurityRules gets the configured and effective security group rules on the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the VM to check security groups for. -func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters) (result WatchersGetVMSecurityRulesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetVMSecurityRules") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetVMSecurityRules", err.Error()) - } - - req, err := client.GetVMSecurityRulesPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", nil, "Failure preparing request") - return - } - - result, err = client.GetVMSecurityRulesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", nil, "Failure sending request") - return - } - - return -} - -// GetVMSecurityRulesPreparer prepares the GetVMSecurityRules request. -func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVMSecurityRulesSender sends the GetVMSecurityRules request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future WatchersGetVMSecurityRulesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVMSecurityRulesResponder handles the response to the GetVMSecurityRules request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetVMSecurityRulesResponder(resp *http.Response) (result SecurityGroupViewResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network watchers by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client WatchersClient) List(ctx context.Context, resourceGroupName string) (result WatcherListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WatchersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListResponder(resp *http.Response) (result WatcherListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAll gets all network watchers by subscription. -func (client WatchersClient) ListAll(ctx context.Context) (result WatcherListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.ListAll") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", resp, "Failure sending request") - return - } - - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", resp, "Failure responding to request") - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client WatchersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListAllResponder(resp *http.Response) (result WatcherListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableProviders nOTE: This feature is currently in preview and still being tested for stability. Lists all -// available internet service providers for a specified Azure region. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that scope the list of available providers. -func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (result WatchersListAvailableProvidersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.ListAvailableProviders") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableProvidersPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", nil, "Failure preparing request") - return - } - - result, err = client.ListAvailableProvidersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", nil, "Failure sending request") - return - } - - return -} - -// ListAvailableProvidersPreparer prepares the ListAvailableProviders request. -func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableProvidersSender sends the ListAvailableProviders request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (future WatchersListAvailableProvidersFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListAvailableProvidersResponder handles the response to the ListAvailableProviders request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response) (result AvailableProvidersList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetFlowLogConfiguration configures flow log and traffic analytics (optional) on a specified resource. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the configuration of flow log. -func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (result WatchersSetFlowLogConfigurationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.SetFlowLogConfiguration") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FlowLogProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "SetFlowLogConfiguration", err.Error()) - } - - req, err := client.SetFlowLogConfigurationPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", nil, "Failure preparing request") - return - } - - result, err = client.SetFlowLogConfigurationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", nil, "Failure sending request") - return - } - - return -} - -// SetFlowLogConfigurationPreparer prepares the SetFlowLogConfiguration request. -func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetFlowLogConfigurationSender sends the SetFlowLogConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (future WatchersSetFlowLogConfigurationFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetFlowLogConfigurationResponder handles the response to the SetFlowLogConfiguration request. The method always -// closes the http.Response Body. -func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Response) (result FlowLogInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a network watcher tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters supplied to update network watcher tags. -func (client WatchersClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client WatchersClient) UpdateTagsResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// VerifyIPFlow verify IP flow from the specified VM to a location given the currently configured NSG rules. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the IP flow to be verified. -func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters) (result WatchersVerifyIPFlowFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.VerifyIPFlow") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.LocalPort", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RemotePort", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.LocalIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RemoteIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "VerifyIPFlow", err.Error()) - } - - req, err := client.VerifyIPFlowPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", nil, "Failure preparing request") - return - } - - result, err = client.VerifyIPFlowSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", nil, "Failure sending request") - return - } - - return -} - -// VerifyIPFlowPreparer prepares the VerifyIPFlow request. -func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// VerifyIPFlowSender sends the VerifyIPFlow request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future WatchersVerifyIPFlowFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// VerifyIPFlowResponder handles the response to the VerifyIPFlow request. The method always -// closes the http.Response Body. -func (client WatchersClient) VerifyIPFlowResponder(resp *http.Response) (result VerificationIPFlowResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/webapplicationfirewallpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/webapplicationfirewallpolicies.go deleted file mode 100644 index 963f5900ba9b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/webapplicationfirewallpolicies.go +++ /dev/null @@ -1,526 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WebApplicationFirewallPoliciesClient is the network Client -type WebApplicationFirewallPoliciesClient struct { - BaseClient -} - -// NewWebApplicationFirewallPoliciesClient creates an instance of the WebApplicationFirewallPoliciesClient client. -func NewWebApplicationFirewallPoliciesClient(subscriptionID string) WebApplicationFirewallPoliciesClient { - return NewWebApplicationFirewallPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWebApplicationFirewallPoliciesClientWithBaseURI creates an instance of the WebApplicationFirewallPoliciesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewWebApplicationFirewallPoliciesClientWithBaseURI(baseURI string, subscriptionID string) WebApplicationFirewallPoliciesClient { - return WebApplicationFirewallPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or update policy with specified rule set name within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -// parameters - policy to be created. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (result WebApplicationFirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}, - }}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules.ManagedRuleSets", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, policyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -func (client WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WebApplicationFirewallPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) DeleteSender(req *http.Request) (future WebApplicationFirewallPoliciesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve protection policy with specified name within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -func (client WebApplicationFirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WebApplicationFirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the protection policies within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client WebApplicationFirewallPoliciesClient) List(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.wafplr.Response.Response != nil { - sc = result.wafplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.wafplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.wafplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WebApplicationFirewallPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client WebApplicationFirewallPoliciesClient) listNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyListResult) (result WebApplicationFirewallPolicyListResult, err error) { - req, err := lastResults.webApplicationFirewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebApplicationFirewallPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the WAF policies in a subscription. -func (client WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context) (result WebApplicationFirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.wafplr.Response.Response != nil { - sc = result.wafplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.wafplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure sending request") - return - } - - result.wafplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client WebApplicationFirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) ListAllResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client WebApplicationFirewallPoliciesClient) listAllNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyListResult) (result WebApplicationFirewallPolicyListResult, err error) { - req, err := lastResults.webApplicationFirewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebApplicationFirewallPoliciesClient) ListAllComplete(ctx context.Context) (result WebApplicationFirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivateendpointconnections.go deleted file mode 100644 index 6b6d202d0d76..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivateendpointconnections.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayPrivateEndpointConnectionsClient is the network Client -type ApplicationGatewayPrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewApplicationGatewayPrivateEndpointConnectionsClient creates an instance of the -// ApplicationGatewayPrivateEndpointConnectionsClient client. -func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string) ApplicationGatewayPrivateEndpointConnectionsClient { - return NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI creates an instance of the -// ApplicationGatewayPrivateEndpointConnectionsClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayPrivateEndpointConnectionsClient { - return ApplicationGatewayPrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (result ApplicationGatewayPrivateEndpointConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future ApplicationGatewayPrivateEndpointConnectionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (result ApplicationGatewayPrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all private endpoint connections on an application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.List") - defer func() { - sc := -1 - if result.agpeclr.Response.Response != nil { - sc = result.agpeclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.agpeclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.agpeclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.agpeclr.hasNextLink() && result.agpeclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayPrivateEndpointConnectionListResult) (result ApplicationGatewayPrivateEndpointConnectionListResult, err error) { - req, err := lastResults.applicationGatewayPrivateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, applicationGatewayName) - return -} - -// Update updates the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -// parameters - parameters supplied to update application gateway private endpoint connection operation. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection) (result ApplicationGatewayPrivateEndpointConnectionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", nil, "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdateSender(req *http.Request) (future ApplicationGatewayPrivateEndpointConnectionsUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgateways.go deleted file mode 100644 index 0702a5f99478..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgateways.go +++ /dev/null @@ -1,1468 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewaysClient is the network Client -type ApplicationGatewaysClient struct { - BaseClient -} - -// NewApplicationGatewaysClient creates an instance of the ApplicationGatewaysClient client. -func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient { - return NewApplicationGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewaysClientWithBaseURI creates an instance of the ApplicationGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewaysClient { - return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// BackendHealth gets the backend health of the specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// expand - expands BackendAddressPool and BackendHttpSettings referenced in backend health. -func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (result ApplicationGatewaysBackendHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.BackendHealthPreparer(ctx, resourceGroupName, applicationGatewayName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", nil, "Failure preparing request") - return - } - - result, err = client.BackendHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", nil, "Failure sending request") - return - } - - return -} - -// BackendHealthPreparer prepares the BackendHealth request. -func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BackendHealthSender sends the BackendHealth request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) (future ApplicationGatewaysBackendHealthFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// BackendHealthResponder handles the response to the BackendHealth request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Response) (result ApplicationGatewayBackendHealth, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// BackendHealthOnDemand gets the backend health for given combination of backend pool and http setting of the -// specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// probeRequest - request body for on-demand test probe operation. -// expand - expands BackendAddressPool and BackendHttpSettings referenced in backend health. -func (client ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, expand string) (result ApplicationGatewaysBackendHealthOnDemandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealthOnDemand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.BackendHealthOnDemandPreparer(ctx, resourceGroupName, applicationGatewayName, probeRequest, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", nil, "Failure preparing request") - return - } - - result, err = client.BackendHealthOnDemandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", nil, "Failure sending request") - return - } - - return -} - -// BackendHealthOnDemandPreparer prepares the BackendHealthOnDemand request. -func (client ApplicationGatewaysClient) BackendHealthOnDemandPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand", pathParameters), - autorest.WithJSON(probeRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BackendHealthOnDemandSender sends the BackendHealthOnDemand request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) BackendHealthOnDemandSender(req *http.Request) (future ApplicationGatewaysBackendHealthOnDemandFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// BackendHealthOnDemandResponder handles the response to the BackendHealthOnDemand request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) BackendHealthOnDemandResponder(resp *http.Response) (result ApplicationGatewayBackendHealthOnDemand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// parameters - parameters supplied to the create or update application gateway operation. -func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (result ApplicationGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.FileUploadLimitInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.FileUploadLimitInMb", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MinCapacity", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MinCapacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MaxCapacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MaxCapacity", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ApplicationGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ApplicationGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future ApplicationGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSslPredefinedPolicy gets Ssl predefined policy with the specified policy name. -// Parameters: -// predefinedPolicyName - name of Ssl predefined policy. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Context, predefinedPolicyName string) (result ApplicationGatewaySslPredefinedPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.GetSslPredefinedPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetSslPredefinedPolicyPreparer(ctx, predefinedPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.GetSslPredefinedPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure sending request") - return - } - - result, err = client.GetSslPredefinedPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure responding to request") - return - } - - return -} - -// GetSslPredefinedPolicyPreparer prepares the GetSslPredefinedPolicy request. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(ctx context.Context, predefinedPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "predefinedPolicyName": autorest.Encode("path", predefinedPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSslPredefinedPolicySender sends the GetSslPredefinedPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetSslPredefinedPolicyResponder handles the response to the GetSslPredefinedPolicy request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *http.Response) (result ApplicationGatewaySslPredefinedPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all application gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ApplicationGatewaysClient) List(ctx context.Context, resourceGroupName string) (result ApplicationGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.List") - defer func() { - sc := -1 - if result.aglr.Response.Response != nil { - sc = result.aglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.aglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.aglr.hasNextLink() && result.aglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { - req, err := lastResults.applicationGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result ApplicationGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the application gateways in a subscription. -func (client ApplicationGatewaysClient) ListAll(ctx context.Context) (result ApplicationGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.aglr.Response.Response != nil { - sc = result.aglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.aglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending request") - return - } - - result.aglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to request") - return - } - if result.aglr.hasNextLink() && result.aglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ApplicationGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAllResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listAllNextResults(ctx context.Context, lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { - req, err := lastResults.applicationGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListAllComplete(ctx context.Context) (result ApplicationGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListAvailableRequestHeaders lists all available request headers. -func (client ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableRequestHeaders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableRequestHeadersPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableRequestHeadersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableRequestHeadersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableRequestHeadersPreparer prepares the ListAvailableRequestHeaders request. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableRequestHeadersSender sends the ListAvailableRequestHeaders request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableRequestHeadersResponder handles the response to the ListAvailableRequestHeaders request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableResponseHeaders lists all available response headers. -func (client ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableResponseHeaders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableResponseHeadersPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableResponseHeadersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableResponseHeadersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableResponseHeadersPreparer prepares the ListAvailableResponseHeaders request. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableResponseHeadersSender sends the ListAvailableResponseHeaders request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableResponseHeadersResponder handles the response to the ListAvailableResponseHeaders request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableServerVariables lists all available server variables. -func (client ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableServerVariables") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableServerVariablesPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableServerVariablesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableServerVariablesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableServerVariablesPreparer prepares the ListAvailableServerVariables request. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableServerVariablesSender sends the ListAvailableServerVariables request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableServerVariablesResponder handles the response to the ListAvailableServerVariables request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableSslOptions lists available Ssl options for configuring Ssl policy. -func (client ApplicationGatewaysClient) ListAvailableSslOptions(ctx context.Context) (result ApplicationGatewayAvailableSslOptions, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslOptions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSslOptionsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSslOptionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSslOptionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSslOptionsPreparer prepares the ListAvailableSslOptions request. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSslOptionsSender sends the ListAvailableSslOptions request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSslOptionsResponder handles the response to the ListAvailableSslOptions request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsResponder(resp *http.Response) (result ApplicationGatewayAvailableSslOptions, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableSslPredefinedPolicies lists all SSL predefined policies for configuring Ssl policy. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx context.Context) (result ApplicationGatewayAvailableSslPredefinedPoliciesPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies") - defer func() { - sc := -1 - if result.agaspp.Response.Response != nil { - sc = result.agaspp.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAvailableSslPredefinedPoliciesNextResults - req, err := client.ListAvailableSslPredefinedPoliciesPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) - if err != nil { - result.agaspp.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure sending request") - return - } - - result.agaspp, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to request") - return - } - if result.agaspp.hasNextLink() && result.agaspp.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAvailableSslPredefinedPoliciesPreparer prepares the ListAvailableSslPredefinedPolicies request. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSslPredefinedPoliciesSender sends the ListAvailableSslPredefinedPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSslPredefinedPoliciesResponder handles the response to the ListAvailableSslPredefinedPolicies request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesResponder(resp *http.Response) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAvailableSslPredefinedPoliciesNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listAvailableSslPredefinedPoliciesNextResults(ctx context.Context, lastResults ApplicationGatewayAvailableSslPredefinedPolicies) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { - req, err := lastResults.applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAvailableSslPredefinedPoliciesComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesComplete(ctx context.Context) (result ApplicationGatewayAvailableSslPredefinedPoliciesIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAvailableSslPredefinedPolicies(ctx) - return -} - -// ListAvailableWafRuleSets lists all available web application firewall rule sets. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableWafRuleSets") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableWafRuleSetsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableWafRuleSetsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableWafRuleSetsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableWafRuleSetsPreparer prepares the ListAvailableWafRuleSets request. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableWafRuleSetsSender sends the ListAvailableWafRuleSets request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableWafRuleSetsResponder handles the response to the ListAvailableWafRuleSets request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp *http.Response) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start starts the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", nil, "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future ApplicationGatewaysStartFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stops the specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", nil, "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future ApplicationGatewaysStopFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UpdateTags updates the specified application gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// parameters - parameters supplied to update application gateway tags. -func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (result ApplicationGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationsecuritygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationsecuritygroups.go deleted file mode 100644 index 5bf49666d2f7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationsecuritygroups.go +++ /dev/null @@ -1,575 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationSecurityGroupsClient is the network Client -type ApplicationSecurityGroupsClient struct { - BaseClient -} - -// NewApplicationSecurityGroupsClient creates an instance of the ApplicationSecurityGroupsClient client. -func NewApplicationSecurityGroupsClient(subscriptionID string) ApplicationSecurityGroupsClient { - return NewApplicationSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationSecurityGroupsClientWithBaseURI creates an instance of the ApplicationSecurityGroupsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewApplicationSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationSecurityGroupsClient { - return ApplicationSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -// parameters - parameters supplied to the create or update ApplicationSecurityGroup operation. -func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (result ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (future ApplicationSecurityGroupsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -func (client ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationSecurityGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the application security groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.List") - defer func() { - sc := -1 - if result.asglr.Response.Response != nil { - sc = result.asglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.asglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure sending request") - return - } - - result.asglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.asglr.hasNextLink() && result.asglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationSecurityGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) ListResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationSecurityGroupsClient) listNextResults(ctx context.Context, lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { - req, err := lastResults.applicationSecurityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationSecurityGroupsClient) ListComplete(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all application security groups in a subscription. -func (client ApplicationSecurityGroupsClient) ListAll(ctx context.Context) (result ApplicationSecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.asglr.Response.Response != nil { - sc = result.asglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.asglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure sending request") - return - } - - result.asglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.asglr.hasNextLink() && result.asglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ApplicationSecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) ListAllResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ApplicationSecurityGroupsClient) listAllNextResults(ctx context.Context, lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { - req, err := lastResults.applicationSecurityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationSecurityGroupsClient) ListAllComplete(ctx context.Context) (result ApplicationSecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates an application security group's tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -// parameters - parameters supplied to update application security group tags. -func (client ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject) (result ApplicationSecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ApplicationSecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availabledelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availabledelegations.go deleted file mode 100644 index 1882d9af5dde..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availabledelegations.go +++ /dev/null @@ -1,148 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableDelegationsClient is the network Client -type AvailableDelegationsClient struct { - BaseClient -} - -// NewAvailableDelegationsClient creates an instance of the AvailableDelegationsClient client. -func NewAvailableDelegationsClient(subscriptionID string) AvailableDelegationsClient { - return NewAvailableDelegationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableDelegationsClientWithBaseURI creates an instance of the AvailableDelegationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailableDelegationsClientWithBaseURI(baseURI string, subscriptionID string) AvailableDelegationsClient { - return AvailableDelegationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all of the available subnet delegations for this subscription in this region. -// Parameters: -// location - the location of the subnet. -func (client AvailableDelegationsClient) List(ctx context.Context, location string) (result AvailableDelegationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsClient.List") - defer func() { - sc := -1 - if result.adr.Response.Response != nil { - sc = result.adr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.adr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure sending request") - return - } - - result.adr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure responding to request") - return - } - if result.adr.hasNextLink() && result.adr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableDelegationsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableDelegationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableDelegationsClient) listNextResults(ctx context.Context, lastResults AvailableDelegationsResult) (result AvailableDelegationsResult, err error) { - req, err := lastResults.availableDelegationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableDelegationsClient) ListComplete(ctx context.Context, location string) (result AvailableDelegationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableendpointservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableendpointservices.go deleted file mode 100644 index bbffdc801539..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableendpointservices.go +++ /dev/null @@ -1,148 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableEndpointServicesClient is the network Client -type AvailableEndpointServicesClient struct { - BaseClient -} - -// NewAvailableEndpointServicesClient creates an instance of the AvailableEndpointServicesClient client. -func NewAvailableEndpointServicesClient(subscriptionID string) AvailableEndpointServicesClient { - return NewAvailableEndpointServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableEndpointServicesClientWithBaseURI creates an instance of the AvailableEndpointServicesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewAvailableEndpointServicesClientWithBaseURI(baseURI string, subscriptionID string) AvailableEndpointServicesClient { - return AvailableEndpointServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list what values of endpoint services are available for use. -// Parameters: -// location - the location to check available endpoint services. -func (client AvailableEndpointServicesClient) List(ctx context.Context, location string) (result EndpointServicesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableEndpointServicesClient.List") - defer func() { - sc := -1 - if result.eslr.Response.Response != nil { - sc = result.eslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.eslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure sending request") - return - } - - result.eslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to request") - return - } - if result.eslr.hasNextLink() && result.eslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableEndpointServicesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableEndpointServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableEndpointServicesClient) ListResponder(resp *http.Response) (result EndpointServicesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableEndpointServicesClient) listNextResults(ctx context.Context, lastResults EndpointServicesListResult) (result EndpointServicesListResult, err error) { - req, err := lastResults.endpointServicesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableEndpointServicesClient) ListComplete(ctx context.Context, location string) (result EndpointServicesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableEndpointServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableprivateendpointtypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableprivateendpointtypes.go deleted file mode 100644 index d2a95fe79cb3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableprivateendpointtypes.go +++ /dev/null @@ -1,267 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailablePrivateEndpointTypesClient is the network Client -type AvailablePrivateEndpointTypesClient struct { - BaseClient -} - -// NewAvailablePrivateEndpointTypesClient creates an instance of the AvailablePrivateEndpointTypesClient client. -func NewAvailablePrivateEndpointTypesClient(subscriptionID string) AvailablePrivateEndpointTypesClient { - return NewAvailablePrivateEndpointTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailablePrivateEndpointTypesClientWithBaseURI creates an instance of the AvailablePrivateEndpointTypesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewAvailablePrivateEndpointTypesClientWithBaseURI(baseURI string, subscriptionID string) AvailablePrivateEndpointTypesClient { - return AvailablePrivateEndpointTypesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. -// Parameters: -// location - the location of the domain name. -func (client AvailablePrivateEndpointTypesClient) List(ctx context.Context, location string) (result AvailablePrivateEndpointTypesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.List") - defer func() { - sc := -1 - if result.apetr.Response.Response != nil { - sc = result.apetr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.apetr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", resp, "Failure sending request") - return - } - - result.apetr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", resp, "Failure responding to request") - return - } - if result.apetr.hasNextLink() && result.apetr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailablePrivateEndpointTypesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailablePrivateEndpointTypesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailablePrivateEndpointTypesClient) ListResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailablePrivateEndpointTypesClient) listNextResults(ctx context.Context, lastResults AvailablePrivateEndpointTypesResult) (result AvailablePrivateEndpointTypesResult, err error) { - req, err := lastResults.availablePrivateEndpointTypesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailablePrivateEndpointTypesClient) ListComplete(ctx context.Context, location string) (result AvailablePrivateEndpointTypesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByResourceGroup returns all of the resource types that can be linked to a Private Endpoint in this subscription -// in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroup(ctx context.Context, location string, resourceGroupName string) (result AvailablePrivateEndpointTypesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.apetr.Response.Response != nil { - sc = result.apetr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.apetr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.apetr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.apetr.hasNextLink() && result.apetr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AvailablePrivateEndpointTypesClient) listByResourceGroupNextResults(ctx context.Context, lastResults AvailablePrivateEndpointTypesResult) (result AvailablePrivateEndpointTypesResult, err error) { - req, err := lastResults.availablePrivateEndpointTypesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupComplete(ctx context.Context, location string, resourceGroupName string) (result AvailablePrivateEndpointTypesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, location, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableresourcegroupdelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableresourcegroupdelegations.go deleted file mode 100644 index fca88257c233..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableresourcegroupdelegations.go +++ /dev/null @@ -1,151 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableResourceGroupDelegationsClient is the network Client -type AvailableResourceGroupDelegationsClient struct { - BaseClient -} - -// NewAvailableResourceGroupDelegationsClient creates an instance of the AvailableResourceGroupDelegationsClient -// client. -func NewAvailableResourceGroupDelegationsClient(subscriptionID string) AvailableResourceGroupDelegationsClient { - return NewAvailableResourceGroupDelegationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableResourceGroupDelegationsClientWithBaseURI creates an instance of the -// AvailableResourceGroupDelegationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAvailableResourceGroupDelegationsClientWithBaseURI(baseURI string, subscriptionID string) AvailableResourceGroupDelegationsClient { - return AvailableResourceGroupDelegationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all of the available subnet delegations for this resource group in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client AvailableResourceGroupDelegationsClient) List(ctx context.Context, location string, resourceGroupName string) (result AvailableDelegationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableResourceGroupDelegationsClient.List") - defer func() { - sc := -1 - if result.adr.Response.Response != nil { - sc = result.adr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.adr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure sending request") - return - } - - result.adr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure responding to request") - return - } - if result.adr.hasNextLink() && result.adr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableResourceGroupDelegationsClient) ListPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableResourceGroupDelegationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableResourceGroupDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableResourceGroupDelegationsClient) listNextResults(ctx context.Context, lastResults AvailableDelegationsResult) (result AvailableDelegationsResult, err error) { - req, err := lastResults.availableDelegationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableResourceGroupDelegationsClient) ListComplete(ctx context.Context, location string, resourceGroupName string) (result AvailableDelegationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableResourceGroupDelegationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableservicealiases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableservicealiases.go deleted file mode 100644 index 0dc0209064e1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/availableservicealiases.go +++ /dev/null @@ -1,266 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableServiceAliasesClient is the network Client -type AvailableServiceAliasesClient struct { - BaseClient -} - -// NewAvailableServiceAliasesClient creates an instance of the AvailableServiceAliasesClient client. -func NewAvailableServiceAliasesClient(subscriptionID string) AvailableServiceAliasesClient { - return NewAvailableServiceAliasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableServiceAliasesClientWithBaseURI creates an instance of the AvailableServiceAliasesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewAvailableServiceAliasesClientWithBaseURI(baseURI string, subscriptionID string) AvailableServiceAliasesClient { - return AvailableServiceAliasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all available service aliases for this subscription in this region. -// Parameters: -// location - the location. -func (client AvailableServiceAliasesClient) List(ctx context.Context, location string) (result AvailableServiceAliasesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.List") - defer func() { - sc := -1 - if result.asar.Response.Response != nil { - sc = result.asar.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.asar.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", resp, "Failure sending request") - return - } - - result.asar, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", resp, "Failure responding to request") - return - } - if result.asar.hasNextLink() && result.asar.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableServiceAliasesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableServiceAliasesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableServiceAliasesClient) ListResponder(resp *http.Response) (result AvailableServiceAliasesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableServiceAliasesClient) listNextResults(ctx context.Context, lastResults AvailableServiceAliasesResult) (result AvailableServiceAliasesResult, err error) { - req, err := lastResults.availableServiceAliasesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableServiceAliasesClient) ListComplete(ctx context.Context, location string) (result AvailableServiceAliasesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByResourceGroup gets all available service aliases for this resource group in this region. -// Parameters: -// resourceGroupName - the name of the resource group. -// location - the location. -func (client AvailableServiceAliasesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, location string) (result AvailableServiceAliasesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.asar.Response.Response != nil { - sc = result.asar.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.asar.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.asar, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.asar.hasNextLink() && result.asar.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AvailableServiceAliasesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableServiceAliasesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AvailableServiceAliasesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailableServiceAliasesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AvailableServiceAliasesClient) listByResourceGroupNextResults(ctx context.Context, lastResults AvailableServiceAliasesResult) (result AvailableServiceAliasesResult, err error) { - req, err := lastResults.availableServiceAliasesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableServiceAliasesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, location string) (result AvailableServiceAliasesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/client.go deleted file mode 100644 index 2be4a6812a0c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/client.go +++ /dev/null @@ -1,843 +0,0 @@ -// Package network implements the Azure ARM Network service API version . -// -// Network Client -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -const ( - // DefaultBaseURI is the default URI used for the service Network - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Network. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} - -// CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use. -// Parameters: -// location - the location of the domain name. -// domainNameLabel - the domain name to be verified. It must conform to the following regular expression: -// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. -func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckDNSNameAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckDNSNameAvailabilityPreparer(ctx, location, domainNameLabel) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckDNSNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckDNSNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckDNSNameAvailabilityPreparer prepares the CheckDNSNameAvailability request. -func (client BaseClient) CheckDNSNameAvailabilityPreparer(ctx context.Context, location string, domainNameLabel string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "domainNameLabel": autorest.Encode("query", domainNameLabel), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckDNSNameAvailabilitySender sends the CheckDNSNameAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) CheckDNSNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckDNSNameAvailabilityResponder handles the response to the CheckDNSNameAvailability request. The method always -// closes the http.Response Body. -func (client BaseClient) CheckDNSNameAvailabilityResponder(resp *http.Response) (result DNSNameAvailabilityResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DeleteBastionShareableLink deletes the Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) DeleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result DeleteBastionShareableLinkFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBastionShareableLink") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DeleteBastionShareableLink", nil, "Failure preparing request") - return - } - - result, err = client.DeleteBastionShareableLinkSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DeleteBastionShareableLink", nil, "Failure sending request") - return - } - - return -} - -// DeleteBastionShareableLinkPreparer prepares the DeleteBastionShareableLink request. -func (client BaseClient) DeleteBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteBastionShareableLinkSender sends the DeleteBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) DeleteBastionShareableLinkSender(req *http.Request) (future DeleteBastionShareableLinkFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteBastionShareableLinkResponder handles the response to the DeleteBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) DeleteBastionShareableLinkResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectActiveSessions returns the list of currently active sessions on the Bastion. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// sessionIds - the list of sessionids to disconnect. -func (client BaseClient) DisconnectActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (result BastionSessionDeleteResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisconnectActiveSessions") - defer func() { - sc := -1 - if result.bsdr.Response.Response != nil { - sc = result.bsdr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.disconnectActiveSessionsNextResults - req, err := client.DisconnectActiveSessionsPreparer(ctx, resourceGroupName, bastionHostName, sessionIds) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", nil, "Failure preparing request") - return - } - - resp, err := client.DisconnectActiveSessionsSender(req) - if err != nil { - result.bsdr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", resp, "Failure sending request") - return - } - - result.bsdr, err = client.DisconnectActiveSessionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", resp, "Failure responding to request") - return - } - if result.bsdr.hasNextLink() && result.bsdr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// DisconnectActiveSessionsPreparer prepares the DisconnectActiveSessions request. -func (client BaseClient) DisconnectActiveSessionsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions", pathParameters), - autorest.WithJSON(sessionIds), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectActiveSessionsSender sends the DisconnectActiveSessions request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) DisconnectActiveSessionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DisconnectActiveSessionsResponder handles the response to the DisconnectActiveSessions request. The method always -// closes the http.Response Body. -func (client BaseClient) DisconnectActiveSessionsResponder(resp *http.Response) (result BastionSessionDeleteResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// disconnectActiveSessionsNextResults retrieves the next set of results, if any. -func (client BaseClient) disconnectActiveSessionsNextResults(ctx context.Context, lastResults BastionSessionDeleteResult) (result BastionSessionDeleteResult, err error) { - req, err := lastResults.bastionSessionDeleteResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.DisconnectActiveSessionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", resp, "Failure sending next results request") - } - result, err = client.DisconnectActiveSessionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// DisconnectActiveSessionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) DisconnectActiveSessionsComplete(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (result BastionSessionDeleteResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisconnectActiveSessions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.DisconnectActiveSessions(ctx, resourceGroupName, bastionHostName, sessionIds) - return -} - -// Generatevirtualwanvpnserverconfigurationvpnprofile generates a unique VPN profile for P2S clients for VirtualWan and -// associated VpnServerConfiguration combination in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN whose associated VpnServerConfigurations is needed. -// vpnClientParams - parameters supplied to the generate VirtualWan VPN profile generation operation. -func (client BaseClient) Generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVpnProfileParameters) (result GeneratevirtualwanvpnserverconfigurationvpnprofileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Generatevirtualwanvpnserverconfigurationvpnprofile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer(ctx, resourceGroupName, virtualWANName, vpnClientParams) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "Generatevirtualwanvpnserverconfigurationvpnprofile", nil, "Failure preparing request") - return - } - - result, err = client.GeneratevirtualwanvpnserverconfigurationvpnprofileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "Generatevirtualwanvpnserverconfigurationvpnprofile", nil, "Failure sending request") - return - } - - return -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer prepares the Generatevirtualwanvpnserverconfigurationvpnprofile request. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVpnProfileParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile", pathParameters), - autorest.WithJSON(vpnClientParams), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileSender sends the Generatevirtualwanvpnserverconfigurationvpnprofile request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofileSender(req *http.Request) (future GeneratevirtualwanvpnserverconfigurationvpnprofileFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileResponder handles the response to the Generatevirtualwanvpnserverconfigurationvpnprofile request. The method always -// closes the http.Response Body. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofileResponder(resp *http.Response) (result VpnProfileResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetActiveSessions returns the list of currently active sessions on the Bastion. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BaseClient) GetActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string) (result GetActiveSessionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetActiveSessions") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetActiveSessionsPreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetActiveSessions", nil, "Failure preparing request") - return - } - - result, err = client.GetActiveSessionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetActiveSessions", nil, "Failure sending request") - return - } - - return -} - -// GetActiveSessionsPreparer prepares the GetActiveSessions request. -func (client BaseClient) GetActiveSessionsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetActiveSessionsSender sends the GetActiveSessions request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetActiveSessionsSender(req *http.Request) (future GetActiveSessionsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetActiveSessionsResponder handles the response to the GetActiveSessions request. The method always -// closes the http.Response Body. -func (client BaseClient) GetActiveSessionsResponder(resp *http.Response) (result BastionActiveSessionListResultPage, err error) { - result.baslr, err = client.getActiveSessionsResponder(resp) - result.fn = client.getActiveSessionsNextResults - return -} - -func (client BaseClient) getActiveSessionsResponder(resp *http.Response) (result BastionActiveSessionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getActiveSessionsNextResults retrieves the next set of results, if any. -func (client BaseClient) getActiveSessionsNextResults(ctx context.Context, lastResults BastionActiveSessionListResult) (result BastionActiveSessionListResult, err error) { - req, err := lastResults.bastionActiveSessionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getActiveSessionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getActiveSessionsNextResults", resp, "Failure sending next results request") - } - return client.getActiveSessionsResponder(resp) -} - -// GetActiveSessionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetActiveSessionsComplete(ctx context.Context, resourceGroupName string, bastionHostName string) (result GetActiveSessionsAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetActiveSessions") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - var future GetActiveSessionsFuture - future, err = client.GetActiveSessions(ctx, resourceGroupName, bastionHostName) - result.FutureAPI = future.FutureAPI - return -} - -// GetBastionShareableLink return the Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) GetBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result BastionShareableLinkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBastionShareableLink") - defer func() { - sc := -1 - if result.bsllr.Response.Response != nil { - sc = result.bsllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getBastionShareableLinkNextResults - req, err := client.GetBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", nil, "Failure preparing request") - return - } - - resp, err := client.GetBastionShareableLinkSender(req) - if err != nil { - result.bsllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", resp, "Failure sending request") - return - } - - result.bsllr, err = client.GetBastionShareableLinkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", resp, "Failure responding to request") - return - } - if result.bsllr.hasNextLink() && result.bsllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetBastionShareableLinkPreparer prepares the GetBastionShareableLink request. -func (client BaseClient) GetBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetBastionShareableLinkSender sends the GetBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetBastionShareableLinkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetBastionShareableLinkResponder handles the response to the GetBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) GetBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getBastionShareableLinkNextResults retrieves the next set of results, if any. -func (client BaseClient) getBastionShareableLinkNextResults(ctx context.Context, lastResults BastionShareableLinkListResult) (result BastionShareableLinkListResult, err error) { - req, err := lastResults.bastionShareableLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetBastionShareableLinkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", resp, "Failure sending next results request") - } - result, err = client.GetBastionShareableLinkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetBastionShareableLinkComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetBastionShareableLinkComplete(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result BastionShareableLinkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBastionShareableLink") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest) - return -} - -// PutBastionShareableLink creates a Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) PutBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result PutBastionShareableLinkFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutBastionShareableLink") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PutBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "PutBastionShareableLink", nil, "Failure preparing request") - return - } - - result, err = client.PutBastionShareableLinkSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "PutBastionShareableLink", nil, "Failure sending request") - return - } - - return -} - -// PutBastionShareableLinkPreparer prepares the PutBastionShareableLink request. -func (client BaseClient) PutBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PutBastionShareableLinkSender sends the PutBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) PutBastionShareableLinkSender(req *http.Request) (future PutBastionShareableLinkFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PutBastionShareableLinkResponder handles the response to the PutBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) PutBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResultPage, err error) { - result.bsllr, err = client.putBastionShareableLinkResponder(resp) - result.fn = client.putBastionShareableLinkNextResults - return -} - -func (client BaseClient) putBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// putBastionShareableLinkNextResults retrieves the next set of results, if any. -func (client BaseClient) putBastionShareableLinkNextResults(ctx context.Context, lastResults BastionShareableLinkListResult) (result BastionShareableLinkListResult, err error) { - req, err := lastResults.bastionShareableLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "putBastionShareableLinkNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "putBastionShareableLinkNextResults", resp, "Failure sending next results request") - } - return client.putBastionShareableLinkResponder(resp) -} - -// PutBastionShareableLinkComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) PutBastionShareableLinkComplete(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result PutBastionShareableLinkAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutBastionShareableLink") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - var future PutBastionShareableLinkFuture - future, err = client.PutBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest) - result.FutureAPI = future.FutureAPI - return -} - -// SupportedSecurityProviders gives the supported security providers for the virtual wan. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN for which supported security providers are needed. -func (client BaseClient) SupportedSecurityProviders(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWanSecurityProviders, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SupportedSecurityProviders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SupportedSecurityProvidersPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", nil, "Failure preparing request") - return - } - - resp, err := client.SupportedSecurityProvidersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", resp, "Failure sending request") - return - } - - result, err = client.SupportedSecurityProvidersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", resp, "Failure responding to request") - return - } - - return -} - -// SupportedSecurityProvidersPreparer prepares the SupportedSecurityProviders request. -func (client BaseClient) SupportedSecurityProvidersPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SupportedSecurityProvidersSender sends the SupportedSecurityProviders request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) SupportedSecurityProvidersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SupportedSecurityProvidersResponder handles the response to the SupportedSecurityProviders request. The method always -// closes the http.Response Body. -func (client BaseClient) SupportedSecurityProvidersResponder(resp *http.Response) (result VirtualWanSecurityProviders, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddoscustompolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddoscustompolicies.go deleted file mode 100644 index 076c60a938a0..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddoscustompolicies.go +++ /dev/null @@ -1,346 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DdosCustomPoliciesClient is the network Client -type DdosCustomPoliciesClient struct { - BaseClient -} - -// NewDdosCustomPoliciesClient creates an instance of the DdosCustomPoliciesClient client. -func NewDdosCustomPoliciesClient(subscriptionID string) DdosCustomPoliciesClient { - return NewDdosCustomPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDdosCustomPoliciesClientWithBaseURI creates an instance of the DdosCustomPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDdosCustomPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DdosCustomPoliciesClient { - return DdosCustomPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -// parameters - parameters supplied to the create or update operation. -func (client DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy) (result DdosCustomPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ddosCustomPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DdosCustomPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) CreateOrUpdateSender(req *http.Request) (future DdosCustomPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -func (client DdosCustomPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (result DdosCustomPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, ddosCustomPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DdosCustomPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) DeleteSender(req *http.Request) (future DdosCustomPoliciesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -func (client DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (result DdosCustomPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, ddosCustomPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DdosCustomPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) GetResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags update a DDoS custom policy tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -// parameters - parameters supplied to update DDoS custom policy resource tags. -func (client DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject) (result DdosCustomPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, ddosCustomPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client DdosCustomPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) UpdateTagsResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/defaultsecurityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/defaultsecurityrules.go deleted file mode 100644 index fe1dfeaefc3c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/defaultsecurityrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DefaultSecurityRulesClient is the network Client -type DefaultSecurityRulesClient struct { - BaseClient -} - -// NewDefaultSecurityRulesClient creates an instance of the DefaultSecurityRulesClient client. -func NewDefaultSecurityRulesClient(subscriptionID string) DefaultSecurityRulesClient { - return NewDefaultSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDefaultSecurityRulesClientWithBaseURI creates an instance of the DefaultSecurityRulesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) DefaultSecurityRulesClient { - return DefaultSecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get the specified default network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// defaultSecurityRuleName - the name of the default security rule. -func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DefaultSecurityRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "defaultSecurityRuleName": autorest.Encode("path", defaultSecurityRuleName), - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DefaultSecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all default security rules in a network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.List") - defer func() { - sc := -1 - if result.srlr.Response.Response != nil { - sc = result.srlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure sending request") - return - } - - result.srlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to request") - return - } - if result.srlr.hasNextLink() && result.srlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DefaultSecurityRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DefaultSecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DefaultSecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DefaultSecurityRulesClient) listNextResults(ctx context.Context, lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { - req, err := lastResults.securityRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DefaultSecurityRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkSecurityGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitauthorizations.go deleted file mode 100644 index 2f5740ba38c1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitauthorizations.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitAuthorizationsClient is the network Client -type ExpressRouteCircuitAuthorizationsClient struct { - BaseClient -} - -// NewExpressRouteCircuitAuthorizationsClient creates an instance of the ExpressRouteCircuitAuthorizationsClient -// client. -func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient { - return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of the -// ExpressRouteCircuitAuthorizationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient { - return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an authorization in the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -// authorizationParameters - parameters supplied to the create or update express route circuit authorization -// operation. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - authorizationParameters.Etag = nil - authorizationParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithJSON(authorizationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified authorization from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified authorization from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -func (client ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all authorizations in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.List") - defer func() { - sc := -1 - if result.alr.Response.Response != nil { - sc = result.alr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.alr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to request") - return - } - if result.alr.hasNextLink() && result.alr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) ListResponder(resp *http.Response) (result AuthorizationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitAuthorizationsClient) listNextResults(ctx context.Context, lastResults AuthorizationListResult) (result AuthorizationListResult, err error) { - req, err := lastResults.authorizationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitAuthorizationsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitconnections.go deleted file mode 100644 index 87e9bdbaac5b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitconnections.go +++ /dev/null @@ -1,401 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitConnectionsClient is the network Client -type ExpressRouteCircuitConnectionsClient struct { - BaseClient -} - -// NewExpressRouteCircuitConnectionsClient creates an instance of the ExpressRouteCircuitConnectionsClient client. -func NewExpressRouteCircuitConnectionsClient(subscriptionID string) ExpressRouteCircuitConnectionsClient { - return NewExpressRouteCircuitConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitConnectionsClientWithBaseURI creates an instance of the ExpressRouteCircuitConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteCircuitConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitConnectionsClient { - return ExpressRouteCircuitConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Express Route Circuit Connection in the specified express route circuits. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -// expressRouteCircuitConnectionParameters - parameters supplied to the create or update express route circuit -// connection operation. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection) (result ExpressRouteCircuitConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - expressRouteCircuitConnectionParameters.Etag = nil - expressRouteCircuitConnectionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithJSON(expressRouteCircuitConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -func (client ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result ExpressRouteCircuitConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitConnectionsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -func (client ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result ExpressRouteCircuitConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all global reach connections associated with a private peering in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitConnectionsClient) List(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitConnectionsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitConnectionListResult) (result ExpressRouteCircuitConnectionListResult, err error) { - req, err := lastResults.expressRouteCircuitConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName, peeringName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitpeerings.go deleted file mode 100644 index 442752508816..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuitpeerings.go +++ /dev/null @@ -1,404 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitPeeringsClient is the network Client -type ExpressRouteCircuitPeeringsClient struct { - BaseClient -} - -// NewExpressRouteCircuitPeeringsClient creates an instance of the ExpressRouteCircuitPeeringsClient client. -func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient { - return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the ExpressRouteCircuitPeeringsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient { - return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified express route circuits. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// peeringParameters - parameters supplied to the create or update express route circuit peering operation. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (result ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: peeringParameters, - Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, peeringParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - peeringParameters.Etag = nil - peeringParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(peeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitPeeringsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified peering for the express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all peerings in a specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.List") - defer func() { - sc := -1 - if result.ercplr.Response.Response != nil { - sc = result.ercplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.ercplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.ercplr.hasNextLink() && result.ercplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitPeeringsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitPeeringListResult) (result ExpressRouteCircuitPeeringListResult, err error) { - req, err := lastResults.expressRouteCircuitPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuits.go deleted file mode 100644 index 4ffa2a2563ba..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecircuits.go +++ /dev/null @@ -1,977 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitsClient is the network Client -type ExpressRouteCircuitsClient struct { - BaseClient -} - -// NewExpressRouteCircuitsClient creates an instance of the ExpressRouteCircuitsClient client. -func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient { - return NewExpressRouteCircuitsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the ExpressRouteCircuitsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitsClient { - return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// parameters - parameters supplied to the create or update express route circuit operation. -func (client ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (result ExpressRouteCircuitsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of express route circuit. -func (client ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPeeringStats gets all stats from an express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.GetPeeringStats") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPeeringStatsPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", nil, "Failure preparing request") - return - } - - resp, err := client.GetPeeringStatsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure sending request") - return - } - - result, err = client.GetPeeringStatsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure responding to request") - return - } - - return -} - -// GetPeeringStatsPreparer prepares the GetPeeringStats request. -func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPeeringStatsSender sends the GetPeeringStats request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPeeringStatsResponder handles the response to the GetPeeringStats request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStats gets all the stats from an express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.GetStats") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetStatsPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", nil, "Failure preparing request") - return - } - - resp, err := client.GetStatsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure sending request") - return - } - - result, err = client.GetStatsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure responding to request") - return - } - - return -} - -// GetStatsPreparer prepares the GetStats request. -func (client ExpressRouteCircuitsClient) GetStatsPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatsSender sends the GetStats request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetStatsResponder handles the response to the GetStats request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the express route circuits in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteCircuitsClient) List(ctx context.Context, resourceGroupName string) (result ExpressRouteCircuitListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.List") - defer func() { - sc := -1 - if result.erclr.Response.Response != nil { - sc = result.erclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending request") - return - } - - result.erclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to request") - return - } - if result.erclr.hasNextLink() && result.erclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { - req, err := lastResults.expressRouteCircuitListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitsClient) ListComplete(ctx context.Context, resourceGroupName string) (result ExpressRouteCircuitListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the express route circuits in a subscription. -func (client ExpressRouteCircuitsClient) ListAll(ctx context.Context) (result ExpressRouteCircuitListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListAll") - defer func() { - sc := -1 - if result.erclr.Response.Response != nil { - sc = result.erclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.erclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending request") - return - } - - result.erclr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.erclr.hasNextLink() && result.erclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ExpressRouteCircuitsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListAllResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitsClient) listAllNextResults(ctx context.Context, lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { - req, err := lastResults.expressRouteCircuitListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context) (result ExpressRouteCircuitListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListArpTable gets the currently advertised ARP table associated with the express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListArpTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListArpTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListArpTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure preparing request") - return - } - - result, err = client.ListArpTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure sending request") - return - } - - return -} - -// ListArpTablePreparer prepares the ListArpTable request. -func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListArpTableSender sends the ListArpTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) (future ExpressRouteCircuitsListArpTableFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListArpTableResponder handles the response to the ListArpTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTable gets the currently advertised routes table associated with the express route circuit in a resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure sending request") - return - } - - return -} - -// ListRoutesTablePreparer prepares the ListRoutesTable request. -func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSender sends the ListRoutesTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTableSummary gets the currently advertised routes table summary associated with the express route circuit -// in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableSummaryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTableSummary") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTableSummaryPreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSummarySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure sending request") - return - } - - return -} - -// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableSummaryFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates an express route circuit tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// parameters - parameters supplied to update express route circuit tags. -func (client ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject) (result ExpressRouteCircuit, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, circuitName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnectionpeerings.go deleted file mode 100644 index 1b8cd417e37c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnectionpeerings.go +++ /dev/null @@ -1,405 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCrossConnectionPeeringsClient is the network Client -type ExpressRouteCrossConnectionPeeringsClient struct { - BaseClient -} - -// NewExpressRouteCrossConnectionPeeringsClient creates an instance of the ExpressRouteCrossConnectionPeeringsClient -// client. -func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string) ExpressRouteCrossConnectionPeeringsClient { - return NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCrossConnectionPeeringsClientWithBaseURI creates an instance of the -// ExpressRouteCrossConnectionPeeringsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCrossConnectionPeeringsClient { - return ExpressRouteCrossConnectionPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// peeringParameters - parameters supplied to the create or update ExpressRouteCrossConnection peering -// operation. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering) (result ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: peeringParameters, - Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - peeringParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(peeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from the ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -func (client ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (result ExpressRouteCrossConnectionPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, crossConnectionName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCrossConnectionPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCrossConnectionPeeringsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified peering for the ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -func (client ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (result ExpressRouteCrossConnectionPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, crossConnectionName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCrossConnectionPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all peerings in a specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -func (client ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnectionPeeringListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.List") - defer func() { - sc := -1 - if result.erccpl.Response.Response != nil { - sc = result.erccpl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, crossConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erccpl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.erccpl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.erccpl.hasNextLink() && result.erccpl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCrossConnectionPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeeringList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionPeeringsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionPeeringList) (result ExpressRouteCrossConnectionPeeringList, err error) { - req, err := lastResults.expressRouteCrossConnectionPeeringListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnectionPeeringListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, crossConnectionName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutegateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutegateways.go deleted file mode 100644 index 91728fdab26b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutegateways.go +++ /dev/null @@ -1,421 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteGatewaysClient is the network Client -type ExpressRouteGatewaysClient struct { - BaseClient -} - -// NewExpressRouteGatewaysClient creates an instance of the ExpressRouteGatewaysClient client. -func NewExpressRouteGatewaysClient(subscriptionID string) ExpressRouteGatewaysClient { - return NewExpressRouteGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteGatewaysClientWithBaseURI creates an instance of the ExpressRouteGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteGatewaysClient { - return ExpressRouteGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a ExpressRoute gateway in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// putExpressRouteGatewayParameters - parameters required in an ExpressRoute gateway PUT operation. -func (client ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (result ExpressRouteGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: putExpressRouteGatewayParameters, - Constraints: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties.VirtualHub", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - putExpressRouteGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithJSON(putExpressRouteGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be -// deleted when there are no connection subresources. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteGatewaysClient) Delete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future ExpressRouteGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get fetches the details of a ExpressRoute gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) GetResponder(resp *http.Response) (result ExpressRouteGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists ExpressRoute gateways in a given resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRouteGatewayList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists ExpressRoute gateways under a given subscription. -func (client ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context) (result ExpressRouteGatewayList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure responding to request") - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutelinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutelinks.go deleted file mode 100644 index fb7c45272609..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutelinks.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteLinksClient is the network Client -type ExpressRouteLinksClient struct { - BaseClient -} - -// NewExpressRouteLinksClient creates an instance of the ExpressRouteLinksClient client. -func NewExpressRouteLinksClient(subscriptionID string) ExpressRouteLinksClient { - return NewExpressRouteLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteLinksClientWithBaseURI creates an instance of the ExpressRouteLinksClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteLinksClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteLinksClient { - return ExpressRouteLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the specified ExpressRouteLink resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// linkName - the name of the ExpressRouteLink resource. -func (client ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string) (result ExpressRouteLink, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName, linkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "linkName": autorest.Encode("path", linkName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteLinksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteLinksClient) GetResponder(resp *http.Response) (result ExpressRouteLink, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -func (client ExpressRouteLinksClient) List(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRouteLinkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.List") - defer func() { - sc := -1 - if result.erllr.Response.Response != nil { - sc = result.erllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure sending request") - return - } - - result.erllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure responding to request") - return - } - if result.erllr.hasNextLink() && result.erllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteLinksClient) ListResponder(resp *http.Response) (result ExpressRouteLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteLinksClient) listNextResults(ctx context.Context, lastResults ExpressRouteLinkListResult) (result ExpressRouteLinkListResult, err error) { - req, err := lastResults.expressRouteLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteLinksClient) ListComplete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRouteLinkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, expressRoutePortName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicies.go deleted file mode 100644 index 1c6c539d22cb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicies.go +++ /dev/null @@ -1,500 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPoliciesClient is the network Client -type FirewallPoliciesClient struct { - BaseClient -} - -// NewFirewallPoliciesClient creates an instance of the FirewallPoliciesClient client. -func NewFirewallPoliciesClient(subscriptionID string) FirewallPoliciesClient { - return NewFirewallPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPoliciesClientWithBaseURI creates an instance of the FirewallPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewFirewallPoliciesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPoliciesClient { - return FirewallPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// parameters - parameters supplied to the create or update Firewall Policy operation. -func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (result FirewallPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (future FirewallPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPoliciesClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) DeleteSender(req *http.Request) (future FirewallPoliciesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// expand - expands referenced resources. -func (client FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (result FirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) GetResponder(resp *http.Response) (result FirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Firewall Policies in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client FirewallPoliciesClient) List(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.fplr.Response.Response != nil { - sc = result.fplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.fplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.fplr.hasNextLink() && result.fplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) ListResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FirewallPoliciesClient) listNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) { - req, err := lastResults.firewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Firewall Policies in a subscription. -func (client FirewallPoliciesClient) ListAll(ctx context.Context) (result FirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.fplr.Response.Response != nil { - sc = result.fplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.fplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure sending request") - return - } - - result.fplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.fplr.hasNextLink() && result.fplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) ListAllResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client FirewallPoliciesClient) listAllNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) { - req, err := lastResults.firewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPoliciesClient) ListAllComplete(ctx context.Context) (result FirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicyrulecollectiongroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicyrulecollectiongroups.go deleted file mode 100644 index 3f41a3d420f5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/firewallpolicyrulecollectiongroups.go +++ /dev/null @@ -1,405 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPolicyRuleCollectionGroupsClient is the network Client -type FirewallPolicyRuleCollectionGroupsClient struct { - BaseClient -} - -// NewFirewallPolicyRuleCollectionGroupsClient creates an instance of the FirewallPolicyRuleCollectionGroupsClient -// client. -func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string) FirewallPolicyRuleCollectionGroupsClient { - return NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI creates an instance of the -// FirewallPolicyRuleCollectionGroupsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyRuleCollectionGroupsClient { - return FirewallPolicyRuleCollectionGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -// parameters - parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup) (result FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.InclusiveMaximum, Rule: int64(65000), Chain: nil}, - {Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.InclusiveMinimum, Rule: int64(100), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateSender(req *http.Request) (future FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -func (client FirewallPolicyRuleCollectionGroupsClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (result FirewallPolicyRuleCollectionGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FirewallPolicyRuleCollectionGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) DeleteSender(req *http.Request) (future FirewallPolicyRuleCollectionGroupsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -func (client FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (result FirewallPolicyRuleCollectionGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallPolicyRuleCollectionGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) GetResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyRuleCollectionGroupsClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleCollectionGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.List") - defer func() { - sc := -1 - if result.fprcglr.Response.Response != nil { - sc = result.fprcglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fprcglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", resp, "Failure sending request") - return - } - - result.fprcglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.fprcglr.hasNextLink() && result.fprcglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPolicyRuleCollectionGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) ListResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FirewallPolicyRuleCollectionGroupsClient) listNextResults(ctx context.Context, lastResults FirewallPolicyRuleCollectionGroupListResult) (result FirewallPolicyRuleCollectionGroupListResult, err error) { - req, err := lastResults.firewallPolicyRuleCollectionGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPolicyRuleCollectionGroupsClient) ListComplete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleCollectionGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, firewallPolicyName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceloadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceloadbalancers.go deleted file mode 100644 index 1f49179e44fe..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceloadbalancers.go +++ /dev/null @@ -1,150 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceLoadBalancersClient is the network Client -type InterfaceLoadBalancersClient struct { - BaseClient -} - -// NewInterfaceLoadBalancersClient creates an instance of the InterfaceLoadBalancersClient client. -func NewInterfaceLoadBalancersClient(subscriptionID string) InterfaceLoadBalancersClient { - return NewInterfaceLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceLoadBalancersClientWithBaseURI creates an instance of the InterfaceLoadBalancersClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) InterfaceLoadBalancersClient { - return InterfaceLoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list all load balancers in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancersClient.List") - defer func() { - sc := -1 - if result.ilblr.Response.Response != nil { - sc = result.ilblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure sending request") - return - } - - result.ilblr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to request") - return - } - if result.ilblr.hasNextLink() && result.ilblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceLoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceLoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceLoadBalancersClient) ListResponder(resp *http.Response) (result InterfaceLoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceLoadBalancersClient) listNextResults(ctx context.Context, lastResults InterfaceLoadBalancerListResult) (result InterfaceLoadBalancerListResult, err error) { - req, err := lastResults.interfaceLoadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceLoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipallocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipallocations.go deleted file mode 100644 index 5306a99480c6..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipallocations.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// IPAllocationsClient is the network Client -type IPAllocationsClient struct { - BaseClient -} - -// NewIPAllocationsClient creates an instance of the IPAllocationsClient client. -func NewIPAllocationsClient(subscriptionID string) IPAllocationsClient { - return NewIPAllocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIPAllocationsClientWithBaseURI creates an instance of the IPAllocationsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIPAllocationsClientWithBaseURI(baseURI string, subscriptionID string) IPAllocationsClient { - return IPAllocationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an IpAllocation in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// parameters - parameters supplied to the create or update virtual network operation. -func (client IPAllocationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters IPAllocation) (result IPAllocationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, IPAllocationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IPAllocationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters IPAllocation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) CreateOrUpdateSender(req *http.Request) (future IPAllocationsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) CreateOrUpdateResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified IpAllocation. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -func (client IPAllocationsClient) Delete(ctx context.Context, resourceGroupName string, IPAllocationName string) (result IPAllocationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, IPAllocationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IPAllocationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, IPAllocationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) DeleteSender(req *http.Request) (future IPAllocationsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified IpAllocation by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// expand - expands referenced resources. -func (client IPAllocationsClient) Get(ctx context.Context, resourceGroupName string, IPAllocationName string, expand string) (result IPAllocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, IPAllocationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IPAllocationsClient) GetPreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) GetResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all IpAllocations in a subscription. -func (client IPAllocationsClient) List(ctx context.Context) (result IPAllocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.List") - defer func() { - sc := -1 - if result.ialr.Response.Response != nil { - sc = result.ialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", resp, "Failure sending request") - return - } - - result.ialr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", resp, "Failure responding to request") - return - } - if result.ialr.hasNextLink() && result.ialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IPAllocationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) ListResponder(resp *http.Response) (result IPAllocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client IPAllocationsClient) listNextResults(ctx context.Context, lastResults IPAllocationListResult) (result IPAllocationListResult, err error) { - req, err := lastResults.iPAllocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPAllocationsClient) ListComplete(ctx context.Context) (result IPAllocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all IpAllocations in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client IPAllocationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result IPAllocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ialr.Response.Response != nil { - sc = result.ialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ialr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ialr.hasNextLink() && result.ialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client IPAllocationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) ListByResourceGroupResponder(resp *http.Response) (result IPAllocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client IPAllocationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IPAllocationListResult) (result IPAllocationListResult, err error) { - req, err := lastResults.iPAllocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPAllocationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result IPAllocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a IpAllocation tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// parameters - parameters supplied to update IpAllocation tags. -func (client IPAllocationsClient) UpdateTags(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters TagsObject) (result IPAllocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, IPAllocationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client IPAllocationsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) UpdateTagsResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerbackendaddresspools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerbackendaddresspools.go deleted file mode 100644 index 54c919401a72..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerbackendaddresspools.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerBackendAddressPoolsClient is the network Client -type LoadBalancerBackendAddressPoolsClient struct { - BaseClient -} - -// NewLoadBalancerBackendAddressPoolsClient creates an instance of the LoadBalancerBackendAddressPoolsClient client. -func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string) LoadBalancerBackendAddressPoolsClient { - return NewLoadBalancerBackendAddressPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerBackendAddressPoolsClientWithBaseURI creates an instance of the LoadBalancerBackendAddressPoolsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerBackendAddressPoolsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerBackendAddressPoolsClient { - return LoadBalancerBackendAddressPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -// parameters - parameters supplied to the create or update load balancer backend address pool operation. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool) (result LoadBalancerBackendAddressPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancerBackendAddressPoolsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BackendAddressPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -func (client LoadBalancerBackendAddressPoolsClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result LoadBalancerBackendAddressPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancerBackendAddressPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) DeleteSender(req *http.Request) (future LoadBalancerBackendAddressPoolsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -func (client LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result BackendAddressPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Response) (result BackendAddressPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer backed address pools. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.List") - defer func() { - sc := -1 - if result.lbbaplr.Response.Response != nil { - sc = result.lbbaplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbbaplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure sending request") - return - } - - result.lbbaplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to request") - return - } - if result.lbbaplr.hasNextLink() && result.lbbaplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) ListResponder(resp *http.Response) (result LoadBalancerBackendAddressPoolListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerBackendAddressPoolsClient) listNextResults(ctx context.Context, lastResults LoadBalancerBackendAddressPoolListResult) (result LoadBalancerBackendAddressPoolListResult, err error) { - req, err := lastResults.loadBalancerBackendAddressPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerBackendAddressPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalanceroutboundrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalanceroutboundrules.go deleted file mode 100644 index 3be65ea8bf96..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalanceroutboundrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerOutboundRulesClient is the network Client -type LoadBalancerOutboundRulesClient struct { - BaseClient -} - -// NewLoadBalancerOutboundRulesClient creates an instance of the LoadBalancerOutboundRulesClient client. -func NewLoadBalancerOutboundRulesClient(subscriptionID string) LoadBalancerOutboundRulesClient { - return NewLoadBalancerOutboundRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerOutboundRulesClientWithBaseURI creates an instance of the LoadBalancerOutboundRulesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewLoadBalancerOutboundRulesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerOutboundRulesClient { - return LoadBalancerOutboundRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified load balancer outbound rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// outboundRuleName - the name of the outbound rule. -func (client LoadBalancerOutboundRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string) (result OutboundRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, outboundRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerOutboundRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "outboundRuleName": autorest.Encode("path", outboundRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerOutboundRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerOutboundRulesClient) GetResponder(resp *http.Response) (result OutboundRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the outbound rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerOutboundRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerOutboundRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.List") - defer func() { - sc := -1 - if result.lborlr.Response.Response != nil { - sc = result.lborlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lborlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure sending request") - return - } - - result.lborlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure responding to request") - return - } - if result.lborlr.hasNextLink() && result.lborlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerOutboundRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerOutboundRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerOutboundRulesClient) ListResponder(resp *http.Response) (result LoadBalancerOutboundRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerOutboundRulesClient) listNextResults(ctx context.Context, lastResults LoadBalancerOutboundRuleListResult) (result LoadBalancerOutboundRuleListResult, err error) { - req, err := lastResults.loadBalancerOutboundRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerOutboundRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerOutboundRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerprobes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerprobes.go deleted file mode 100644 index 07f0026f96d9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerprobes.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerProbesClient is the network Client -type LoadBalancerProbesClient struct { - BaseClient -} - -// NewLoadBalancerProbesClient creates an instance of the LoadBalancerProbesClient client. -func NewLoadBalancerProbesClient(subscriptionID string) LoadBalancerProbesClient { - return NewLoadBalancerProbesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerProbesClientWithBaseURI creates an instance of the LoadBalancerProbesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerProbesClient { - return LoadBalancerProbesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets load balancer probe. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// probeName - the name of the probe. -func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, probeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerProbesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "probeName": autorest.Encode("path", probeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerProbesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result Probe, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer probes. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.List") - defer func() { - sc := -1 - if result.lbplr.Response.Response != nil { - sc = result.lbplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure sending request") - return - } - - result.lbplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to request") - return - } - if result.lbplr.hasNextLink() && result.lbplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerProbesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerProbesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerProbesClient) ListResponder(resp *http.Response) (result LoadBalancerProbeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerProbesClient) listNextResults(ctx context.Context, lastResults LoadBalancerProbeListResult) (result LoadBalancerProbeListResult, err error) { - req, err := lastResults.loadBalancerProbeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerProbesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/localnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/localnetworkgateways.go deleted file mode 100644 index f5ebc618ff67..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/localnetworkgateways.go +++ /dev/null @@ -1,496 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LocalNetworkGatewaysClient is the network Client -type LocalNetworkGatewaysClient struct { - BaseClient -} - -// NewLocalNetworkGatewaysClient creates an instance of the LocalNetworkGatewaysClient client. -func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient { - return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the LocalNetworkGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient { - return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a local network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -// parameters - parameters supplied to the create or update local network gateway operation. -func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (result LocalNetworkGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future LocalNetworkGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified local network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, localNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future LocalNetworkGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified local network gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, localNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LocalNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the local network gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.lnglr.Response.Response != nil { - sc = result.lnglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lnglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lnglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lnglr.hasNextLink() && result.lnglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LocalNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) ListResponder(resp *http.Response) (result LocalNetworkGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LocalNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults LocalNetworkGatewayListResult) (result LocalNetworkGatewayListResult, err error) { - req, err := lastResults.localNetworkGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LocalNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// UpdateTags updates a local network gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -// parameters - parameters supplied to update local network gateway tags. -func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (result LocalNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "UpdateTags", err.Error()) - } - - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatednszonegroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatednszonegroups.go deleted file mode 100644 index 7b8bee25784f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatednszonegroups.go +++ /dev/null @@ -1,391 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateDNSZoneGroupsClient is the network Client -type PrivateDNSZoneGroupsClient struct { - BaseClient -} - -// NewPrivateDNSZoneGroupsClient creates an instance of the PrivateDNSZoneGroupsClient client. -func NewPrivateDNSZoneGroupsClient(subscriptionID string) PrivateDNSZoneGroupsClient { - return NewPrivateDNSZoneGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateDNSZoneGroupsClientWithBaseURI creates an instance of the PrivateDNSZoneGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateDNSZoneGroupsClientWithBaseURI(baseURI string, subscriptionID string) PrivateDNSZoneGroupsClient { - return PrivateDNSZoneGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a private dns zone group in the specified private endpoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -// parameters - parameters supplied to the create or update private dns zone group operation. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup) (result PrivateDNSZoneGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdateSender(req *http.Request) (future PrivateDNSZoneGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateDNSZoneGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private dns zone group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -func (client PrivateDNSZoneGroupsClient) Delete(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result PrivateDNSZoneGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateDNSZoneGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) DeleteSender(req *http.Request) (future PrivateDNSZoneGroupsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the private dns zone group resource by specified private dns zone group name. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -func (client PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result PrivateDNSZoneGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateDNSZoneGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) GetResponder(resp *http.Response) (result PrivateDNSZoneGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private dns zone groups in a private endpoint. -// Parameters: -// privateEndpointName - the name of the private endpoint. -// resourceGroupName - the name of the resource group. -func (client PrivateDNSZoneGroupsClient) List(ctx context.Context, privateEndpointName string, resourceGroupName string) (result PrivateDNSZoneGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.List") - defer func() { - sc := -1 - if result.pdzglr.Response.Response != nil { - sc = result.pdzglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, privateEndpointName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pdzglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", resp, "Failure sending request") - return - } - - result.pdzglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.pdzglr.hasNextLink() && result.pdzglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateDNSZoneGroupsClient) ListPreparer(ctx context.Context, privateEndpointName string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) ListResponder(resp *http.Response) (result PrivateDNSZoneGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateDNSZoneGroupsClient) listNextResults(ctx context.Context, lastResults PrivateDNSZoneGroupListResult) (result PrivateDNSZoneGroupListResult, err error) { - req, err := lastResults.privateDNSZoneGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateDNSZoneGroupsClient) ListComplete(ctx context.Context, privateEndpointName string, resourceGroupName string) (result PrivateDNSZoneGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, privateEndpointName, resourceGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privateendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privateendpoints.go deleted file mode 100644 index 4be81fde40b6..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privateendpoints.go +++ /dev/null @@ -1,500 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointsClient is the network Client -type PrivateEndpointsClient struct { - BaseClient -} - -// NewPrivateEndpointsClient creates an instance of the PrivateEndpointsClient client. -func NewPrivateEndpointsClient(subscriptionID string) PrivateEndpointsClient { - return NewPrivateEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointsClientWithBaseURI creates an instance of the PrivateEndpointsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateEndpointsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointsClient { - return PrivateEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an private endpoint in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// parameters - parameters supplied to the create or update private endpoint operation. -func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint) (result PrivateEndpointsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateEndpointName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private endpoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -func (client PrivateEndpointsClient) Delete(ctx context.Context, resourceGroupName string, privateEndpointName string) (result PrivateEndpointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, privateEndpointName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) DeleteSender(req *http.Request) (future PrivateEndpointsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private endpoint by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// expand - expands referenced resources. -func (client PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (result PrivateEndpoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, privateEndpointName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) GetResponder(resp *http.Response) (result PrivateEndpoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private endpoints in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PrivateEndpointsClient) List(ctx context.Context, resourceGroupName string) (result PrivateEndpointListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.List") - defer func() { - sc := -1 - if result.pelr.Response.Response != nil { - sc = result.pelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", resp, "Failure sending request") - return - } - - result.pelr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", resp, "Failure responding to request") - return - } - if result.pelr.hasNextLink() && result.pelr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) ListResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateEndpointsClient) listNextResults(ctx context.Context, lastResults PrivateEndpointListResult) (result PrivateEndpointListResult, err error) { - req, err := lastResults.privateEndpointListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateEndpointListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListBySubscription gets all private endpoints in a subscription. -func (client PrivateEndpointsClient) ListBySubscription(ctx context.Context) (result PrivateEndpointListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.ListBySubscription") - defer func() { - sc := -1 - if result.pelr.Response.Response != nil { - sc = result.pelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.pelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.pelr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.pelr.hasNextLink() && result.pelr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client PrivateEndpointsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client PrivateEndpointsClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateEndpointListResult) (result PrivateEndpointListResult, err error) { - req, err := lastResults.privateEndpointListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointsClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateEndpointListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/resourcenavigationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/resourcenavigationlinks.go deleted file mode 100644 index e4152023be37..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/resourcenavigationlinks.go +++ /dev/null @@ -1,110 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceNavigationLinksClient is the network Client -type ResourceNavigationLinksClient struct { - BaseClient -} - -// NewResourceNavigationLinksClient creates an instance of the ResourceNavigationLinksClient client. -func NewResourceNavigationLinksClient(subscriptionID string) ResourceNavigationLinksClient { - return NewResourceNavigationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceNavigationLinksClientWithBaseURI creates an instance of the ResourceNavigationLinksClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceNavigationLinksClientWithBaseURI(baseURI string, subscriptionID string) ResourceNavigationLinksClient { - return ResourceNavigationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of resource navigation links for a subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client ResourceNavigationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result ResourceNavigationLinksListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceNavigationLinksClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceNavigationLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceNavigationLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceNavigationLinksClient) ListResponder(resp *http.Response) (result ResourceNavigationLinksListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilterrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilterrules.go deleted file mode 100644 index 3d15a31c4db3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilterrules.go +++ /dev/null @@ -1,401 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteFilterRulesClient is the network Client -type RouteFilterRulesClient struct { - BaseClient -} - -// NewRouteFilterRulesClient creates an instance of the RouteFilterRulesClient client. -func NewRouteFilterRulesClient(subscriptionID string) RouteFilterRulesClient { - return NewRouteFilterRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteFilterRulesClientWithBaseURI creates an instance of the RouteFilterRulesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) RouteFilterRulesClient { - return RouteFilterRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route in the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the route filter rule. -// routeFilterRuleParameters - parameters supplied to the create or update route filter rule operation. -func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: routeFilterRuleParameters, - Constraints: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.RouteFilterRuleType", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.Communities", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.RouteFilterRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeFilterRuleParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithJSON(routeFilterRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (future RouteFilterRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified rule from a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the rule. -func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future RouteFilterRulesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified rule from a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the rule. -func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result RouteFilterRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByRouteFilter gets all RouteFilterRules in a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") - defer func() { - sc := -1 - if result.rfrlr.Response.Response != nil { - sc = result.rfrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByRouteFilterNextResults - req, err := client.ListByRouteFilterPreparer(ctx, resourceGroupName, routeFilterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", nil, "Failure preparing request") - return - } - - resp, err := client.ListByRouteFilterSender(req) - if err != nil { - result.rfrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure sending request") - return - } - - result.rfrlr, err = client.ListByRouteFilterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure responding to request") - return - } - if result.rfrlr.hasNextLink() && result.rfrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByRouteFilterPreparer prepares the ListByRouteFilter request. -func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Context, resourceGroupName string, routeFilterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByRouteFilterSender sends the ListByRouteFilter request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) ListByRouteFilterSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByRouteFilterResponder handles the response to the ListByRouteFilter request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) ListByRouteFilterResponder(resp *http.Response) (result RouteFilterRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByRouteFilterNextResults retrieves the next set of results, if any. -func (client RouteFilterRulesClient) listByRouteFilterNextResults(ctx context.Context, lastResults RouteFilterRuleListResult) (result RouteFilterRuleListResult, err error) { - req, err := lastResults.routeFilterRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByRouteFilterSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByRouteFilterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByRouteFilterComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByRouteFilter(ctx, resourceGroupName, routeFilterName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilters.go deleted file mode 100644 index 8f083f21514c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routefilters.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteFiltersClient is the network Client -type RouteFiltersClient struct { - BaseClient -} - -// NewRouteFiltersClient creates an instance of the RouteFiltersClient client. -func NewRouteFiltersClient(subscriptionID string) RouteFiltersClient { - return NewRouteFiltersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteFiltersClientWithBaseURI creates an instance of the RouteFiltersClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRouteFiltersClientWithBaseURI(baseURI string, subscriptionID string) RouteFiltersClient { - return RouteFiltersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route filter in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// routeFilterParameters - parameters supplied to the create or update route filter operation. -func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (result RouteFiltersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeFilterParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithJSON(routeFilterParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future RouteFiltersCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFiltersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeFilterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFiltersDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// expand - expands referenced express route bgp peering resources. -func (client RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (result RouteFilter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteFiltersClient) GetPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) GetResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all route filters in a subscription. -func (client RouteFiltersClient) List(ctx context.Context) (result RouteFilterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.List") - defer func() { - sc := -1 - if result.rflr.Response.Response != nil { - sc = result.rflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure sending request") - return - } - - result.rflr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure responding to request") - return - } - if result.rflr.hasNextLink() && result.rflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RouteFiltersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) ListResponder(resp *http.Response) (result RouteFilterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RouteFiltersClient) listNextResults(ctx context.Context, lastResults RouteFilterListResult) (result RouteFilterListResult, err error) { - req, err := lastResults.routeFilterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFiltersClient) ListComplete(ctx context.Context) (result RouteFilterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all route filters in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RouteFilterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.rflr.Response.Response != nil { - sc = result.rflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.rflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.rflr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.rflr.hasNextLink() && result.rflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client RouteFiltersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) ListByResourceGroupResponder(resp *http.Response) (result RouteFilterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client RouteFiltersClient) listByResourceGroupNextResults(ctx context.Context, lastResults RouteFilterListResult) (result RouteFilterListResult, err error) { - req, err := lastResults.routeFilterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RouteFilterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// parameters - parameters supplied to update route filter tags. -func (client RouteFiltersClient) UpdateTags(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject) (result RouteFilter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeFilterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client RouteFiltersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) UpdateTagsResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitygroups.go deleted file mode 100644 index d9910f2950d7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitygroups.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityGroupsClient is the network Client -type SecurityGroupsClient struct { - BaseClient -} - -// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient client. -func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient { - return NewSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityGroupsClientWithBaseURI creates an instance of the SecurityGroupsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) SecurityGroupsClient { - return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network security group in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// parameters - parameters supplied to the create or update network security group operation. -func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future SecurityGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future SecurityGroupsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// expand - expands referenced resources. -func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network security groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.List") - defer func() { - sc := -1 - if result.sglr.Response.Response != nil { - sc = result.sglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending request") - return - } - - result.sglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.sglr.hasNextLink() && result.sglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) ListResponder(resp *http.Response) (result SecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityGroupsClient) listNextResults(ctx context.Context, lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { - req, err := lastResults.securityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityGroupsClient) ListComplete(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all network security groups in a subscription. -func (client SecurityGroupsClient) ListAll(ctx context.Context) (result SecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.sglr.Response.Response != nil { - sc = result.sglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.sglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending request") - return - } - - result.sglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.sglr.hasNextLink() && result.sglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client SecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) ListAllResponder(resp *http.Response) (result SecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client SecurityGroupsClient) listAllNextResults(ctx context.Context, lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { - req, err := lastResults.securityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityGroupsClient) ListAllComplete(ctx context.Context) (result SecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates a network security group tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// parameters - parameters supplied to update network security group tags. -func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (result SecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitypartnerproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitypartnerproviders.go deleted file mode 100644 index 23310b7c3d4c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securitypartnerproviders.go +++ /dev/null @@ -1,575 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityPartnerProvidersClient is the network Client -type SecurityPartnerProvidersClient struct { - BaseClient -} - -// NewSecurityPartnerProvidersClient creates an instance of the SecurityPartnerProvidersClient client. -func NewSecurityPartnerProvidersClient(subscriptionID string) SecurityPartnerProvidersClient { - return NewSecurityPartnerProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityPartnerProvidersClientWithBaseURI creates an instance of the SecurityPartnerProvidersClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSecurityPartnerProvidersClientWithBaseURI(baseURI string, subscriptionID string) SecurityPartnerProvidersClient { - return SecurityPartnerProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -// parameters - parameters supplied to the create or update Security Partner Provider operation. -func (client SecurityPartnerProvidersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider) (result SecurityPartnerProvidersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, securityPartnerProviderName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityPartnerProvidersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) CreateOrUpdateSender(req *http.Request) (future SecurityPartnerProvidersCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -func (client SecurityPartnerProvidersClient) Delete(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (result SecurityPartnerProvidersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, securityPartnerProviderName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityPartnerProvidersClient) DeletePreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) DeleteSender(req *http.Request) (future SecurityPartnerProvidersDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -func (client SecurityPartnerProvidersClient) Get(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (result SecurityPartnerProvider, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, securityPartnerProviderName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityPartnerProvidersClient) GetPreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) GetResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the Security Partner Providers in a subscription. -func (client SecurityPartnerProvidersClient) List(ctx context.Context) (result SecurityPartnerProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.List") - defer func() { - sc := -1 - if result.spplr.Response.Response != nil { - sc = result.spplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.spplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", resp, "Failure sending request") - return - } - - result.spplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", resp, "Failure responding to request") - return - } - if result.spplr.hasNextLink() && result.spplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityPartnerProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) ListResponder(resp *http.Response) (result SecurityPartnerProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityPartnerProvidersClient) listNextResults(ctx context.Context, lastResults SecurityPartnerProviderListResult) (result SecurityPartnerProviderListResult, err error) { - req, err := lastResults.securityPartnerProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityPartnerProvidersClient) ListComplete(ctx context.Context) (result SecurityPartnerProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Security Partner Providers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SecurityPartnerProvidersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SecurityPartnerProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.spplr.Response.Response != nil { - sc = result.spplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.spplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.spplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.spplr.hasNextLink() && result.spplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SecurityPartnerProvidersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) ListByResourceGroupResponder(resp *http.Response) (result SecurityPartnerProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SecurityPartnerProvidersClient) listByResourceGroupNextResults(ctx context.Context, lastResults SecurityPartnerProviderListResult) (result SecurityPartnerProviderListResult, err error) { - req, err := lastResults.securityPartnerProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityPartnerProvidersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SecurityPartnerProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a Security Partner Provider resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -// parameters - parameters supplied to update Security Partner Provider tags. -func (client SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject) (result SecurityPartnerProvider, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, securityPartnerProviderName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client SecurityPartnerProvidersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) UpdateTagsResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securityrules.go deleted file mode 100644 index 86be324aa6b7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/securityrules.go +++ /dev/null @@ -1,390 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityRulesClient is the network Client -type SecurityRulesClient struct { - BaseClient -} - -// NewSecurityRulesClient creates an instance of the SecurityRulesClient client. -func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient { - return NewSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityRulesClientWithBaseURI creates an instance of the SecurityRulesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) SecurityRulesClient { - return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a security rule in the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -// securityRuleParameters - parameters supplied to the create or update network security rule operation. -func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - securityRuleParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithJSON(securityRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (future SecurityRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) DeleteSender(req *http.Request) (future SecurityRulesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all security rules in a network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.List") - defer func() { - sc := -1 - if result.srlr.Response.Response != nil { - sc = result.srlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending request") - return - } - - result.srlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to request") - return - } - if result.srlr.hasNextLink() && result.srlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityRulesClient) listNextResults(ctx context.Context, lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { - req, err := lastResults.securityRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkSecurityGroupName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceassociationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceassociationlinks.go deleted file mode 100644 index 63c663e50d15..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceassociationlinks.go +++ /dev/null @@ -1,110 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceAssociationLinksClient is the network Client -type ServiceAssociationLinksClient struct { - BaseClient -} - -// NewServiceAssociationLinksClient creates an instance of the ServiceAssociationLinksClient client. -func NewServiceAssociationLinksClient(subscriptionID string) ServiceAssociationLinksClient { - return NewServiceAssociationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceAssociationLinksClientWithBaseURI creates an instance of the ServiceAssociationLinksClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceAssociationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServiceAssociationLinksClient { - return ServiceAssociationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of service association links for a subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client ServiceAssociationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result ServiceAssociationLinksListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceAssociationLinksClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceAssociationLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceAssociationLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceAssociationLinksClient) ListResponder(resp *http.Response) (result ServiceAssociationLinksListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/subnets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/subnets.go deleted file mode 100644 index 5ad8f013c2ea..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/subnets.go +++ /dev/null @@ -1,560 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SubnetsClient is the network Client -type SubnetsClient struct { - BaseClient -} - -// NewSubnetsClient creates an instance of the SubnetsClient client. -func NewSubnetsClient(subscriptionID string) SubnetsClient { - return NewSubnetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSubnetsClientWithBaseURI creates an instance of the SubnetsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsClient { - return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a subnet in the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// subnetParameters - parameters supplied to the create or update subnet operation. -func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (result SubnetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - subnetParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithJSON(subnetParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future SubnetsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result SubnetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified subnet by virtual network and resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// expand - expands referenced resources. -func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all subnets in a virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.List") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending request") - return - } - - result.slr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to request") - return - } - if result.slr.hasNextLink() && result.slr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SubnetsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SubnetsClient) ListResponder(resp *http.Response) (result SubnetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SubnetsClient) listNextResults(ctx context.Context, lastResults SubnetListResult) (result SubnetListResult, err error) { - req, err := lastResults.subnetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SubnetsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualNetworkName) - return -} - -// PrepareNetworkPolicies prepares a subnet by applying network intent policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// prepareNetworkPoliciesRequestParameters - parameters supplied to prepare subnet by applying network intent -// policies. -func (client SubnetsClient) PrepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest) (result SubnetsPrepareNetworkPoliciesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.PrepareNetworkPolicies") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PrepareNetworkPoliciesPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", nil, "Failure preparing request") - return - } - - result, err = client.PrepareNetworkPoliciesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", nil, "Failure sending request") - return - } - - return -} - -// PrepareNetworkPoliciesPreparer prepares the PrepareNetworkPolicies request. -func (client SubnetsClient) PrepareNetworkPoliciesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies", pathParameters), - autorest.WithJSON(prepareNetworkPoliciesRequestParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PrepareNetworkPoliciesSender sends the PrepareNetworkPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) PrepareNetworkPoliciesSender(req *http.Request) (future SubnetsPrepareNetworkPoliciesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PrepareNetworkPoliciesResponder handles the response to the PrepareNetworkPolicies request. The method always -// closes the http.Response Body. -func (client SubnetsClient) PrepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UnprepareNetworkPolicies unprepares a subnet by removing network intent policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// unprepareNetworkPoliciesRequestParameters - parameters supplied to unprepare subnet to remove network intent -// policies. -func (client SubnetsClient) UnprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (result SubnetsUnprepareNetworkPoliciesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.UnprepareNetworkPolicies") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UnprepareNetworkPoliciesPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", nil, "Failure preparing request") - return - } - - result, err = client.UnprepareNetworkPoliciesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", nil, "Failure sending request") - return - } - - return -} - -// UnprepareNetworkPoliciesPreparer prepares the UnprepareNetworkPolicies request. -func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies", pathParameters), - autorest.WithJSON(unprepareNetworkPoliciesRequestParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UnprepareNetworkPoliciesSender sends the UnprepareNetworkPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) UnprepareNetworkPoliciesSender(req *http.Request) (future SubnetsUnprepareNetworkPoliciesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UnprepareNetworkPoliciesResponder handles the response to the UnprepareNetworkPolicies request. The method always -// closes the http.Response Body. -func (client SubnetsClient) UnprepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/version.go deleted file mode 100644 index a250ea0907e8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package network - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " network/2020-07-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliances.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliances.go deleted file mode 100644 index 936ba6ff7230..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliances.go +++ /dev/null @@ -1,591 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualAppliancesClient is the network Client -type VirtualAppliancesClient struct { - BaseClient -} - -// NewVirtualAppliancesClient creates an instance of the VirtualAppliancesClient client. -func NewVirtualAppliancesClient(subscriptionID string) VirtualAppliancesClient { - return NewVirtualAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualAppliancesClientWithBaseURI creates an instance of the VirtualAppliancesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualAppliancesClientWithBaseURI(baseURI string, subscriptionID string) VirtualAppliancesClient { - return VirtualAppliancesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -// parameters - parameters supplied to the create or update Network Virtual Appliance. -func (client VirtualAppliancesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance) (result VirtualAppliancesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualAppliancesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkVirtualApplianceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualAppliancesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) CreateOrUpdateSender(req *http.Request) (future VirtualAppliancesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -func (client VirtualAppliancesClient) Delete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualAppliancesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkVirtualApplianceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualAppliancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) DeleteSender(req *http.Request) (future VirtualAppliancesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -// expand - expands referenced resources. -func (client VirtualAppliancesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, expand string) (result VirtualAppliance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkVirtualApplianceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualAppliancesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) GetResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all Network Virtual Appliances in a subscription. -func (client VirtualAppliancesClient) List(ctx context.Context) (result VirtualApplianceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.List") - defer func() { - sc := -1 - if result.valr.Response.Response != nil { - sc = result.valr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.valr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", resp, "Failure sending request") - return - } - - result.valr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", resp, "Failure responding to request") - return - } - if result.valr.hasNextLink() && result.valr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualAppliancesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) ListResponder(resp *http.Response) (result VirtualApplianceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualAppliancesClient) listNextResults(ctx context.Context, lastResults VirtualApplianceListResult) (result VirtualApplianceListResult, err error) { - req, err := lastResults.virtualApplianceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualAppliancesClient) ListComplete(ctx context.Context) (result VirtualApplianceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Network Virtual Appliances in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualAppliancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualApplianceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.valr.Response.Response != nil { - sc = result.valr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.valr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.valr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.valr.hasNextLink() && result.valr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualAppliancesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualApplianceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualAppliancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualApplianceListResult) (result VirtualApplianceListResult, err error) { - req, err := lastResults.virtualApplianceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualAppliancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualApplianceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a Network Virtual Appliance. -// Parameters: -// resourceGroupName - the resource group name of Network Virtual Appliance. -// networkVirtualApplianceName - the name of Network Virtual Appliance being updated. -// parameters - parameters supplied to Update Network Virtual Appliance Tags. -func (client VirtualAppliancesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject) (result VirtualAppliance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkVirtualApplianceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualAppliancesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) UpdateTagsResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliancesites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliancesites.go deleted file mode 100644 index be597cf393db..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualappliancesites.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualApplianceSitesClient is the network Client -type VirtualApplianceSitesClient struct { - BaseClient -} - -// NewVirtualApplianceSitesClient creates an instance of the VirtualApplianceSitesClient client. -func NewVirtualApplianceSitesClient(subscriptionID string) VirtualApplianceSitesClient { - return NewVirtualApplianceSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualApplianceSitesClientWithBaseURI creates an instance of the VirtualApplianceSitesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualApplianceSitesClientWithBaseURI(baseURI string, subscriptionID string) VirtualApplianceSitesClient { - return VirtualApplianceSitesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Network Virtual Appliance Site. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -// parameters - parameters supplied to the create or update Network Virtual Appliance Site operation. -func (client VirtualApplianceSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite) (result VirtualApplianceSitesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualApplianceSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) CreateOrUpdateSender(req *http.Request) (future VirtualApplianceSitesCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualApplianceSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified site from a Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -func (client VirtualApplianceSitesClient) Delete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (result VirtualApplianceSitesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualApplianceSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) DeleteSender(req *http.Request) (future VirtualApplianceSitesDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Appliance Site. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -func (client VirtualApplianceSitesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (result VirtualApplianceSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualApplianceSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) GetResponder(resp *http.Response) (result VirtualApplianceSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -func (client VirtualApplianceSitesClient) List(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualApplianceSiteListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.List") - defer func() { - sc := -1 - if result.vaslr.Response.Response != nil { - sc = result.vaslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkVirtualApplianceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vaslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", resp, "Failure sending request") - return - } - - result.vaslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", resp, "Failure responding to request") - return - } - if result.vaslr.hasNextLink() && result.vaslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualApplianceSitesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) ListResponder(resp *http.Response) (result VirtualApplianceSiteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualApplianceSitesClient) listNextResults(ctx context.Context, lastResults VirtualApplianceSiteListResult) (result VirtualApplianceSiteListResult, err error) { - req, err := lastResults.virtualApplianceSiteListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualApplianceSitesClient) ListComplete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualApplianceSiteListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkVirtualApplianceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubroutetablev2s.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubroutetablev2s.go deleted file mode 100644 index 4d21733d877d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubroutetablev2s.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubRouteTableV2sClient is the network Client -type VirtualHubRouteTableV2sClient struct { - BaseClient -} - -// NewVirtualHubRouteTableV2sClient creates an instance of the VirtualHubRouteTableV2sClient client. -func NewVirtualHubRouteTableV2sClient(subscriptionID string) VirtualHubRouteTableV2sClient { - return NewVirtualHubRouteTableV2sClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubRouteTableV2sClientWithBaseURI creates an instance of the VirtualHubRouteTableV2sClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualHubRouteTableV2sClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubRouteTableV2sClient { - return VirtualHubRouteTableV2sClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing -// VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -// virtualHubRouteTableV2Parameters - parameters supplied to create or update VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2) (result VirtualHubRouteTableV2sCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - virtualHubRouteTableV2Parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(virtualHubRouteTableV2Parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubRouteTableV2sCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHubRouteTableV2, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubRouteTableV2. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result VirtualHubRouteTableV2sDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubRouteTableV2sClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) DeleteSender(req *http.Request) (future VirtualHubRouteTableV2sDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubRouteTableV2. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result VirtualHubRouteTableV2, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubRouteTableV2sClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) GetResponder(resp *http.Response) (result VirtualHubRouteTableV2, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all VirtualHubRouteTableV2s. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubRouteTableV2sClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubRouteTableV2sResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.List") - defer func() { - sc := -1 - if result.lvhrtvr.Response.Response != nil { - sc = result.lvhrtvr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhrtvr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", resp, "Failure sending request") - return - } - - result.lvhrtvr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", resp, "Failure responding to request") - return - } - if result.lvhrtvr.hasNextLink() && result.lvhrtvr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubRouteTableV2sClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) ListResponder(resp *http.Response) (result ListVirtualHubRouteTableV2sResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubRouteTableV2sClient) listNextResults(ctx context.Context, lastResults ListVirtualHubRouteTableV2sResult) (result ListVirtualHubRouteTableV2sResult, err error) { - req, err := lastResults.listVirtualHubRouteTableV2sResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubRouteTableV2sClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubRouteTableV2sResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubs.go deleted file mode 100644 index 15b4a3694efe..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubs.go +++ /dev/null @@ -1,670 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubsClient is the network Client -type VirtualHubsClient struct { - BaseClient -} - -// NewVirtualHubsClient creates an instance of the VirtualHubsClient client. -func NewVirtualHubsClient(subscriptionID string) VirtualHubsClient { - return NewVirtualHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubsClientWithBaseURI creates an instance of the VirtualHubsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualHubsClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubsClient { - return VirtualHubsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// virtualHubParameters - parameters supplied to create or update VirtualHub. -func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (result VirtualHubsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: virtualHubParameters, - Constraints: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - virtualHubParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithJSON(virtualHubParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHubsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualHubsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHub, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEffectiveVirtualHubRoutes gets the effective routes configured for the Virtual Hub resource or the specified -// resource . -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// effectiveRoutesParameters - parameters supplied to get the effective routes for a specific resource. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, effectiveRoutesParameters *EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetEffectiveVirtualHubRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetEffectiveVirtualHubRoutesPreparer(ctx, resourceGroupName, virtualHubName, effectiveRoutesParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetEffectiveVirtualHubRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetEffectiveVirtualHubRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetEffectiveVirtualHubRoutes", nil, "Failure sending request") - return - } - - return -} - -// GetEffectiveVirtualHubRoutesPreparer prepares the GetEffectiveVirtualHubRoutes request. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, effectiveRoutesParameters *EffectiveRoutesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if effectiveRoutesParameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(effectiveRoutesParameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEffectiveVirtualHubRoutesSender sends the GetEffectiveVirtualHubRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesSender(req *http.Request) (future VirtualHubsGetEffectiveVirtualHubRoutesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetEffectiveVirtualHubRoutesResponder handles the response to the GetEffectiveVirtualHubRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// List lists all the VirtualHubs in a subscription. -func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHubsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.List") - defer func() { - sc := -1 - if result.lvhr.Response.Response != nil { - sc = result.lvhr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure sending request") - return - } - - result.lvhr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure responding to request") - return - } - if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) ListResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubsClient) listNextResults(ctx context.Context, lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { - req, err := lastResults.listVirtualHubsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubsClient) ListComplete(ctx context.Context) (result ListVirtualHubsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VirtualHubs in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -func (client VirtualHubsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvhr.Response.Response != nil { - sc = result.lvhr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvhr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvhr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualHubsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { - req, err := lastResults.listVirtualHubsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VirtualHub tags. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// virtualHubParameters - parameters supplied to update VirtualHub tags. -func (client VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (result VirtualHub, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithJSON(virtualHubParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) UpdateTagsResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgateways.go deleted file mode 100644 index b2329e64b125..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgateways.go +++ /dev/null @@ -1,1897 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkGatewaysClient is the network Client -type VirtualNetworkGatewaysClient struct { - BaseClient -} - -// NewVirtualNetworkGatewaysClient creates an instance of the VirtualNetworkGatewaysClient client. -func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { - return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the VirtualNetworkGatewaysClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient { - return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to create or update virtual network gateway operation. -func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectVirtualNetworkGatewayVpnConnections disconnect vpn connections of virtual network gateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// request - the parameters are supplied to disconnect vpn connections. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVpnConnectionRequest) (result VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisconnectVirtualNetworkGatewayVpnConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "DisconnectVirtualNetworkGatewayVpnConnections", nil, "Failure preparing request") - return - } - - result, err = client.DisconnectVirtualNetworkGatewayVpnConnectionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "DisconnectVirtualNetworkGatewayVpnConnections", nil, "Failure sending request") - return - } - - return -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsPreparer prepares the DisconnectVirtualNetworkGatewayVpnConnections request. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVpnConnectionRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsSender sends the DisconnectVirtualNetworkGatewayVpnConnections request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsSender(req *http.Request) (future VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsResponder handles the response to the DisconnectVirtualNetworkGatewayVpnConnections request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to the generate virtual network gateway VPN client package operation. -func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") - return - } - - result, err = client.GeneratevpnclientpackageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure sending request") - return - } - - return -} - -// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GenerateVpnProfile generates VPN profile for P2S client of the virtual network gateway in the specified resource -// group. Used for IKEV2 and radius based authentication. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to the generate virtual network gateway VPN client package operation. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GenerateVpnProfile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", nil, "Failure preparing request") - return - } - - result, err = client.GenerateVpnProfileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", nil, "Failure sending request") - return - } - - return -} - -// GenerateVpnProfilePreparer prepares the GenerateVpnProfile request. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets the specified virtual network gateway by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAdvertisedRoutes this operation retrieves a list of routes the virtual network gateway is advertising to the -// specified peer. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// peer - the IP address of the peer. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetAdvertisedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAdvertisedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetAdvertisedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", nil, "Failure sending request") - return - } - - return -} - -// GetAdvertisedRoutesPreparer prepares the GetAdvertisedRoutes request. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "peer": autorest.Encode("query", peer), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAdvertisedRoutesSender sends the GetAdvertisedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetAdvertisedRoutesResponder handles the response to the GetAdvertisedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all BGP peers. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// peer - the IP address of the peer to retrieve the status of. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetBgpPeerStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetBgpPeerStatusPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetBgpPeerStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", nil, "Failure sending request") - return - } - - return -} - -// GetBgpPeerStatusPreparer prepares the GetBgpPeerStatus request. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(peer) > 0 { - queryParameters["peer"] = autorest.Encode("query", peer) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetBgpPeerStatusSender sends the GetBgpPeerStatus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Request) (future VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetBgpPeerStatusResponder handles the response to the GetBgpPeerStatus request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http.Response) (result BgpPeerStatusListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetLearnedRoutes this operation retrieves a list of routes the virtual network gateway has learned, including routes -// learned from BGP peers. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetLearnedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLearnedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetLearnedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", nil, "Failure sending request") - return - } - - return -} - -// GetLearnedRoutesPreparer prepares the GetLearnedRoutes request. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLearnedRoutesSender sends the GetLearnedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetLearnedRoutesResponder handles the response to the GetLearnedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnclientConnectionHealth get VPN client connection health detail per P2S client connection of the virtual -// network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnclientConnectionHealthPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnclientConnectionHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", nil, "Failure sending request") - return - } - - return -} - -// GetVpnclientConnectionHealthPreparer prepares the GetVpnclientConnectionHealth request. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnclientConnectionHealthSender sends the GetVpnclientConnectionHealth request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnclientConnectionHealthResponder handles the response to the GetVpnclientConnectionHealth request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthResponder(resp *http.Response) (result VpnClientConnectionHealthDetailListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnclientIpsecParameters the Get VpnclientIpsecParameters operation retrieves information about the vpnclient -// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the virtual network gateway name. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientIpsecParameters") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnclientIpsecParametersPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnclientIpsecParametersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", nil, "Failure sending request") - return - } - - return -} - -// GetVpnclientIpsecParametersPreparer prepares the GetVpnclientIpsecParameters request. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnclientIpsecParametersSender sends the GetVpnclientIpsecParameters request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnclientIpsecParametersResponder handles the response to the GetVpnclientIpsecParameters request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnProfilePackageURL gets pre-generated VPN profile for P2S client of the virtual network gateway in the -// specified resource group. The profile needs to be generated first using generateVpnProfile. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnProfilePackageURL") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnProfilePackageURLPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnProfilePackageURLSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", nil, "Failure sending request") - return - } - - return -} - -// GetVpnProfilePackageURLPreparer prepares the GetVpnProfilePackageURL request. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnProfilePackageURLSender sends the GetVpnProfilePackageURL request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnProfilePackageURLResponder handles the response to the GetVpnProfilePackageURL request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual network gateways by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.vnglr.Response.Response != nil { - sc = result.vnglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.vnglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) { - req, err := lastResults.virtualNetworkGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListConnections gets all the connections in a virtual network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ListConnections") - defer func() { - sc := -1 - if result.vnglcr.Response.Response != nil { - sc = result.vnglcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listConnectionsNextResults - req, err := client.ListConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListConnectionsSender(req) - if err != nil { - result.vnglcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure sending request") - return - } - - result.vnglcr, err = client.ListConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to request") - return - } - if result.vnglcr.hasNextLink() && result.vnglcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListConnectionsPreparer prepares the ListConnections request. -func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListConnectionsSender sends the ListConnections request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ListConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListConnectionsResponder handles the response to the ListConnections request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ListConnectionsResponder(resp *http.Response) (result VirtualNetworkGatewayListConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listConnectionsNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewaysClient) listConnectionsNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListConnectionsResult) (result VirtualNetworkGatewayListConnectionsResult, err error) { - req, err := lastResults.virtualNetworkGatewayListConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ListConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListConnections(ctx, resourceGroupName, virtualNetworkGatewayName) - return -} - -// Reset resets the primary of the virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// gatewayVip - virtual network gateway vip address supplied to the begin reset of the active-active feature -// enabled gateway. -func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (result VirtualNetworkGatewaysResetFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, gatewayVip) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") - return - } - - result, err = client.ResetSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure sending request") - return - } - - return -} - -// ResetPreparer prepares the Reset request. -func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(gatewayVip) > 0 { - queryParameters["gatewayVip"] = autorest.Encode("query", gatewayVip) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSender sends the Reset request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetResponder handles the response to the Reset request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ResetVpnClientSharedKey resets the VPN client shared key of the virtual network gateway in the specified resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysResetVpnClientSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ResetVpnClientSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetVpnClientSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.ResetVpnClientSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", nil, "Failure sending request") - return - } - - return -} - -// ResetVpnClientSharedKeyPreparer prepares the ResetVpnClientSharedKey request. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetVpnClientSharedKeySender sends the ResetVpnClientSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeySender(req *http.Request) (future VirtualNetworkGatewaysResetVpnClientSharedKeyFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetVpnClientSharedKeyResponder handles the response to the ResetVpnClientSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// SetVpnclientIpsecParameters the Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S -// client of virtual network gateway in the specified resource group through Network resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// vpnclientIpsecParams - parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network -// Gateway P2S client operation through Network resource provider. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIpsecParams VpnClientIPsecParameters) (result VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.SetVpnclientIpsecParameters") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnclientIpsecParams, - Constraints: []validation.Constraint{{Target: "vpnclientIpsecParams.SaLifeTimeSeconds", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "vpnclientIpsecParams.SaDataSizeKilobytes", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", err.Error()) - } - - req, err := client.SetVpnclientIpsecParametersPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", nil, "Failure preparing request") - return - } - - result, err = client.SetVpnclientIpsecParametersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", nil, "Failure sending request") - return - } - - return -} - -// SetVpnclientIpsecParametersPreparer prepares the SetVpnclientIpsecParameters request. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIpsecParams VpnClientIPsecParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters", pathParameters), - autorest.WithJSON(vpnclientIpsecParams), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetVpnclientIpsecParametersSender sends the SetVpnclientIpsecParameters request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersSender(req *http.Request) (future VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetVpnclientIpsecParametersResponder handles the response to the SetVpnclientIpsecParameters request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartPacketCapture starts packet capture on virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - virtual network gateway packet capture parameters supplied to start packet capture on gateway. -func (client VirtualNetworkGatewaysClient) StartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters *VpnPacketCaptureStartParameters) (result VirtualNetworkGatewaysStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StartPacketCapture", nil, "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VirtualNetworkGatewaysClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters *VpnPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) StartPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewaysStartPacketCaptureFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - virtual network gateway packet capture parameters supplied to stop packet capture on gateway. -func (client VirtualNetworkGatewaysClient) StopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnPacketCaptureStopParameters) (result VirtualNetworkGatewaysStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StopPacketCapture", nil, "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VirtualNetworkGatewaysClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) StopPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewaysStopPacketCaptureFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SupportedVpnDevices gets a xml format representation for supported vpn devices. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.SupportedVpnDevices") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SupportedVpnDevicesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", nil, "Failure preparing request") - return - } - - resp, err := client.SupportedVpnDevicesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure sending request") - return - } - - result, err = client.SupportedVpnDevicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure responding to request") - return - } - - return -} - -// SupportedVpnDevicesPreparer prepares the SupportedVpnDevices request. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SupportedVpnDevicesSender sends the SupportedVpnDevices request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SupportedVpnDevicesResponder handles the response to the SupportedVpnDevices request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a virtual network gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to update virtual network gateway tags. -func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (result VirtualNetworkGatewaysUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", nil, "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewaysUpdateTagsFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// VpnDeviceConfigurationScript gets a xml format representation for vpn device configuration script. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection for which the -// configuration script is generated. -// parameters - parameters supplied to the generate vpn device script operation. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.VpnDeviceConfigurationScriptPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", nil, "Failure preparing request") - return - } - - resp, err := client.VpnDeviceConfigurationScriptSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure sending request") - return - } - - result, err = client.VpnDeviceConfigurationScriptResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure responding to request") - return - } - - return -} - -// VpnDeviceConfigurationScriptPreparer prepares the VpnDeviceConfigurationScript request. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// VpnDeviceConfigurationScriptSender sends the VpnDeviceConfigurationScript request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// VpnDeviceConfigurationScriptResponder handles the response to the VpnDeviceConfigurationScript request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouterpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouterpeerings.go deleted file mode 100644 index eebb693d4f65..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouterpeerings.go +++ /dev/null @@ -1,404 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualRouterPeeringsClient is the network Client -type VirtualRouterPeeringsClient struct { - BaseClient -} - -// NewVirtualRouterPeeringsClient creates an instance of the VirtualRouterPeeringsClient client. -func NewVirtualRouterPeeringsClient(subscriptionID string) VirtualRouterPeeringsClient { - return NewVirtualRouterPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualRouterPeeringsClientWithBaseURI creates an instance of the VirtualRouterPeeringsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualRouterPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualRouterPeeringsClient { - return VirtualRouterPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Virtual Router Peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the Virtual Router Peering. -// parameters - parameters supplied to the create or update Virtual Router Peering operation. -func (client VirtualRouterPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering) (result VirtualRouterPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualRouterPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualRouterName, peeringName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualRouterPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualRouterPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualRouterPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from a Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the peering. -func (client VirtualRouterPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (result VirtualRouterPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualRouterName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualRouterPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) DeleteSender(req *http.Request) (future VirtualRouterPeeringsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Router Peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the Virtual Router Peering. -func (client VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (result VirtualRouterPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualRouterName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualRouterPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) GetResponder(resp *http.Response) (result VirtualRouterPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Virtual Router Peerings in a Virtual Router resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -func (client VirtualRouterPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRouterPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.List") - defer func() { - sc := -1 - if result.vrplr.Response.Response != nil { - sc = result.vrplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualRouterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vrplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.vrplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.vrplr.hasNextLink() && result.vrplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualRouterPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) ListResponder(resp *http.Response) (result VirtualRouterPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualRouterPeeringsClient) listNextResults(ctx context.Context, lastResults VirtualRouterPeeringListResult) (result VirtualRouterPeeringListResult, err error) { - req, err := lastResults.virtualRouterPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRouterPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRouterPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualRouterName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualwans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualwans.go deleted file mode 100644 index 5d7deb8c4015..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualwans.go +++ /dev/null @@ -1,574 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualWansClient is the network Client -type VirtualWansClient struct { - BaseClient -} - -// NewVirtualWansClient creates an instance of the VirtualWansClient client. -func NewVirtualWansClient(subscriptionID string) VirtualWansClient { - return NewVirtualWansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualWansClientWithBaseURI creates an instance of the VirtualWansClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualWansClientWithBaseURI(baseURI string, subscriptionID string) VirtualWansClient { - return VirtualWansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being created or updated. -// wANParameters - parameters supplied to create or update VirtualWAN. -func (client VirtualWansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (result VirtualWansCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualWANName, wANParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualWansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - wANParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithJSON(wANParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) CreateOrUpdateSender(req *http.Request) (future VirtualWansCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being deleted. -func (client VirtualWansClient) Delete(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWansDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualWansClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) DeleteSender(req *http.Request) (future VirtualWansDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being retrieved. -func (client VirtualWansClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWAN, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualWansClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) GetResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VirtualWANs in a subscription. -func (client VirtualWansClient) List(ctx context.Context) (result ListVirtualWANsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.List") - defer func() { - sc := -1 - if result.lvwnr.Response.Response != nil { - sc = result.lvwnr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvwnr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure sending request") - return - } - - result.lvwnr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure responding to request") - return - } - if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualWansClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) ListResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualWansClient) listNextResults(ctx context.Context, lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { - req, err := lastResults.listVirtualWANsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualWansClient) ListComplete(ctx context.Context) (result ListVirtualWANsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VirtualWANs in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -func (client VirtualWansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvwnr.Response.Response != nil { - sc = result.lvwnr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvwnr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvwnr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualWansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualWansClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { - req, err := lastResults.listVirtualWANsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualWansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a VirtualWAN tags. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being updated. -// wANParameters - parameters supplied to Update VirtualWAN tags. -func (client VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (result VirtualWAN, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualWANName, wANParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualWansClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithJSON(wANParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) UpdateTagsResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnlinkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnlinkconnections.go deleted file mode 100644 index 7e2d820f059f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnlinkconnections.go +++ /dev/null @@ -1,152 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnLinkConnectionsClient is the network Client -type VpnLinkConnectionsClient struct { - BaseClient -} - -// NewVpnLinkConnectionsClient creates an instance of the VpnLinkConnectionsClient client. -func NewVpnLinkConnectionsClient(subscriptionID string) VpnLinkConnectionsClient { - return NewVpnLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnLinkConnectionsClientWithBaseURI creates an instance of the VpnLinkConnectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVpnLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnLinkConnectionsClient { - return VpnLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByVpnConnection retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. -// Parameters: -// resourceGroupName - the resource group name of the vpn gateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -func (client VpnLinkConnectionsClient) ListByVpnConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.lvslcr.Response.Response != nil { - sc = result.lvslcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnConnectionNextResults - req, err := client.ListByVpnConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.lvslcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure sending request") - return - } - - result.lvslcr, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure responding to request") - return - } - if result.lvslcr.hasNextLink() && result.lvslcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnConnectionPreparer prepares the ListByVpnConnection request. -func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnConnectionSender sends the ListByVpnConnection request. The method will close the -// http.Response Body if it receives an error. -func (client VpnLinkConnectionsClient) ListByVpnConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnConnectionResponder handles the response to the ListByVpnConnection request. The method always -// closes the http.Response Body. -func (client VpnLinkConnectionsClient) ListByVpnConnectionResponder(resp *http.Response) (result ListVpnSiteLinkConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnConnectionNextResults retrieves the next set of results, if any. -func (client VpnLinkConnectionsClient) listByVpnConnectionNextResults(ctx context.Context, lastResults ListVpnSiteLinkConnectionsResult) (result ListVpnSiteLinkConnectionsResult, err error) { - req, err := lastResults.listVpnSiteLinkConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnConnectionComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnLinkConnectionsClient) ListByVpnConnectionComplete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnConnection(ctx, resourceGroupName, gatewayName, connectionName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurations.go deleted file mode 100644 index 90467ae3749c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurations.go +++ /dev/null @@ -1,576 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnServerConfigurationsClient is the network Client -type VpnServerConfigurationsClient struct { - BaseClient -} - -// NewVpnServerConfigurationsClient creates an instance of the VpnServerConfigurationsClient client. -func NewVpnServerConfigurationsClient(subscriptionID string) VpnServerConfigurationsClient { - return NewVpnServerConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnServerConfigurationsClientWithBaseURI creates an instance of the VpnServerConfigurationsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnServerConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) VpnServerConfigurationsClient { - return VpnServerConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VpnServerConfiguration resource if it doesn't exist else updates the existing -// VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being created or updated. -// vpnServerConfigurationParameters - parameters supplied to create or update VpnServerConfiguration. -func (client VpnServerConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VpnServerConfiguration) (result VpnServerConfigurationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnServerConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VpnServerConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnServerConfigurationParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithJSON(vpnServerConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future VpnServerConfigurationsCreateOrUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being deleted. -func (client VpnServerConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result VpnServerConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, vpnServerConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Delete", nil, "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnServerConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) DeleteSender(req *http.Request) (future VpnServerConfigurationsDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being retrieved. -func (client VpnServerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result VpnServerConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnServerConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnServerConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) GetResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnServerConfigurations in a subscription. -func (client VpnServerConfigurationsClient) List(ctx context.Context) (result ListVpnServerConfigurationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.List") - defer func() { - sc := -1 - if result.lvscr.Response.Response != nil { - sc = result.lvscr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvscr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.lvscr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.lvscr.hasNextLink() && result.lvscr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnServerConfigurationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) ListResponder(resp *http.Response) (result ListVpnServerConfigurationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnServerConfigurationsClient) listNextResults(ctx context.Context, lastResults ListVpnServerConfigurationsResult) (result ListVpnServerConfigurationsResult, err error) { - req, err := lastResults.listVpnServerConfigurationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnServerConfigurationsClient) ListComplete(ctx context.Context) (result ListVpnServerConfigurationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the vpnServerConfigurations in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -func (client VpnServerConfigurationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnServerConfigurationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvscr.Response.Response != nil { - sc = result.lvscr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvscr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvscr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvscr.hasNextLink() && result.lvscr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnServerConfigurationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnServerConfigurationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnServerConfigurationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnServerConfigurationsResult) (result ListVpnServerConfigurationsResult, err error) { - req, err := lastResults.listVpnServerConfigurationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnServerConfigurationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnServerConfigurationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VpnServerConfiguration tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being updated. -// vpnServerConfigurationParameters - parameters supplied to update VpnServerConfiguration tags. -func (client VpnServerConfigurationsClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject) (result VpnServerConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnServerConfigurationsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithJSON(vpnServerConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) UpdateTagsResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go deleted file mode 100644 index 7238239ed8f6..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go +++ /dev/null @@ -1,111 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnServerConfigurationsAssociatedWithVirtualWanClient is the network Client -type VpnServerConfigurationsAssociatedWithVirtualWanClient struct { - BaseClient -} - -// NewVpnServerConfigurationsAssociatedWithVirtualWanClient creates an instance of the -// VpnServerConfigurationsAssociatedWithVirtualWanClient client. -func NewVpnServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID string) VpnServerConfigurationsAssociatedWithVirtualWanClient { - return NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI creates an instance of the -// VpnServerConfigurationsAssociatedWithVirtualWanClient client using a custom endpoint. Use this when interacting -// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI(baseURI string, subscriptionID string) VpnServerConfigurationsAssociatedWithVirtualWanClient { - return VpnServerConfigurationsAssociatedWithVirtualWanClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN whose associated VpnServerConfigurations is needed. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) List(ctx context.Context, resourceGroupName string, virtualWANName string) (result VpnServerConfigurationsAssociatedWithVirtualWanListFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsAssociatedWithVirtualWanClient.List") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanClient", "List", nil, "Failure preparing request") - return - } - - result, err = client.ListSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanClient", "List", nil, "Failure sending request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListSender(req *http.Request) (future VpnServerConfigurationsAssociatedWithVirtualWanListFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListResponder(resp *http.Response) (result VpnServerConfigurationsResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinks.go deleted file mode 100644 index a7ed0d67d5ca..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinks.go +++ /dev/null @@ -1,227 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSiteLinksClient is the network Client -type VpnSiteLinksClient struct { - BaseClient -} - -// NewVpnSiteLinksClient creates an instance of the VpnSiteLinksClient client. -func NewVpnSiteLinksClient(subscriptionID string) VpnSiteLinksClient { - return NewVpnSiteLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSiteLinksClientWithBaseURI creates an instance of the VpnSiteLinksClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnSiteLinksClientWithBaseURI(baseURI string, subscriptionID string) VpnSiteLinksClient { - return VpnSiteLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the details of a VPN site link. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite. -// vpnSiteLinkName - the name of the VpnSiteLink being retrieved. -func (client VpnSiteLinksClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) (result VpnSiteLink, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteLinkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSiteLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteLinkName": autorest.Encode("path", vpnSiteLinkName), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSiteLinksClient) GetResponder(resp *http.Response) (result VpnSiteLink, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnSite lists all the vpnSiteLinks in a resource group for a vpn site. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite. -func (client VpnSiteLinksClient) ListByVpnSite(ctx context.Context, resourceGroupName string, vpnSiteName string) (result ListVpnSiteLinksResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.ListByVpnSite") - defer func() { - sc := -1 - if result.lvslr.Response.Response != nil { - sc = result.lvslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnSiteNextResults - req, err := client.ListByVpnSitePreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnSiteSender(req) - if err != nil { - result.lvslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", resp, "Failure sending request") - return - } - - result.lvslr, err = client.ListByVpnSiteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", resp, "Failure responding to request") - return - } - if result.lvslr.hasNextLink() && result.lvslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnSitePreparer prepares the ListByVpnSite request. -func (client VpnSiteLinksClient) ListByVpnSitePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnSiteSender sends the ListByVpnSite request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinksClient) ListByVpnSiteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnSiteResponder handles the response to the ListByVpnSite request. The method always -// closes the http.Response Body. -func (client VpnSiteLinksClient) ListByVpnSiteResponder(resp *http.Response) (result ListVpnSiteLinksResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnSiteNextResults retrieves the next set of results, if any. -func (client VpnSiteLinksClient) listByVpnSiteNextResults(ctx context.Context, lastResults ListVpnSiteLinksResult) (result ListVpnSiteLinksResult, err error) { - req, err := lastResults.listVpnSiteLinksResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnSiteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnSiteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnSiteComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSiteLinksClient) ListByVpnSiteComplete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result ListVpnSiteLinksResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.ListByVpnSite") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnSite(ctx, resourceGroupName, vpnSiteName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitesconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitesconfiguration.go deleted file mode 100644 index 3873d9c3657d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitesconfiguration.go +++ /dev/null @@ -1,119 +0,0 @@ -package network - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSitesConfigurationClient is the network Client -type VpnSitesConfigurationClient struct { - BaseClient -} - -// NewVpnSitesConfigurationClient creates an instance of the VpnSitesConfigurationClient client. -func NewVpnSitesConfigurationClient(subscriptionID string) VpnSitesConfigurationClient { - return NewVpnSitesConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSitesConfigurationClientWithBaseURI creates an instance of the VpnSitesConfigurationClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnSitesConfigurationClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesConfigurationClient { - return VpnSitesConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Download gives the sas-url to download the configurations for vpn-sites in a resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN for which configuration of all vpn-sites is needed. -// request - parameters supplied to download vpn-sites configuration. -func (client VpnSitesConfigurationClient) Download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (result VpnSitesConfigurationDownloadFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesConfigurationClient.Download") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.OutputBlobSasURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VpnSitesConfigurationClient", "Download", err.Error()) - } - - req, err := client.DownloadPreparer(ctx, resourceGroupName, virtualWANName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", nil, "Failure preparing request") - return - } - - result, err = client.DownloadSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", nil, "Failure sending request") - return - } - - return -} - -// DownloadPreparer prepares the Download request. -func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2020-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadSender sends the Download request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (future VpnSitesConfigurationDownloadFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DownloadResponder handles the response to the Download request. The method always -// closes the http.Response Body. -func (client VpnSitesConfigurationClient) DownloadResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/CHANGELOG.md new file mode 100644 index 000000000000..878fce3b5205 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/CHANGELOG.md @@ -0,0 +1,467 @@ +# Change History + +## Breaking Changes + +### Removed Constants + +1. Access.Allow +1. Access.Deny +1. ApplicationGatewayBackendHealthServerHealth.Down +1. ApplicationGatewayBackendHealthServerHealth.Draining +1. ApplicationGatewayBackendHealthServerHealth.Partial +1. ApplicationGatewayBackendHealthServerHealth.Unknown +1. ApplicationGatewayBackendHealthServerHealth.Up +1. ApplicationGatewayCookieBasedAffinity.Disabled +1. ApplicationGatewayCookieBasedAffinity.Enabled +1. ApplicationGatewayCustomErrorStatusCode.HTTPStatus403 +1. ApplicationGatewayCustomErrorStatusCode.HTTPStatus502 +1. ApplicationGatewayFirewallMode.Detection +1. ApplicationGatewayFirewallMode.Prevention +1. ApplicationGatewayOperationalState.Running +1. ApplicationGatewayOperationalState.Starting +1. ApplicationGatewayOperationalState.Stopped +1. ApplicationGatewayOperationalState.Stopping +1. ApplicationGatewayProtocol.HTTP +1. ApplicationGatewayProtocol.HTTPS +1. ApplicationGatewayRedirectType.Found +1. ApplicationGatewayRedirectType.Permanent +1. ApplicationGatewayRedirectType.SeeOther +1. ApplicationGatewayRedirectType.Temporary +1. ApplicationGatewayRequestRoutingRuleType.Basic +1. ApplicationGatewayRequestRoutingRuleType.PathBasedRouting +1. ApplicationGatewaySkuName.StandardLarge +1. ApplicationGatewaySkuName.StandardMedium +1. ApplicationGatewaySkuName.StandardSmall +1. ApplicationGatewaySkuName.StandardV2 +1. ApplicationGatewaySkuName.WAFLarge +1. ApplicationGatewaySkuName.WAFMedium +1. ApplicationGatewaySkuName.WAFV2 +1. ApplicationGatewaySslCipherSuite.TLSDHEDSSWITH3DESEDECBCSHA +1. ApplicationGatewaySslCipherSuite.TLSDHEDSSWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSDHEDSSWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSDHEDSSWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSDHEDSSWITHAES256CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSDHERSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSDHERSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.TLSDHERSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSDHERSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES256CBCSHA384 +1. ApplicationGatewaySslCipherSuite.TLSECDHEECDSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES256CBCSHA384 +1. ApplicationGatewaySslCipherSuite.TLSECDHERSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.TLSRSAWITH3DESEDECBCSHA +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES256CBCSHA256 +1. ApplicationGatewaySslCipherSuite.TLSRSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslPolicyName.AppGwSslPolicy20150501 +1. ApplicationGatewaySslPolicyName.AppGwSslPolicy20170401 +1. ApplicationGatewaySslPolicyName.AppGwSslPolicy20170401S +1. ApplicationGatewaySslPolicyType.Custom +1. ApplicationGatewaySslPolicyType.Predefined +1. ApplicationGatewaySslProtocol.TLSv10 +1. ApplicationGatewaySslProtocol.TLSv11 +1. ApplicationGatewaySslProtocol.TLSv12 +1. AssociationType.Associated +1. AssociationType.Contains +1. AuthenticationMethod.EAPMSCHAPv2 +1. AuthenticationMethod.EAPTLS +1. AuthorizationUseStatus.Available +1. AuthorizationUseStatus.InUse +1. AzureFirewallNatRCActionType.Dnat +1. AzureFirewallNatRCActionType.Snat +1. AzureFirewallNetworkRuleProtocol.Any +1. AzureFirewallNetworkRuleProtocol.ICMP +1. AzureFirewallNetworkRuleProtocol.TCP +1. AzureFirewallNetworkRuleProtocol.UDP +1. AzureFirewallSkuName.AZFWHub +1. AzureFirewallSkuName.AZFWVNet +1. AzureFirewallSkuTier.Premium +1. AzureFirewallSkuTier.Standard +1. BastionConnectProtocol.RDP +1. BastionConnectProtocol.SSH +1. CircuitConnectionStatus.Connected +1. CircuitConnectionStatus.Connecting +1. CircuitConnectionStatus.Disconnected +1. CommissionedState.Commissioned +1. CommissionedState.Commissioning +1. CommissionedState.Decommissioning +1. CommissionedState.Deprovisioning +1. CommissionedState.Provisioned +1. CommissionedState.Provisioning +1. ConnectionMonitorEndpointFilterItemType.AgentAddress +1. ConnectionMonitorEndpointFilterType.Include +1. ConnectionMonitorType.MultiEndpoint +1. ConnectionMonitorType.SingleSourceDestination +1. CoverageLevel.AboveAverage +1. CoverageLevel.Average +1. CoverageLevel.BelowAverage +1. CoverageLevel.Default +1. CoverageLevel.Full +1. CoverageLevel.Low +1. DestinationPortBehavior.ListenIfAvailable +1. DestinationPortBehavior.None +1. Direction.Inbound +1. Direction.Outbound +1. EffectiveRouteState.Active +1. EffectiveRouteState.Invalid +1. EndpointType.AzureSubnet +1. EndpointType.AzureVM +1. EndpointType.AzureVNet +1. EndpointType.ExternalAddress +1. EndpointType.MMAWorkspaceMachine +1. EndpointType.MMAWorkspaceNetwork +1. EvaluationState.Completed +1. EvaluationState.InProgress +1. EvaluationState.NotStarted +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.Configured +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.Configuring +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.NotConfigured +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.ValidationNeeded +1. ExpressRouteCircuitSkuFamily.MeteredData +1. ExpressRouteCircuitSkuFamily.UnlimitedData +1. ExpressRouteLinkConnectorType.LC +1. ExpressRouteLinkConnectorType.SC +1. ExpressRouteLinkMacSecCipher.GcmAes128 +1. ExpressRouteLinkMacSecCipher.GcmAes256 +1. ExpressRouteLinkMacSecCipher.GcmAesXpn128 +1. ExpressRouteLinkMacSecCipher.GcmAesXpn256 +1. ExpressRoutePeeringType.AzurePrivatePeering +1. ExpressRoutePeeringType.AzurePublicPeering +1. ExpressRoutePeeringType.MicrosoftPeering +1. ExpressRoutePortsEncapsulation.Dot1Q +1. ExpressRoutePortsEncapsulation.QinQ +1. ExtendedLocationTypes.EdgeZone +1. FirewallPolicyNatRuleCollectionActionType.DNAT +1. FlowLogFormatType.JSON +1. HTTPConfigurationMethod.Get +1. HTTPConfigurationMethod.Post +1. IPAllocationMethod.Dynamic +1. IPAllocationMethod.Static +1. IPAllocationType.Hypernet +1. IPAllocationType.Undefined +1. IPVersion.IPv4 +1. IPVersion.IPv6 +1. IkeEncryption.AES128 +1. IkeEncryption.AES192 +1. IkeEncryption.AES256 +1. IkeEncryption.DES +1. IkeEncryption.DES3 +1. IkeEncryption.GCMAES128 +1. IkeEncryption.GCMAES256 +1. LoadBalancerSkuTier.Global +1. LoadBalancerSkuTier.Regional +1. OutputType.Workspace +1. OwaspCrsExclusionEntryMatchVariable.RequestArgNames +1. OwaspCrsExclusionEntryMatchVariable.RequestCookieNames +1. OwaspCrsExclusionEntryMatchVariable.RequestHeaderNames +1. PcError.AgentStopped +1. PcError.CaptureFailed +1. PcError.InternalError +1. PcError.LocalFileFailed +1. PcError.StorageFailed +1. ProcessorArchitecture.Amd64 +1. ProcessorArchitecture.X86 +1. ProvisioningState.Deleting +1. ProvisioningState.Failed +1. ProvisioningState.Succeeded +1. ProvisioningState.Updating +1. RuleCollectionType.RuleCollectionTypeFirewallPolicyFilterRuleCollection +1. RuleCollectionType.RuleCollectionTypeFirewallPolicyNatRuleCollection +1. RuleCollectionType.RuleCollectionTypeFirewallPolicyRuleCollection +1. RuleType.RuleTypeApplicationRule +1. RuleType.RuleTypeFirewallPolicyRule +1. RuleType.RuleTypeNatRule +1. RuleType.RuleTypeNetworkRule +1. SecurityProviderName.Checkpoint +1. SecurityProviderName.IBoss +1. SecurityProviderName.ZScaler +1. VirtualNetworkGatewayConnectionProtocol.IKEv1 +1. VirtualNetworkGatewayConnectionProtocol.IKEv2 +1. VirtualNetworkGatewayConnectionType.ExpressRoute +1. VirtualNetworkGatewayConnectionType.IPsec +1. VirtualNetworkGatewayConnectionType.VPNClient +1. VirtualNetworkGatewayConnectionType.Vnet2Vnet +1. VirtualWanSecurityProviderType.External +1. VirtualWanSecurityProviderType.Native +1. VpnAuthenticationType.AAD +1. VpnAuthenticationType.Certificate +1. VpnAuthenticationType.Radius +1. VpnClientProtocol.IkeV2 +1. VpnClientProtocol.OpenVPN +1. VpnClientProtocol.SSTP +1. VpnNatRuleMode.EgressSnat +1. VpnNatRuleMode.IngressSnat +1. VpnType.PolicyBased +1. VpnType.RouteBased +1. WebApplicationFirewallMatchVariable.PostArgs +1. WebApplicationFirewallMatchVariable.QueryString +1. WebApplicationFirewallMatchVariable.RemoteAddr +1. WebApplicationFirewallMatchVariable.RequestBody +1. WebApplicationFirewallMatchVariable.RequestCookies +1. WebApplicationFirewallMatchVariable.RequestHeaders +1. WebApplicationFirewallMatchVariable.RequestMethod +1. WebApplicationFirewallMatchVariable.RequestURI +1. WebApplicationFirewallTransform.HTMLEntityDecode +1. WebApplicationFirewallTransform.Lowercase +1. WebApplicationFirewallTransform.RemoveNulls +1. WebApplicationFirewallTransform.Trim +1. WebApplicationFirewallTransform.URLDecode +1. WebApplicationFirewallTransform.URLEncode + +### Struct Changes + +#### Removed Struct Fields + +1. VirtualNetworkGatewayPropertiesFormat.VirtualNetworkExtendedLocation + +### Signature Changes + +#### Struct Fields + +1. SubnetPropertiesFormat.PrivateEndpointNetworkPolicies changed type from *string to VirtualNetworkPrivateEndpointNetworkPolicies +1. SubnetPropertiesFormat.PrivateLinkServiceNetworkPolicies changed type from *string to VirtualNetworkPrivateLinkServiceNetworkPolicies + +## Additive Changes + +### New Constants + +1. Access.AccessAllow +1. Access.AccessDeny +1. ApplicationGatewayBackendHealthServerHealth.ApplicationGatewayBackendHealthServerHealthDown +1. ApplicationGatewayBackendHealthServerHealth.ApplicationGatewayBackendHealthServerHealthDraining +1. ApplicationGatewayBackendHealthServerHealth.ApplicationGatewayBackendHealthServerHealthPartial +1. ApplicationGatewayBackendHealthServerHealth.ApplicationGatewayBackendHealthServerHealthUnknown +1. ApplicationGatewayBackendHealthServerHealth.ApplicationGatewayBackendHealthServerHealthUp +1. ApplicationGatewayCookieBasedAffinity.ApplicationGatewayCookieBasedAffinityDisabled +1. ApplicationGatewayCookieBasedAffinity.ApplicationGatewayCookieBasedAffinityEnabled +1. ApplicationGatewayCustomErrorStatusCode.ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 +1. ApplicationGatewayCustomErrorStatusCode.ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 +1. ApplicationGatewayFirewallMode.ApplicationGatewayFirewallModeDetection +1. ApplicationGatewayFirewallMode.ApplicationGatewayFirewallModePrevention +1. ApplicationGatewayOperationalState.ApplicationGatewayOperationalStateRunning +1. ApplicationGatewayOperationalState.ApplicationGatewayOperationalStateStarting +1. ApplicationGatewayOperationalState.ApplicationGatewayOperationalStateStopped +1. ApplicationGatewayOperationalState.ApplicationGatewayOperationalStateStopping +1. ApplicationGatewayProtocol.ApplicationGatewayProtocolHTTP +1. ApplicationGatewayProtocol.ApplicationGatewayProtocolHTTPS +1. ApplicationGatewayRedirectType.ApplicationGatewayRedirectTypeFound +1. ApplicationGatewayRedirectType.ApplicationGatewayRedirectTypePermanent +1. ApplicationGatewayRedirectType.ApplicationGatewayRedirectTypeSeeOther +1. ApplicationGatewayRedirectType.ApplicationGatewayRedirectTypeTemporary +1. ApplicationGatewayRequestRoutingRuleType.ApplicationGatewayRequestRoutingRuleTypeBasic +1. ApplicationGatewayRequestRoutingRuleType.ApplicationGatewayRequestRoutingRuleTypePathBasedRouting +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameStandardLarge +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameStandardMedium +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameStandardSmall +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameStandardV2 +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameWAFLarge +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameWAFMedium +1. ApplicationGatewaySkuName.ApplicationGatewaySkuNameWAFV2 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256 +1. ApplicationGatewaySslCipherSuite.ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384 +1. ApplicationGatewaySslPolicyName.ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501 +1. ApplicationGatewaySslPolicyName.ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401 +1. ApplicationGatewaySslPolicyName.ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S +1. ApplicationGatewaySslPolicyType.ApplicationGatewaySslPolicyTypeCustom +1. ApplicationGatewaySslPolicyType.ApplicationGatewaySslPolicyTypePredefined +1. ApplicationGatewaySslProtocol.ApplicationGatewaySslProtocolTLSv10 +1. ApplicationGatewaySslProtocol.ApplicationGatewaySslProtocolTLSv11 +1. ApplicationGatewaySslProtocol.ApplicationGatewaySslProtocolTLSv12 +1. AssociationType.AssociationTypeAssociated +1. AssociationType.AssociationTypeContains +1. AuthenticationMethod.AuthenticationMethodEAPMSCHAPv2 +1. AuthenticationMethod.AuthenticationMethodEAPTLS +1. AuthorizationUseStatus.AuthorizationUseStatusAvailable +1. AuthorizationUseStatus.AuthorizationUseStatusInUse +1. AzureFirewallNatRCActionType.AzureFirewallNatRCActionTypeDnat +1. AzureFirewallNatRCActionType.AzureFirewallNatRCActionTypeSnat +1. AzureFirewallNetworkRuleProtocol.AzureFirewallNetworkRuleProtocolAny +1. AzureFirewallNetworkRuleProtocol.AzureFirewallNetworkRuleProtocolICMP +1. AzureFirewallNetworkRuleProtocol.AzureFirewallNetworkRuleProtocolTCP +1. AzureFirewallNetworkRuleProtocol.AzureFirewallNetworkRuleProtocolUDP +1. AzureFirewallSkuName.AzureFirewallSkuNameAZFWHub +1. AzureFirewallSkuName.AzureFirewallSkuNameAZFWVNet +1. AzureFirewallSkuTier.AzureFirewallSkuTierPremium +1. AzureFirewallSkuTier.AzureFirewallSkuTierStandard +1. BastionConnectProtocol.BastionConnectProtocolRDP +1. BastionConnectProtocol.BastionConnectProtocolSSH +1. CircuitConnectionStatus.CircuitConnectionStatusConnected +1. CircuitConnectionStatus.CircuitConnectionStatusConnecting +1. CircuitConnectionStatus.CircuitConnectionStatusDisconnected +1. CommissionedState.CommissionedStateCommissioned +1. CommissionedState.CommissionedStateCommissioning +1. CommissionedState.CommissionedStateDecommissioning +1. CommissionedState.CommissionedStateDeprovisioning +1. CommissionedState.CommissionedStateProvisioned +1. CommissionedState.CommissionedStateProvisioning +1. ConnectionMonitorEndpointFilterItemType.ConnectionMonitorEndpointFilterItemTypeAgentAddress +1. ConnectionMonitorEndpointFilterType.ConnectionMonitorEndpointFilterTypeInclude +1. ConnectionMonitorType.ConnectionMonitorTypeMultiEndpoint +1. ConnectionMonitorType.ConnectionMonitorTypeSingleSourceDestination +1. CoverageLevel.CoverageLevelAboveAverage +1. CoverageLevel.CoverageLevelAverage +1. CoverageLevel.CoverageLevelBelowAverage +1. CoverageLevel.CoverageLevelDefault +1. CoverageLevel.CoverageLevelFull +1. CoverageLevel.CoverageLevelLow +1. DestinationPortBehavior.DestinationPortBehaviorListenIfAvailable +1. DestinationPortBehavior.DestinationPortBehaviorNone +1. Direction.DirectionInbound +1. Direction.DirectionOutbound +1. EffectiveRouteState.EffectiveRouteStateActive +1. EffectiveRouteState.EffectiveRouteStateInvalid +1. EndpointType.EndpointTypeAzureSubnet +1. EndpointType.EndpointTypeAzureVM +1. EndpointType.EndpointTypeAzureVNet +1. EndpointType.EndpointTypeExternalAddress +1. EndpointType.EndpointTypeMMAWorkspaceMachine +1. EndpointType.EndpointTypeMMAWorkspaceNetwork +1. EvaluationState.EvaluationStateCompleted +1. EvaluationState.EvaluationStateInProgress +1. EvaluationState.EvaluationStateNotStarted +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured +1. ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded +1. ExpressRouteCircuitSkuFamily.ExpressRouteCircuitSkuFamilyMeteredData +1. ExpressRouteCircuitSkuFamily.ExpressRouteCircuitSkuFamilyUnlimitedData +1. ExpressRouteLinkConnectorType.ExpressRouteLinkConnectorTypeLC +1. ExpressRouteLinkConnectorType.ExpressRouteLinkConnectorTypeSC +1. ExpressRouteLinkMacSecCipher.ExpressRouteLinkMacSecCipherGcmAes128 +1. ExpressRouteLinkMacSecCipher.ExpressRouteLinkMacSecCipherGcmAes256 +1. ExpressRouteLinkMacSecCipher.ExpressRouteLinkMacSecCipherGcmAesXpn128 +1. ExpressRouteLinkMacSecCipher.ExpressRouteLinkMacSecCipherGcmAesXpn256 +1. ExpressRoutePeeringType.ExpressRoutePeeringTypeAzurePrivatePeering +1. ExpressRoutePeeringType.ExpressRoutePeeringTypeAzurePublicPeering +1. ExpressRoutePeeringType.ExpressRoutePeeringTypeMicrosoftPeering +1. ExpressRoutePortsEncapsulation.ExpressRoutePortsEncapsulationDot1Q +1. ExpressRoutePortsEncapsulation.ExpressRoutePortsEncapsulationQinQ +1. ExtendedLocationTypes.ExtendedLocationTypesEdgeZone +1. FirewallPolicyNatRuleCollectionActionType.FirewallPolicyNatRuleCollectionActionTypeDNAT +1. FlowLogFormatType.FlowLogFormatTypeJSON +1. HTTPConfigurationMethod.HTTPConfigurationMethodGet +1. HTTPConfigurationMethod.HTTPConfigurationMethodPost +1. IPAllocationMethod.IPAllocationMethodDynamic +1. IPAllocationMethod.IPAllocationMethodStatic +1. IPAllocationType.IPAllocationTypeHypernet +1. IPAllocationType.IPAllocationTypeUndefined +1. IPVersion.IPVersionIPv4 +1. IPVersion.IPVersionIPv6 +1. IkeEncryption.IkeEncryptionAES128 +1. IkeEncryption.IkeEncryptionAES192 +1. IkeEncryption.IkeEncryptionAES256 +1. IkeEncryption.IkeEncryptionDES +1. IkeEncryption.IkeEncryptionDES3 +1. IkeEncryption.IkeEncryptionGCMAES128 +1. IkeEncryption.IkeEncryptionGCMAES256 +1. LoadBalancerSkuTier.LoadBalancerSkuTierGlobal +1. LoadBalancerSkuTier.LoadBalancerSkuTierRegional +1. OutputType.OutputTypeWorkspace +1. OwaspCrsExclusionEntryMatchVariable.OwaspCrsExclusionEntryMatchVariableRequestArgNames +1. OwaspCrsExclusionEntryMatchVariable.OwaspCrsExclusionEntryMatchVariableRequestCookieNames +1. OwaspCrsExclusionEntryMatchVariable.OwaspCrsExclusionEntryMatchVariableRequestHeaderNames +1. PcError.PcErrorAgentStopped +1. PcError.PcErrorCaptureFailed +1. PcError.PcErrorInternalError +1. PcError.PcErrorLocalFileFailed +1. PcError.PcErrorStorageFailed +1. ProcessorArchitecture.ProcessorArchitectureAmd64 +1. ProcessorArchitecture.ProcessorArchitectureX86 +1. ProvisioningState.ProvisioningStateDeleting +1. ProvisioningState.ProvisioningStateFailed +1. ProvisioningState.ProvisioningStateSucceeded +1. ProvisioningState.ProvisioningStateUpdating +1. RuleCollectionType.RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection +1. RuleCollectionType.RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection +1. RuleCollectionType.RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection +1. RuleType.RuleTypeRuleTypeApplicationRule +1. RuleType.RuleTypeRuleTypeFirewallPolicyRule +1. RuleType.RuleTypeRuleTypeNatRule +1. RuleType.RuleTypeRuleTypeNetworkRule +1. SecurityProviderName.SecurityProviderNameCheckpoint +1. SecurityProviderName.SecurityProviderNameIBoss +1. SecurityProviderName.SecurityProviderNameZScaler +1. VirtualNetworkGatewayConnectionProtocol.VirtualNetworkGatewayConnectionProtocolIKEv1 +1. VirtualNetworkGatewayConnectionProtocol.VirtualNetworkGatewayConnectionProtocolIKEv2 +1. VirtualNetworkGatewayConnectionType.VirtualNetworkGatewayConnectionTypeExpressRoute +1. VirtualNetworkGatewayConnectionType.VirtualNetworkGatewayConnectionTypeIPsec +1. VirtualNetworkGatewayConnectionType.VirtualNetworkGatewayConnectionTypeVPNClient +1. VirtualNetworkGatewayConnectionType.VirtualNetworkGatewayConnectionTypeVnet2Vnet +1. VirtualNetworkPrivateEndpointNetworkPolicies.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled +1. VirtualNetworkPrivateEndpointNetworkPolicies.VirtualNetworkPrivateEndpointNetworkPoliciesEnabled +1. VirtualNetworkPrivateLinkServiceNetworkPolicies.VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled +1. VirtualNetworkPrivateLinkServiceNetworkPolicies.VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled +1. VirtualWanSecurityProviderType.VirtualWanSecurityProviderTypeExternal +1. VirtualWanSecurityProviderType.VirtualWanSecurityProviderTypeNative +1. VpnAuthenticationType.VpnAuthenticationTypeAAD +1. VpnAuthenticationType.VpnAuthenticationTypeCertificate +1. VpnAuthenticationType.VpnAuthenticationTypeRadius +1. VpnClientProtocol.VpnClientProtocolIkeV2 +1. VpnClientProtocol.VpnClientProtocolOpenVPN +1. VpnClientProtocol.VpnClientProtocolSSTP +1. VpnNatRuleMode.VpnNatRuleModeEgressSnat +1. VpnNatRuleMode.VpnNatRuleModeIngressSnat +1. VpnType.VpnTypePolicyBased +1. VpnType.VpnTypeRouteBased +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariablePostArgs +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableQueryString +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRemoteAddr +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRequestBody +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRequestCookies +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRequestHeaders +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRequestMethod +1. WebApplicationFirewallMatchVariable.WebApplicationFirewallMatchVariableRequestURI +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformHTMLEntityDecode +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformLowercase +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformRemoveNulls +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformTrim +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformURLDecode +1. WebApplicationFirewallTransform.WebApplicationFirewallTransformURLEncode + +### New Funcs + +1. PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetworkPrivateEndpointNetworkPolicies +1. PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNetworkPrivateLinkServiceNetworkPolicies + +### Struct Changes + +#### New Struct Fields + +1. VirtualNetworkGateway.ExtendedLocation diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/_meta.json similarity index 57% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/_meta.json index 63c78a2915ba..fc87db56acc7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3a3a9452f965a227ce43e6b545035b99dd175f23", + "commit": "c2ea3a3ccd14293b4bd1d17e684ef9129f0dc604", "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "tag": "package-2020-07", + "tag": "package-2020-11", "use": "@microsoft.azure/autorest.go@2.1.180", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2020-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2020-11 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } } \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivateendpointconnections.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivateendpointconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivateendpointconnections.go index a2bc79c58cb2..6576b5f2d7d5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgatewayprivateendpointconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivateendpointconnections.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -72,7 +73,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeletePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +159,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -239,7 +240,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,6 +325,19 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) Update(ctx cont tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ApplicationGatewayPrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPrivateEndpointConnectionProperties.PrivateEndpoint", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ApplicationGatewayPrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") @@ -348,7 +362,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdatePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivatelinkresources.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivatelinkresources.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivatelinkresources.go index a8ae5e985291..d4500cb71fb3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/applicationgatewayprivatelinkresources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgatewayprivatelinkresources.go @@ -82,7 +82,7 @@ func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgateways.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgateways.go index 68d8072307c9..735b7d28c74b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationgateways.go @@ -71,7 +71,7 @@ func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemandPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -267,7 +267,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -348,7 +348,7 @@ func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client ApplicationGatewaysClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -506,7 +506,7 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -585,7 +585,7 @@ func (client ApplicationGatewaysClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -698,7 +698,7 @@ func (client ApplicationGatewaysClient) ListAllPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -806,7 +806,7 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -877,7 +877,7 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -948,7 +948,7 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariablesPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1019,7 +1019,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1095,7 +1095,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1203,7 +1203,7 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1272,7 +1272,7 @@ func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1349,7 +1349,7 @@ func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1434,7 +1434,7 @@ func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationsecuritygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationsecuritygroups.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationsecuritygroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationsecuritygroups.go index 235f08c8a16b..77299c442710 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/applicationsecuritygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/applicationsecuritygroups.go @@ -70,7 +70,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client ApplicationSecurityGroupsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client ApplicationSecurityGroupsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -427,7 +427,7 @@ func (client ApplicationSecurityGroupsClient) ListAllPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -541,7 +541,7 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availabledelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availabledelegations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availabledelegations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availabledelegations.go index bd539f35a6f5..bee4225552ec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availabledelegations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availabledelegations.go @@ -79,7 +79,7 @@ func (client AvailableDelegationsClient) ListPreparer(ctx context.Context, locat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableendpointservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableendpointservices.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableendpointservices.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableendpointservices.go index beeb86472c63..c221f3c39802 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableendpointservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableendpointservices.go @@ -79,7 +79,7 @@ func (client AvailableEndpointServicesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableprivateendpointtypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableprivateendpointtypes.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableprivateendpointtypes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableprivateendpointtypes.go index d86fceaa5e37..2691ed7588af 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableprivateendpointtypes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableprivateendpointtypes.go @@ -79,7 +79,7 @@ func (client AvailablePrivateEndpointTypesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -198,7 +198,7 @@ func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableresourcegroupdelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableresourcegroupdelegations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableresourcegroupdelegations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableresourcegroupdelegations.go index e5d789547667..9ceb07a3c6f0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableresourcegroupdelegations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableresourcegroupdelegations.go @@ -82,7 +82,7 @@ func (client AvailableResourceGroupDelegationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableservicealiases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableservicealiases.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableservicealiases.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableservicealiases.go index fbd3247a72e4..b707edd78fc6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/availableservicealiases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/availableservicealiases.go @@ -79,7 +79,7 @@ func (client AvailableServiceAliasesClient) ListPreparer(ctx context.Context, lo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client AvailableServiceAliasesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewallfqdntags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewallfqdntags.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewallfqdntags.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewallfqdntags.go index d371ad2bdf90..8f2107996a8b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewallfqdntags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewallfqdntags.go @@ -76,7 +76,7 @@ func (client AzureFirewallFqdnTagsClient) ListAllPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewalls.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewalls.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewalls.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewalls.go index 4be280be135a..cc21f6e62d05 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/azurefirewalls.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/azurefirewalls.go @@ -77,7 +77,7 @@ func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -434,7 +434,7 @@ func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -541,7 +541,7 @@ func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bastionhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bastionhosts.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bastionhosts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bastionhosts.go index 2fd37e1f222f..f6b183ba5aa9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bastionhosts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bastionhosts.go @@ -69,7 +69,7 @@ func (client BastionHostsClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client BastionHostsClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -234,7 +234,7 @@ func (client BastionHostsClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +310,7 @@ func (client BastionHostsClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -426,7 +426,7 @@ func (client BastionHostsClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bgpservicecommunities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bgpservicecommunities.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bgpservicecommunities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bgpservicecommunities.go index 90c408f3f224..89dfc4468274 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/bgpservicecommunities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/bgpservicecommunities.go @@ -76,7 +76,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/client.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/client.go index 3419d648d54d..395247eaa5c3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/client.go @@ -89,7 +89,7 @@ func (client BaseClient) CheckDNSNameAvailabilityPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "domainNameLabel": autorest.Encode("query", domainNameLabel), @@ -160,7 +160,7 @@ func (client BaseClient) DeleteBastionShareableLinkPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client BaseClient) DisconnectActiveSessionsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -362,7 +362,7 @@ func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofilePrepa "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client BaseClient) GetActiveSessionsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -574,7 +574,7 @@ func (client BaseClient) GetBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -683,7 +683,7 @@ func (client BaseClient) PutBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -811,7 +811,7 @@ func (client BaseClient) SupportedSecurityProvidersPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/connectionmonitors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/connectionmonitors.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/connectionmonitors.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/connectionmonitors.go index a69424798726..e992f85afb5f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/connectionmonitors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/connectionmonitors.go @@ -98,7 +98,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,7 +183,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -269,7 +269,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -345,7 +345,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -416,7 +416,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -496,7 +496,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -575,7 +575,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -662,7 +662,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/customipprefixes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/customipprefixes.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/customipprefixes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/customipprefixes.go index d44b65583835..08e7f750f8f6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/customipprefixes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/customipprefixes.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -47,6 +48,15 @@ func (client CustomIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.CustomIPPrefixesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, customIPPrefixName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -70,7 +80,7 @@ func (client CustomIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +161,7 @@ func (client CustomIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +246,7 @@ func (client CustomIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +328,7 @@ func (client CustomIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +441,7 @@ func (client CustomIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -545,7 +555,7 @@ func (client CustomIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddoscustompolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddoscustompolicies.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddoscustompolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddoscustompolicies.go index 8dc5d411d6ef..c11035068c85 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ddoscustompolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddoscustompolicies.go @@ -70,7 +70,7 @@ func (client DdosCustomPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client DdosCustomPoliciesClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client DdosCustomPoliciesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client DdosCustomPoliciesClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddosprotectionplans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddosprotectionplans.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddosprotectionplans.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddosprotectionplans.go index ee9e4fa957eb..3e16250bdc0c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ddosprotectionplans.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ddosprotectionplans.go @@ -70,7 +70,7 @@ func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -154,7 +154,7 @@ func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/defaultsecurityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/defaultsecurityrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/defaultsecurityrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/defaultsecurityrules.go index f3b44ac6647e..dc3864eb3e5c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/defaultsecurityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/defaultsecurityrules.go @@ -78,7 +78,7 @@ func (client DefaultSecurityRulesClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client DefaultSecurityRulesClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/dscpconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/dscpconfiguration.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/dscpconfiguration.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/dscpconfiguration.go index 8d77ce19c6b4..39a18232cf1c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/dscpconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/dscpconfiguration.go @@ -70,7 +70,7 @@ func (client DscpConfigurationClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client DscpConfigurationClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client DscpConfigurationClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client DscpConfigurationClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -427,7 +427,7 @@ func (client DscpConfigurationClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/enums.go similarity index 69% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/enums.go index e8b7300fed3f..aa6e3705fc6d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/enums.go @@ -10,15 +10,15 @@ package network type Access string const ( - // Allow ... - Allow Access = "Allow" - // Deny ... - Deny Access = "Deny" + // AccessAllow ... + AccessAllow Access = "Allow" + // AccessDeny ... + AccessDeny Access = "Deny" ) // PossibleAccessValues returns an array of possible values for the Access const type. func PossibleAccessValues() []Access { - return []Access{Allow, Deny} + return []Access{AccessAllow, AccessDeny} } // ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health @@ -26,36 +26,36 @@ func PossibleAccessValues() []Access { type ApplicationGatewayBackendHealthServerHealth string const ( - // Down ... - Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining ... - Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial ... - Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown ... - Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up ... - Up ApplicationGatewayBackendHealthServerHealth = "Up" + // ApplicationGatewayBackendHealthServerHealthDown ... + ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" + // ApplicationGatewayBackendHealthServerHealthDraining ... + ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" + // ApplicationGatewayBackendHealthServerHealthPartial ... + ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" + // ApplicationGatewayBackendHealthServerHealthUnknown ... + ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // ApplicationGatewayBackendHealthServerHealthUp ... + ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" ) // PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} + return []ApplicationGatewayBackendHealthServerHealth{ApplicationGatewayBackendHealthServerHealthDown, ApplicationGatewayBackendHealthServerHealthDraining, ApplicationGatewayBackendHealthServerHealthPartial, ApplicationGatewayBackendHealthServerHealthUnknown, ApplicationGatewayBackendHealthServerHealthUp} } // ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. type ApplicationGatewayCookieBasedAffinity string const ( - // Disabled ... - Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled ... - Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" + // ApplicationGatewayCookieBasedAffinityDisabled ... + ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" + // ApplicationGatewayCookieBasedAffinityEnabled ... + ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) // PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} + return []ApplicationGatewayCookieBasedAffinity{ApplicationGatewayCookieBasedAffinityDisabled, ApplicationGatewayCookieBasedAffinityEnabled} } // ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status @@ -63,83 +63,83 @@ func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayC type ApplicationGatewayCustomErrorStatusCode string const ( - // HTTPStatus403 ... - HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // HTTPStatus502 ... - HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ... + ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + // ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ... + ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" ) // PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} + return []ApplicationGatewayCustomErrorStatusCode{ApplicationGatewayCustomErrorStatusCodeHTTPStatus403, ApplicationGatewayCustomErrorStatusCodeHTTPStatus502} } // ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. type ApplicationGatewayFirewallMode string const ( - // Detection ... - Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention ... - Prevention ApplicationGatewayFirewallMode = "Prevention" + // ApplicationGatewayFirewallModeDetection ... + ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + // ApplicationGatewayFirewallModePrevention ... + ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" ) // PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{Detection, Prevention} + return []ApplicationGatewayFirewallMode{ApplicationGatewayFirewallModeDetection, ApplicationGatewayFirewallModePrevention} } // ApplicationGatewayOperationalState enumerates the values for application gateway operational state. type ApplicationGatewayOperationalState string const ( - // Running ... - Running ApplicationGatewayOperationalState = "Running" - // Starting ... - Starting ApplicationGatewayOperationalState = "Starting" - // Stopped ... - Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping ... - Stopping ApplicationGatewayOperationalState = "Stopping" + // ApplicationGatewayOperationalStateRunning ... + ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + // ApplicationGatewayOperationalStateStarting ... + ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" + // ApplicationGatewayOperationalStateStopped ... + ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + // ApplicationGatewayOperationalStateStopping ... + ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" ) // PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} + return []ApplicationGatewayOperationalState{ApplicationGatewayOperationalStateRunning, ApplicationGatewayOperationalStateStarting, ApplicationGatewayOperationalStateStopped, ApplicationGatewayOperationalStateStopping} } // ApplicationGatewayProtocol enumerates the values for application gateway protocol. type ApplicationGatewayProtocol string const ( - // HTTP ... - HTTP ApplicationGatewayProtocol = "Http" - // HTTPS ... - HTTPS ApplicationGatewayProtocol = "Https" + // ApplicationGatewayProtocolHTTP ... + ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" + // ApplicationGatewayProtocolHTTPS ... + ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" ) // PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{HTTP, HTTPS} + return []ApplicationGatewayProtocol{ApplicationGatewayProtocolHTTP, ApplicationGatewayProtocolHTTPS} } // ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. type ApplicationGatewayRedirectType string const ( - // Found ... - Found ApplicationGatewayRedirectType = "Found" - // Permanent ... - Permanent ApplicationGatewayRedirectType = "Permanent" - // SeeOther ... - SeeOther ApplicationGatewayRedirectType = "SeeOther" - // Temporary ... - Temporary ApplicationGatewayRedirectType = "Temporary" + // ApplicationGatewayRedirectTypeFound ... + ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + // ApplicationGatewayRedirectTypePermanent ... + ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" + // ApplicationGatewayRedirectTypeSeeOther ... + ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + // ApplicationGatewayRedirectTypeTemporary ... + ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" ) // PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} + return []ApplicationGatewayRedirectType{ApplicationGatewayRedirectTypeFound, ApplicationGatewayRedirectTypePermanent, ApplicationGatewayRedirectTypeSeeOther, ApplicationGatewayRedirectTypeTemporary} } // ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule @@ -147,156 +147,156 @@ func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirect type ApplicationGatewayRequestRoutingRuleType string const ( - // Basic ... - Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting ... - PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" + // ApplicationGatewayRequestRoutingRuleTypeBasic ... + ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + // ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ... + ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" ) // PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} + return []ApplicationGatewayRequestRoutingRuleType{ApplicationGatewayRequestRoutingRuleTypeBasic, ApplicationGatewayRequestRoutingRuleTypePathBasedRouting} } // ApplicationGatewaySkuName enumerates the values for application gateway sku name. type ApplicationGatewaySkuName string const ( - // StandardLarge ... - StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium ... - StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall ... - StandardSmall ApplicationGatewaySkuName = "Standard_Small" - // StandardV2 ... - StandardV2 ApplicationGatewaySkuName = "Standard_v2" - // WAFLarge ... - WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium ... - WAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // WAFV2 ... - WAFV2 ApplicationGatewaySkuName = "WAF_v2" + // ApplicationGatewaySkuNameStandardLarge ... + ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" + // ApplicationGatewaySkuNameStandardMedium ... + ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" + // ApplicationGatewaySkuNameStandardSmall ... + ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" + // ApplicationGatewaySkuNameStandardV2 ... + ApplicationGatewaySkuNameStandardV2 ApplicationGatewaySkuName = "Standard_v2" + // ApplicationGatewaySkuNameWAFLarge ... + ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" + // ApplicationGatewaySkuNameWAFMedium ... + ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" + // ApplicationGatewaySkuNameWAFV2 ... + ApplicationGatewaySkuNameWAFV2 ApplicationGatewaySkuName = "WAF_v2" ) // PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} + return []ApplicationGatewaySkuName{ApplicationGatewaySkuNameStandardLarge, ApplicationGatewaySkuNameStandardMedium, ApplicationGatewaySkuNameStandardSmall, ApplicationGatewaySkuNameStandardV2, ApplicationGatewaySkuNameWAFLarge, ApplicationGatewaySkuNameWAFMedium, ApplicationGatewaySkuNameWAFV2} } // ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. type ApplicationGatewaySslCipherSuite string const ( - // TLSDHEDSSWITH3DESEDECBCSHA ... - TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA ... - TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA256 ... - TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // TLSDHEDSSWITHAES256CBCSHA ... - TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // TLSDHEDSSWITHAES256CBCSHA256 ... - TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // TLSDHERSAWITHAES128CBCSHA ... - TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // TLSDHERSAWITHAES128GCMSHA256 ... - TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSDHERSAWITHAES256CBCSHA ... - TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // TLSDHERSAWITHAES256GCMSHA384 ... - TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSECDHEECDSAWITHAES128CBCSHA ... - TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // TLSECDHEECDSAWITHAES128CBCSHA256 ... - TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // TLSECDHEECDSAWITHAES128GCMSHA256 ... - TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // TLSECDHEECDSAWITHAES256CBCSHA ... - TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // TLSECDHEECDSAWITHAES256CBCSHA384 ... - TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // TLSECDHEECDSAWITHAES256GCMSHA384 ... - TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // TLSECDHERSAWITHAES128CBCSHA ... - TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // TLSECDHERSAWITHAES128CBCSHA256 ... - TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // TLSECDHERSAWITHAES128GCMSHA256 ... - TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSECDHERSAWITHAES256CBCSHA ... - TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // TLSECDHERSAWITHAES256CBCSHA384 ... - TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // TLSECDHERSAWITHAES256GCMSHA384 ... - TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSRSAWITH3DESEDECBCSHA ... - TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // TLSRSAWITHAES128CBCSHA ... - TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // TLSRSAWITHAES128CBCSHA256 ... - TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // TLSRSAWITHAES128GCMSHA256 ... - TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // TLSRSAWITHAES256CBCSHA ... - TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // TLSRSAWITHAES256CBCSHA256 ... - TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // TLSRSAWITHAES256GCMSHA384 ... - TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ... + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ... + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ... + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ... + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ... + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + // ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA ... + ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256 ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256 ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384 ... + ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" ) // PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} + return []ApplicationGatewaySslCipherSuite{ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384} } // ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. type ApplicationGatewaySslPolicyName string const ( - // AppGwSslPolicy20150501 ... - AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // AppGwSslPolicy20170401 ... - AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // AppGwSslPolicy20170401S ... - AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" + // ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501 ... + ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + // ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401 ... + ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + // ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S ... + ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" ) // PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} + return []ApplicationGatewaySslPolicyName{ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501, ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401, ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S} } // ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. type ApplicationGatewaySslPolicyType string const ( - // Custom ... - Custom ApplicationGatewaySslPolicyType = "Custom" - // Predefined ... - Predefined ApplicationGatewaySslPolicyType = "Predefined" + // ApplicationGatewaySslPolicyTypeCustom ... + ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" + // ApplicationGatewaySslPolicyTypePredefined ... + ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" ) // PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{Custom, Predefined} + return []ApplicationGatewaySslPolicyType{ApplicationGatewaySslPolicyTypeCustom, ApplicationGatewaySslPolicyTypePredefined} } // ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. type ApplicationGatewaySslProtocol string const ( - // TLSv10 ... - TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 ... - TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 ... - TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" + // ApplicationGatewaySslProtocolTLSv10 ... + ApplicationGatewaySslProtocolTLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" + // ApplicationGatewaySslProtocolTLSv11 ... + ApplicationGatewaySslProtocolTLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" + // ApplicationGatewaySslProtocolTLSv12 ... + ApplicationGatewaySslProtocolTLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" ) // PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} + return []ApplicationGatewaySslProtocol{ApplicationGatewaySslProtocolTLSv10, ApplicationGatewaySslProtocolTLSv11, ApplicationGatewaySslProtocolTLSv12} } // ApplicationGatewayTier enumerates the values for application gateway tier. @@ -322,45 +322,45 @@ func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { type AssociationType string const ( - // Associated ... - Associated AssociationType = "Associated" - // Contains ... - Contains AssociationType = "Contains" + // AssociationTypeAssociated ... + AssociationTypeAssociated AssociationType = "Associated" + // AssociationTypeContains ... + AssociationTypeContains AssociationType = "Contains" ) // PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{Associated, Contains} + return []AssociationType{AssociationTypeAssociated, AssociationTypeContains} } // AuthenticationMethod enumerates the values for authentication method. type AuthenticationMethod string const ( - // EAPMSCHAPv2 ... - EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // EAPTLS ... - EAPTLS AuthenticationMethod = "EAPTLS" + // AuthenticationMethodEAPMSCHAPv2 ... + AuthenticationMethodEAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + // AuthenticationMethodEAPTLS ... + AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" ) // PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} + return []AuthenticationMethod{AuthenticationMethodEAPMSCHAPv2, AuthenticationMethodEAPTLS} } // AuthorizationUseStatus enumerates the values for authorization use status. type AuthorizationUseStatus string const ( - // Available ... - Available AuthorizationUseStatus = "Available" - // InUse ... - InUse AuthorizationUseStatus = "InUse" + // AuthorizationUseStatusAvailable ... + AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" + // AuthorizationUseStatusInUse ... + AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" ) // PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{Available, InUse} + return []AuthorizationUseStatus{AuthorizationUseStatusAvailable, AuthorizationUseStatusInUse} } // AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol @@ -385,34 +385,34 @@ func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApp type AzureFirewallNatRCActionType string const ( - // Dnat ... - Dnat AzureFirewallNatRCActionType = "Dnat" - // Snat ... - Snat AzureFirewallNatRCActionType = "Snat" + // AzureFirewallNatRCActionTypeDnat ... + AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" + // AzureFirewallNatRCActionTypeSnat ... + AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" ) // PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{Dnat, Snat} + return []AzureFirewallNatRCActionType{AzureFirewallNatRCActionTypeDnat, AzureFirewallNatRCActionTypeSnat} } // AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. type AzureFirewallNetworkRuleProtocol string const ( - // Any ... - Any AzureFirewallNetworkRuleProtocol = "Any" - // ICMP ... - ICMP AzureFirewallNetworkRuleProtocol = "ICMP" - // TCP ... - TCP AzureFirewallNetworkRuleProtocol = "TCP" - // UDP ... - UDP AzureFirewallNetworkRuleProtocol = "UDP" + // AzureFirewallNetworkRuleProtocolAny ... + AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" + // AzureFirewallNetworkRuleProtocolICMP ... + AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" + // AzureFirewallNetworkRuleProtocolTCP ... + AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" + // AzureFirewallNetworkRuleProtocolUDP ... + AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" ) // PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} + return []AzureFirewallNetworkRuleProtocol{AzureFirewallNetworkRuleProtocolAny, AzureFirewallNetworkRuleProtocolICMP, AzureFirewallNetworkRuleProtocolTCP, AzureFirewallNetworkRuleProtocolUDP} } // AzureFirewallRCActionType enumerates the values for azure firewall rc action type. @@ -434,30 +434,30 @@ func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { type AzureFirewallSkuName string const ( - // AZFWHub ... - AZFWHub AzureFirewallSkuName = "AZFW_Hub" - // AZFWVNet ... - AZFWVNet AzureFirewallSkuName = "AZFW_VNet" + // AzureFirewallSkuNameAZFWHub ... + AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" + // AzureFirewallSkuNameAZFWVNet ... + AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" ) // PossibleAzureFirewallSkuNameValues returns an array of possible values for the AzureFirewallSkuName const type. func PossibleAzureFirewallSkuNameValues() []AzureFirewallSkuName { - return []AzureFirewallSkuName{AZFWHub, AZFWVNet} + return []AzureFirewallSkuName{AzureFirewallSkuNameAZFWHub, AzureFirewallSkuNameAZFWVNet} } // AzureFirewallSkuTier enumerates the values for azure firewall sku tier. type AzureFirewallSkuTier string const ( - // Premium ... - Premium AzureFirewallSkuTier = "Premium" - // Standard ... - Standard AzureFirewallSkuTier = "Standard" + // AzureFirewallSkuTierPremium ... + AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" + // AzureFirewallSkuTierStandard ... + AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" ) // PossibleAzureFirewallSkuTierValues returns an array of possible values for the AzureFirewallSkuTier const type. func PossibleAzureFirewallSkuTierValues() []AzureFirewallSkuTier { - return []AzureFirewallSkuTier{Premium, Standard} + return []AzureFirewallSkuTier{AzureFirewallSkuTierPremium, AzureFirewallSkuTierStandard} } // AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. @@ -481,15 +481,15 @@ func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode type BastionConnectProtocol string const ( - // RDP ... - RDP BastionConnectProtocol = "RDP" - // SSH ... - SSH BastionConnectProtocol = "SSH" + // BastionConnectProtocolRDP ... + BastionConnectProtocolRDP BastionConnectProtocol = "RDP" + // BastionConnectProtocolSSH ... + BastionConnectProtocolSSH BastionConnectProtocol = "SSH" ) // PossibleBastionConnectProtocolValues returns an array of possible values for the BastionConnectProtocol const type. func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { - return []BastionConnectProtocol{RDP, SSH} + return []BastionConnectProtocol{BastionConnectProtocolRDP, BastionConnectProtocolSSH} } // BgpPeerState enumerates the values for bgp peer state. @@ -517,40 +517,40 @@ func PossibleBgpPeerStateValues() []BgpPeerState { type CircuitConnectionStatus string const ( - // Connected ... - Connected CircuitConnectionStatus = "Connected" - // Connecting ... - Connecting CircuitConnectionStatus = "Connecting" - // Disconnected ... - Disconnected CircuitConnectionStatus = "Disconnected" + // CircuitConnectionStatusConnected ... + CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" + // CircuitConnectionStatusConnecting ... + CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" + // CircuitConnectionStatusDisconnected ... + CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" ) // PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{Connected, Connecting, Disconnected} + return []CircuitConnectionStatus{CircuitConnectionStatusConnected, CircuitConnectionStatusConnecting, CircuitConnectionStatusDisconnected} } // CommissionedState enumerates the values for commissioned state. type CommissionedState string const ( - // Commissioned ... - Commissioned CommissionedState = "Commissioned" - // Commissioning ... - Commissioning CommissionedState = "Commissioning" - // Decommissioning ... - Decommissioning CommissionedState = "Decommissioning" - // Deprovisioning ... - Deprovisioning CommissionedState = "Deprovisioning" - // Provisioned ... - Provisioned CommissionedState = "Provisioned" - // Provisioning ... - Provisioning CommissionedState = "Provisioning" + // CommissionedStateCommissioned ... + CommissionedStateCommissioned CommissionedState = "Commissioned" + // CommissionedStateCommissioning ... + CommissionedStateCommissioning CommissionedState = "Commissioning" + // CommissionedStateDecommissioning ... + CommissionedStateDecommissioning CommissionedState = "Decommissioning" + // CommissionedStateDeprovisioning ... + CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" + // CommissionedStateProvisioned ... + CommissionedStateProvisioned CommissionedState = "Provisioned" + // CommissionedStateProvisioning ... + CommissionedStateProvisioning CommissionedState = "Provisioning" ) // PossibleCommissionedStateValues returns an array of possible values for the CommissionedState const type. func PossibleCommissionedStateValues() []CommissionedState { - return []CommissionedState{Commissioned, Commissioning, Decommissioning, Deprovisioning, Provisioned, Provisioning} + return []CommissionedState{CommissionedStateCommissioned, CommissionedStateCommissioning, CommissionedStateDecommissioning, CommissionedStateDeprovisioning, CommissionedStateProvisioned, CommissionedStateProvisioning} } // ConnectionMonitorEndpointFilterItemType enumerates the values for connection monitor endpoint filter item @@ -558,26 +558,26 @@ func PossibleCommissionedStateValues() []CommissionedState { type ConnectionMonitorEndpointFilterItemType string const ( - // AgentAddress ... - AgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" + // ConnectionMonitorEndpointFilterItemTypeAgentAddress ... + ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" ) // PossibleConnectionMonitorEndpointFilterItemTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterItemType const type. func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { - return []ConnectionMonitorEndpointFilterItemType{AgentAddress} + return []ConnectionMonitorEndpointFilterItemType{ConnectionMonitorEndpointFilterItemTypeAgentAddress} } // ConnectionMonitorEndpointFilterType enumerates the values for connection monitor endpoint filter type. type ConnectionMonitorEndpointFilterType string const ( - // Include ... - Include ConnectionMonitorEndpointFilterType = "Include" + // ConnectionMonitorEndpointFilterTypeInclude ... + ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" ) // PossibleConnectionMonitorEndpointFilterTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterType const type. func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { - return []ConnectionMonitorEndpointFilterType{Include} + return []ConnectionMonitorEndpointFilterType{ConnectionMonitorEndpointFilterTypeInclude} } // ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. @@ -619,15 +619,15 @@ func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMoni type ConnectionMonitorType string const ( - // MultiEndpoint ... - MultiEndpoint ConnectionMonitorType = "MultiEndpoint" - // SingleSourceDestination ... - SingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" + // ConnectionMonitorTypeMultiEndpoint ... + ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" + // ConnectionMonitorTypeSingleSourceDestination ... + ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" ) // PossibleConnectionMonitorTypeValues returns an array of possible values for the ConnectionMonitorType const type. func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { - return []ConnectionMonitorType{MultiEndpoint, SingleSourceDestination} + return []ConnectionMonitorType{ConnectionMonitorTypeMultiEndpoint, ConnectionMonitorTypeSingleSourceDestination} } // ConnectionState enumerates the values for connection state. @@ -670,23 +670,23 @@ func PossibleConnectionStatusValues() []ConnectionStatus { type CoverageLevel string const ( - // AboveAverage ... - AboveAverage CoverageLevel = "AboveAverage" - // Average ... - Average CoverageLevel = "Average" - // BelowAverage ... - BelowAverage CoverageLevel = "BelowAverage" - // Default ... - Default CoverageLevel = "Default" - // Full ... - Full CoverageLevel = "Full" - // Low ... - Low CoverageLevel = "Low" + // CoverageLevelAboveAverage ... + CoverageLevelAboveAverage CoverageLevel = "AboveAverage" + // CoverageLevelAverage ... + CoverageLevelAverage CoverageLevel = "Average" + // CoverageLevelBelowAverage ... + CoverageLevelBelowAverage CoverageLevel = "BelowAverage" + // CoverageLevelDefault ... + CoverageLevelDefault CoverageLevel = "Default" + // CoverageLevelFull ... + CoverageLevelFull CoverageLevel = "Full" + // CoverageLevelLow ... + CoverageLevelLow CoverageLevel = "Low" ) // PossibleCoverageLevelValues returns an array of possible values for the CoverageLevel const type. func PossibleCoverageLevelValues() []CoverageLevel { - return []CoverageLevel{AboveAverage, Average, BelowAverage, Default, Full, Low} + return []CoverageLevel{CoverageLevelAboveAverage, CoverageLevelAverage, CoverageLevelBelowAverage, CoverageLevelDefault, CoverageLevelFull, CoverageLevelLow} } // DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. @@ -745,15 +745,15 @@ func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCove type DestinationPortBehavior string const ( - // ListenIfAvailable ... - ListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - // None ... - None DestinationPortBehavior = "None" + // DestinationPortBehaviorListenIfAvailable ... + DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" + // DestinationPortBehaviorNone ... + DestinationPortBehaviorNone DestinationPortBehavior = "None" ) // PossibleDestinationPortBehaviorValues returns an array of possible values for the DestinationPortBehavior const type. func PossibleDestinationPortBehaviorValues() []DestinationPortBehavior { - return []DestinationPortBehavior{ListenIfAvailable, None} + return []DestinationPortBehavior{DestinationPortBehaviorListenIfAvailable, DestinationPortBehaviorNone} } // DhGroup enumerates the values for dh group. @@ -787,15 +787,15 @@ func PossibleDhGroupValues() []DhGroup { type Direction string const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" + // DirectionInbound ... + DirectionInbound Direction = "Inbound" + // DirectionOutbound ... + DirectionOutbound Direction = "Outbound" ) // PossibleDirectionValues returns an array of possible values for the Direction const type. func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} + return []Direction{DirectionInbound, DirectionOutbound} } // EffectiveRouteSource enumerates the values for effective route source. @@ -821,15 +821,15 @@ func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { type EffectiveRouteState string const ( - // Active ... - Active EffectiveRouteState = "Active" - // Invalid ... - Invalid EffectiveRouteState = "Invalid" + // EffectiveRouteStateActive ... + EffectiveRouteStateActive EffectiveRouteState = "Active" + // EffectiveRouteStateInvalid ... + EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" ) // PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{Active, Invalid} + return []EffectiveRouteState{EffectiveRouteStateActive, EffectiveRouteStateInvalid} } // EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. @@ -853,40 +853,40 @@ func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtoc type EndpointType string const ( - // AzureSubnet ... - AzureSubnet EndpointType = "AzureSubnet" - // AzureVM ... - AzureVM EndpointType = "AzureVM" - // AzureVNet ... - AzureVNet EndpointType = "AzureVNet" - // ExternalAddress ... - ExternalAddress EndpointType = "ExternalAddress" - // MMAWorkspaceMachine ... - MMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - // MMAWorkspaceNetwork ... - MMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" + // EndpointTypeAzureSubnet ... + EndpointTypeAzureSubnet EndpointType = "AzureSubnet" + // EndpointTypeAzureVM ... + EndpointTypeAzureVM EndpointType = "AzureVM" + // EndpointTypeAzureVNet ... + EndpointTypeAzureVNet EndpointType = "AzureVNet" + // EndpointTypeExternalAddress ... + EndpointTypeExternalAddress EndpointType = "ExternalAddress" + // EndpointTypeMMAWorkspaceMachine ... + EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" + // EndpointTypeMMAWorkspaceNetwork ... + EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" ) // PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. func PossibleEndpointTypeValues() []EndpointType { - return []EndpointType{AzureSubnet, AzureVM, AzureVNet, ExternalAddress, MMAWorkspaceMachine, MMAWorkspaceNetwork} + return []EndpointType{EndpointTypeAzureSubnet, EndpointTypeAzureVM, EndpointTypeAzureVNet, EndpointTypeExternalAddress, EndpointTypeMMAWorkspaceMachine, EndpointTypeMMAWorkspaceNetwork} } // EvaluationState enumerates the values for evaluation state. type EvaluationState string const ( - // Completed ... - Completed EvaluationState = "Completed" - // InProgress ... - InProgress EvaluationState = "InProgress" - // NotStarted ... - NotStarted EvaluationState = "NotStarted" + // EvaluationStateCompleted ... + EvaluationStateCompleted EvaluationState = "Completed" + // EvaluationStateInProgress ... + EvaluationStateInProgress EvaluationState = "InProgress" + // EvaluationStateNotStarted ... + EvaluationStateNotStarted EvaluationState = "NotStarted" ) // PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{Completed, InProgress, NotStarted} + return []EvaluationState{EvaluationStateCompleted, EvaluationStateInProgress, EvaluationStateNotStarted} } // ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit @@ -894,19 +894,19 @@ func PossibleEvaluationStateValues() []EvaluationState { type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( - // Configured ... - Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring ... - Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured ... - NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded ... - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ... + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ... + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ... + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ... + ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" ) // PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded} } // ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. @@ -928,15 +928,15 @@ func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeerin type ExpressRouteCircuitSkuFamily string const ( - // MeteredData ... - MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData ... - UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" + // ExpressRouteCircuitSkuFamilyMeteredData ... + ExpressRouteCircuitSkuFamilyMeteredData ExpressRouteCircuitSkuFamily = "MeteredData" + // ExpressRouteCircuitSkuFamilyUnlimitedData ... + ExpressRouteCircuitSkuFamilyUnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" ) // PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} + return []ExpressRouteCircuitSkuFamily{ExpressRouteCircuitSkuFamilyMeteredData, ExpressRouteCircuitSkuFamilyUnlimitedData} } // ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. @@ -977,34 +977,34 @@ func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { type ExpressRouteLinkConnectorType string const ( - // LC ... - LC ExpressRouteLinkConnectorType = "LC" - // SC ... - SC ExpressRouteLinkConnectorType = "SC" + // ExpressRouteLinkConnectorTypeLC ... + ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" + // ExpressRouteLinkConnectorTypeSC ... + ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" ) // PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{LC, SC} + return []ExpressRouteLinkConnectorType{ExpressRouteLinkConnectorTypeLC, ExpressRouteLinkConnectorTypeSC} } // ExpressRouteLinkMacSecCipher enumerates the values for express route link mac sec cipher. type ExpressRouteLinkMacSecCipher string const ( - // GcmAes128 ... - GcmAes128 ExpressRouteLinkMacSecCipher = "GcmAes128" - // GcmAes256 ... - GcmAes256 ExpressRouteLinkMacSecCipher = "GcmAes256" - // GcmAesXpn128 ... - GcmAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - // GcmAesXpn256 ... - GcmAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" + // ExpressRouteLinkMacSecCipherGcmAes128 ... + ExpressRouteLinkMacSecCipherGcmAes128 ExpressRouteLinkMacSecCipher = "GcmAes128" + // ExpressRouteLinkMacSecCipherGcmAes256 ... + ExpressRouteLinkMacSecCipherGcmAes256 ExpressRouteLinkMacSecCipher = "GcmAes256" + // ExpressRouteLinkMacSecCipherGcmAesXpn128 ... + ExpressRouteLinkMacSecCipherGcmAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" + // ExpressRouteLinkMacSecCipherGcmAesXpn256 ... + ExpressRouteLinkMacSecCipherGcmAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" ) // PossibleExpressRouteLinkMacSecCipherValues returns an array of possible values for the ExpressRouteLinkMacSecCipher const type. func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { - return []ExpressRouteLinkMacSecCipher{GcmAes128, GcmAes256, GcmAesXpn128, GcmAesXpn256} + return []ExpressRouteLinkMacSecCipher{ExpressRouteLinkMacSecCipherGcmAes128, ExpressRouteLinkMacSecCipherGcmAes256, ExpressRouteLinkMacSecCipherGcmAesXpn128, ExpressRouteLinkMacSecCipherGcmAesXpn256} } // ExpressRouteLinkMacSecSciState enumerates the values for express route link mac sec sci state. @@ -1041,45 +1041,45 @@ func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { type ExpressRoutePeeringType string const ( - // AzurePrivatePeering ... - AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // AzurePublicPeering ... - AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // MicrosoftPeering ... - MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" + // ExpressRoutePeeringTypeAzurePrivatePeering ... + ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + // ExpressRoutePeeringTypeAzurePublicPeering ... + ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + // ExpressRoutePeeringTypeMicrosoftPeering ... + ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" ) // PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} + return []ExpressRoutePeeringType{ExpressRoutePeeringTypeAzurePrivatePeering, ExpressRoutePeeringTypeAzurePublicPeering, ExpressRoutePeeringTypeMicrosoftPeering} } // ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. type ExpressRoutePortsEncapsulation string const ( - // Dot1Q ... - Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // QinQ ... - QinQ ExpressRoutePortsEncapsulation = "QinQ" + // ExpressRoutePortsEncapsulationDot1Q ... + ExpressRoutePortsEncapsulationDot1Q ExpressRoutePortsEncapsulation = "Dot1Q" + // ExpressRoutePortsEncapsulationQinQ ... + ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" ) // PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} + return []ExpressRoutePortsEncapsulation{ExpressRoutePortsEncapsulationDot1Q, ExpressRoutePortsEncapsulationQinQ} } // ExtendedLocationTypes enumerates the values for extended location types. type ExtendedLocationTypes string const ( - // EdgeZone ... - EdgeZone ExtendedLocationTypes = "EdgeZone" + // ExtendedLocationTypesEdgeZone ... + ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" ) // PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{EdgeZone} + return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} } // FirewallPolicyFilterRuleCollectionActionType enumerates the values for firewall policy filter rule @@ -1141,13 +1141,13 @@ func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyI type FirewallPolicyNatRuleCollectionActionType string const ( - // DNAT ... - DNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" + // FirewallPolicyNatRuleCollectionActionTypeDNAT ... + FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" ) // PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleCollectionActionType const type. func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { - return []FirewallPolicyNatRuleCollectionActionType{DNAT} + return []FirewallPolicyNatRuleCollectionActionType{FirewallPolicyNatRuleCollectionActionTypeDNAT} } // FirewallPolicyRuleApplicationProtocolType enumerates the values for firewall policy rule application @@ -1204,28 +1204,28 @@ func PossibleFirewallPolicySkuTierValues() []FirewallPolicySkuTier { type FlowLogFormatType string const ( - // JSON ... - JSON FlowLogFormatType = "JSON" + // FlowLogFormatTypeJSON ... + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" ) // PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{JSON} + return []FlowLogFormatType{FlowLogFormatTypeJSON} } // HTTPConfigurationMethod enumerates the values for http configuration method. type HTTPConfigurationMethod string const ( - // Get ... - Get HTTPConfigurationMethod = "Get" - // Post ... - Post HTTPConfigurationMethod = "Post" + // HTTPConfigurationMethodGet ... + HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" + // HTTPConfigurationMethodPost ... + HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" ) // PossibleHTTPConfigurationMethodValues returns an array of possible values for the HTTPConfigurationMethod const type. func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { - return []HTTPConfigurationMethod{Get, Post} + return []HTTPConfigurationMethod{HTTPConfigurationMethodGet, HTTPConfigurationMethodPost} } // HTTPMethod enumerates the values for http method. @@ -1283,25 +1283,25 @@ func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnec type IkeEncryption string const ( - // AES128 ... - AES128 IkeEncryption = "AES128" - // AES192 ... - AES192 IkeEncryption = "AES192" - // AES256 ... - AES256 IkeEncryption = "AES256" - // DES ... - DES IkeEncryption = "DES" - // DES3 ... - DES3 IkeEncryption = "DES3" - // GCMAES128 ... - GCMAES128 IkeEncryption = "GCMAES128" - // GCMAES256 ... - GCMAES256 IkeEncryption = "GCMAES256" + // IkeEncryptionAES128 ... + IkeEncryptionAES128 IkeEncryption = "AES128" + // IkeEncryptionAES192 ... + IkeEncryptionAES192 IkeEncryption = "AES192" + // IkeEncryptionAES256 ... + IkeEncryptionAES256 IkeEncryption = "AES256" + // IkeEncryptionDES ... + IkeEncryptionDES IkeEncryption = "DES" + // IkeEncryptionDES3 ... + IkeEncryptionDES3 IkeEncryption = "DES3" + // IkeEncryptionGCMAES128 ... + IkeEncryptionGCMAES128 IkeEncryption = "GCMAES128" + // IkeEncryptionGCMAES256 ... + IkeEncryptionGCMAES256 IkeEncryption = "GCMAES256" ) // PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} + return []IkeEncryption{IkeEncryptionAES128, IkeEncryptionAES192, IkeEncryptionAES256, IkeEncryptionDES, IkeEncryptionDES3, IkeEncryptionGCMAES128, IkeEncryptionGCMAES256} } // IkeIntegrity enumerates the values for ike integrity. @@ -1346,30 +1346,30 @@ func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol type IPAllocationMethod string const ( - // Dynamic ... - Dynamic IPAllocationMethod = "Dynamic" - // Static ... - Static IPAllocationMethod = "Static" + // IPAllocationMethodDynamic ... + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + // IPAllocationMethodStatic ... + IPAllocationMethodStatic IPAllocationMethod = "Static" ) // PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{Dynamic, Static} + return []IPAllocationMethod{IPAllocationMethodDynamic, IPAllocationMethodStatic} } // IPAllocationType enumerates the values for ip allocation type. type IPAllocationType string const ( - // Hypernet ... - Hypernet IPAllocationType = "Hypernet" - // Undefined ... - Undefined IPAllocationType = "Undefined" + // IPAllocationTypeHypernet ... + IPAllocationTypeHypernet IPAllocationType = "Hypernet" + // IPAllocationTypeUndefined ... + IPAllocationTypeUndefined IPAllocationType = "Undefined" ) // PossibleIPAllocationTypeValues returns an array of possible values for the IPAllocationType const type. func PossibleIPAllocationTypeValues() []IPAllocationType { - return []IPAllocationType{Hypernet, Undefined} + return []IPAllocationType{IPAllocationTypeHypernet, IPAllocationTypeUndefined} } // IPFlowProtocol enumerates the values for ip flow protocol. @@ -1443,15 +1443,15 @@ func PossibleIpsecIntegrityValues() []IpsecIntegrity { type IPVersion string const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" + // IPVersionIPv4 ... + IPVersionIPv4 IPVersion = "IPv4" + // IPVersionIPv6 ... + IPVersionIPv6 IPVersion = "IPv6" ) // PossibleIPVersionValues returns an array of possible values for the IPVersion const type. func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} + return []IPVersion{IPVersionIPv4, IPVersionIPv6} } // IssueType enumerates the values for issue type. @@ -1519,15 +1519,15 @@ func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { type LoadBalancerSkuTier string const ( - // Global ... - Global LoadBalancerSkuTier = "Global" - // Regional ... - Regional LoadBalancerSkuTier = "Regional" + // LoadBalancerSkuTierGlobal ... + LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" + // LoadBalancerSkuTierRegional ... + LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" ) // PossibleLoadBalancerSkuTierValues returns an array of possible values for the LoadBalancerSkuTier const type. func PossibleLoadBalancerSkuTierValues() []LoadBalancerSkuTier { - return []LoadBalancerSkuTier{Global, Regional} + return []LoadBalancerSkuTier{LoadBalancerSkuTierGlobal, LoadBalancerSkuTierRegional} } // LoadDistribution enumerates the values for load distribution. @@ -1653,30 +1653,30 @@ func PossibleOriginValues() []Origin { type OutputType string const ( - // Workspace ... - Workspace OutputType = "Workspace" + // OutputTypeWorkspace ... + OutputTypeWorkspace OutputType = "Workspace" ) // PossibleOutputTypeValues returns an array of possible values for the OutputType const type. func PossibleOutputTypeValues() []OutputType { - return []OutputType{Workspace} + return []OutputType{OutputTypeWorkspace} } // OwaspCrsExclusionEntryMatchVariable enumerates the values for owasp crs exclusion entry match variable. type OwaspCrsExclusionEntryMatchVariable string const ( - // RequestArgNames ... - RequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - // RequestCookieNames ... - RequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - // RequestHeaderNames ... - RequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + // OwaspCrsExclusionEntryMatchVariableRequestArgNames ... + OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + // OwaspCrsExclusionEntryMatchVariableRequestCookieNames ... + OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + // OwaspCrsExclusionEntryMatchVariableRequestHeaderNames ... + OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" ) // PossibleOwaspCrsExclusionEntryMatchVariableValues returns an array of possible values for the OwaspCrsExclusionEntryMatchVariable const type. func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{RequestArgNames, RequestCookieNames, RequestHeaderNames} + return []OwaspCrsExclusionEntryMatchVariable{OwaspCrsExclusionEntryMatchVariableRequestArgNames, OwaspCrsExclusionEntryMatchVariableRequestCookieNames, OwaspCrsExclusionEntryMatchVariableRequestHeaderNames} } // OwaspCrsExclusionEntrySelectorMatchOperator enumerates the values for owasp crs exclusion entry selector @@ -1705,21 +1705,21 @@ func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclu type PcError string const ( - // AgentStopped ... - AgentStopped PcError = "AgentStopped" - // CaptureFailed ... - CaptureFailed PcError = "CaptureFailed" - // InternalError ... - InternalError PcError = "InternalError" - // LocalFileFailed ... - LocalFileFailed PcError = "LocalFileFailed" - // StorageFailed ... - StorageFailed PcError = "StorageFailed" + // PcErrorAgentStopped ... + PcErrorAgentStopped PcError = "AgentStopped" + // PcErrorCaptureFailed ... + PcErrorCaptureFailed PcError = "CaptureFailed" + // PcErrorInternalError ... + PcErrorInternalError PcError = "InternalError" + // PcErrorLocalFileFailed ... + PcErrorLocalFileFailed PcError = "LocalFileFailed" + // PcErrorStorageFailed ... + PcErrorStorageFailed PcError = "StorageFailed" ) // PossiblePcErrorValues returns an array of possible values for the PcError const type. func PossiblePcErrorValues() []PcError { - return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} + return []PcError{PcErrorAgentStopped, PcErrorCaptureFailed, PcErrorInternalError, PcErrorLocalFileFailed, PcErrorStorageFailed} } // PcProtocol enumerates the values for pc protocol. @@ -1825,15 +1825,15 @@ func PossibleProbeProtocolValues() []ProbeProtocol { type ProcessorArchitecture string const ( - // Amd64 ... - Amd64 ProcessorArchitecture = "Amd64" - // X86 ... - X86 ProcessorArchitecture = "X86" + // ProcessorArchitectureAmd64 ... + ProcessorArchitectureAmd64 ProcessorArchitecture = "Amd64" + // ProcessorArchitectureX86 ... + ProcessorArchitectureX86 ProcessorArchitecture = "X86" ) // PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{Amd64, X86} + return []ProcessorArchitecture{ProcessorArchitectureAmd64, ProcessorArchitectureX86} } // Protocol enumerates the values for protocol. @@ -1888,19 +1888,19 @@ func PossibleProtocolTypeValues() []ProtocolType { type ProvisioningState string const ( - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Deleting, Failed, Succeeded, Updating} + return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} } // PublicIPAddressSkuName enumerates the values for public ip address sku name. @@ -2024,36 +2024,36 @@ func PossibleRoutingStateValues() []RoutingState { type RuleCollectionType string const ( - // RuleCollectionTypeFirewallPolicyFilterRuleCollection ... - RuleCollectionTypeFirewallPolicyFilterRuleCollection RuleCollectionType = "FirewallPolicyFilterRuleCollection" - // RuleCollectionTypeFirewallPolicyNatRuleCollection ... - RuleCollectionTypeFirewallPolicyNatRuleCollection RuleCollectionType = "FirewallPolicyNatRuleCollection" - // RuleCollectionTypeFirewallPolicyRuleCollection ... - RuleCollectionTypeFirewallPolicyRuleCollection RuleCollectionType = "FirewallPolicyRuleCollection" + // RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection ... + RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection RuleCollectionType = "FirewallPolicyFilterRuleCollection" + // RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection ... + RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection RuleCollectionType = "FirewallPolicyNatRuleCollection" + // RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection ... + RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection RuleCollectionType = "FirewallPolicyRuleCollection" ) // PossibleRuleCollectionTypeValues returns an array of possible values for the RuleCollectionType const type. func PossibleRuleCollectionTypeValues() []RuleCollectionType { - return []RuleCollectionType{RuleCollectionTypeFirewallPolicyFilterRuleCollection, RuleCollectionTypeFirewallPolicyNatRuleCollection, RuleCollectionTypeFirewallPolicyRuleCollection} + return []RuleCollectionType{RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection, RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection, RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection} } // RuleType enumerates the values for rule type. type RuleType string const ( - // RuleTypeApplicationRule ... - RuleTypeApplicationRule RuleType = "ApplicationRule" - // RuleTypeFirewallPolicyRule ... - RuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" - // RuleTypeNatRule ... - RuleTypeNatRule RuleType = "NatRule" - // RuleTypeNetworkRule ... - RuleTypeNetworkRule RuleType = "NetworkRule" + // RuleTypeRuleTypeApplicationRule ... + RuleTypeRuleTypeApplicationRule RuleType = "ApplicationRule" + // RuleTypeRuleTypeFirewallPolicyRule ... + RuleTypeRuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" + // RuleTypeRuleTypeNatRule ... + RuleTypeRuleTypeNatRule RuleType = "NatRule" + // RuleTypeRuleTypeNetworkRule ... + RuleTypeRuleTypeNetworkRule RuleType = "NetworkRule" ) // PossibleRuleTypeValues returns an array of possible values for the RuleType const type. func PossibleRuleTypeValues() []RuleType { - return []RuleType{RuleTypeApplicationRule, RuleTypeFirewallPolicyRule, RuleTypeNatRule, RuleTypeNetworkRule} + return []RuleType{RuleTypeRuleTypeApplicationRule, RuleTypeRuleTypeFirewallPolicyRule, RuleTypeRuleTypeNatRule, RuleTypeRuleTypeNetworkRule} } // SecurityPartnerProviderConnectionStatus enumerates the values for security partner provider connection @@ -2080,17 +2080,17 @@ func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerPr type SecurityProviderName string const ( - // Checkpoint ... - Checkpoint SecurityProviderName = "Checkpoint" - // IBoss ... - IBoss SecurityProviderName = "IBoss" - // ZScaler ... - ZScaler SecurityProviderName = "ZScaler" + // SecurityProviderNameCheckpoint ... + SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" + // SecurityProviderNameIBoss ... + SecurityProviderNameIBoss SecurityProviderName = "IBoss" + // SecurityProviderNameZScaler ... + SecurityProviderNameZScaler SecurityProviderName = "ZScaler" ) // PossibleSecurityProviderNameValues returns an array of possible values for the SecurityProviderName const type. func PossibleSecurityProviderNameValues() []SecurityProviderName { - return []SecurityProviderName{Checkpoint, IBoss, ZScaler} + return []SecurityProviderName{SecurityProviderNameCheckpoint, SecurityProviderNameIBoss, SecurityProviderNameZScaler} } // SecurityRuleAccess enumerates the values for security rule access. @@ -2255,15 +2255,15 @@ func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGateway type VirtualNetworkGatewayConnectionProtocol string const ( - // IKEv1 ... - IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // IKEv2 ... - IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" + // VirtualNetworkGatewayConnectionProtocolIKEv1 ... + VirtualNetworkGatewayConnectionProtocolIKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + // VirtualNetworkGatewayConnectionProtocolIKEv2 ... + VirtualNetworkGatewayConnectionProtocolIKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" ) // PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} + return []VirtualNetworkGatewayConnectionProtocol{VirtualNetworkGatewayConnectionProtocolIKEv1, VirtualNetworkGatewayConnectionProtocolIKEv2} } // VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. @@ -2289,19 +2289,19 @@ func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatew type VirtualNetworkGatewayConnectionType string const ( - // ExpressRoute ... - ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec ... - IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet ... - Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient ... - VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + // VirtualNetworkGatewayConnectionTypeExpressRoute ... + VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + // VirtualNetworkGatewayConnectionTypeIPsec ... + VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" + // VirtualNetworkGatewayConnectionTypeVnet2Vnet ... + VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" + // VirtualNetworkGatewayConnectionTypeVPNClient ... + VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" ) // PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} + return []VirtualNetworkGatewayConnectionType{VirtualNetworkGatewayConnectionTypeExpressRoute, VirtualNetworkGatewayConnectionTypeIPsec, VirtualNetworkGatewayConnectionTypeVnet2Vnet, VirtualNetworkGatewayConnectionTypeVPNClient} } // VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. @@ -2428,53 +2428,85 @@ func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} } +// VirtualNetworkPrivateEndpointNetworkPolicies enumerates the values for virtual network private endpoint +// network policies. +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + // VirtualNetworkPrivateEndpointNetworkPoliciesDisabled ... + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + // VirtualNetworkPrivateEndpointNetworkPoliciesEnabled ... + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +// PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues returns an array of possible values for the VirtualNetworkPrivateEndpointNetworkPolicies const type. +func PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetworkPrivateEndpointNetworkPolicies { + return []VirtualNetworkPrivateEndpointNetworkPolicies{VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, VirtualNetworkPrivateEndpointNetworkPoliciesEnabled} +} + +// VirtualNetworkPrivateLinkServiceNetworkPolicies enumerates the values for virtual network private link +// service network policies. +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + // VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled ... + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + // VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled ... + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +// PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues returns an array of possible values for the VirtualNetworkPrivateLinkServiceNetworkPolicies const type. +func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNetworkPrivateLinkServiceNetworkPolicies { + return []VirtualNetworkPrivateLinkServiceNetworkPolicies{VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled} +} + // VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. type VirtualWanSecurityProviderType string const ( - // External ... - External VirtualWanSecurityProviderType = "External" - // Native ... - Native VirtualWanSecurityProviderType = "Native" + // VirtualWanSecurityProviderTypeExternal ... + VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" + // VirtualWanSecurityProviderTypeNative ... + VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" ) // PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{External, Native} + return []VirtualWanSecurityProviderType{VirtualWanSecurityProviderTypeExternal, VirtualWanSecurityProviderTypeNative} } // VpnAuthenticationType enumerates the values for vpn authentication type. type VpnAuthenticationType string const ( - // AAD ... - AAD VpnAuthenticationType = "AAD" - // Certificate ... - Certificate VpnAuthenticationType = "Certificate" - // Radius ... - Radius VpnAuthenticationType = "Radius" + // VpnAuthenticationTypeAAD ... + VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" + // VpnAuthenticationTypeCertificate ... + VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" + // VpnAuthenticationTypeRadius ... + VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" ) // PossibleVpnAuthenticationTypeValues returns an array of possible values for the VpnAuthenticationType const type. func PossibleVpnAuthenticationTypeValues() []VpnAuthenticationType { - return []VpnAuthenticationType{AAD, Certificate, Radius} + return []VpnAuthenticationType{VpnAuthenticationTypeAAD, VpnAuthenticationTypeCertificate, VpnAuthenticationTypeRadius} } // VpnClientProtocol enumerates the values for vpn client protocol. type VpnClientProtocol string const ( - // IkeV2 ... - IkeV2 VpnClientProtocol = "IkeV2" - // OpenVPN ... - OpenVPN VpnClientProtocol = "OpenVPN" - // SSTP ... - SSTP VpnClientProtocol = "SSTP" + // VpnClientProtocolIkeV2 ... + VpnClientProtocolIkeV2 VpnClientProtocol = "IkeV2" + // VpnClientProtocolOpenVPN ... + VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" + // VpnClientProtocolSSTP ... + VpnClientProtocolSSTP VpnClientProtocol = "SSTP" ) // PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} + return []VpnClientProtocol{VpnClientProtocolIkeV2, VpnClientProtocolOpenVPN, VpnClientProtocolSSTP} } // VpnConnectionStatus enumerates the values for vpn connection status. @@ -2528,19 +2560,66 @@ func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} } +// VpnLinkConnectionMode enumerates the values for vpn link connection mode. +type VpnLinkConnectionMode string + +const ( + // VpnLinkConnectionModeDefault ... + VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" + // VpnLinkConnectionModeInitiatorOnly ... + VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" + // VpnLinkConnectionModeResponderOnly ... + VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" +) + +// PossibleVpnLinkConnectionModeValues returns an array of possible values for the VpnLinkConnectionMode const type. +func PossibleVpnLinkConnectionModeValues() []VpnLinkConnectionMode { + return []VpnLinkConnectionMode{VpnLinkConnectionModeDefault, VpnLinkConnectionModeInitiatorOnly, VpnLinkConnectionModeResponderOnly} +} + +// VpnNatRuleMode enumerates the values for vpn nat rule mode. +type VpnNatRuleMode string + +const ( + // VpnNatRuleModeEgressSnat ... + VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" + // VpnNatRuleModeIngressSnat ... + VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" +) + +// PossibleVpnNatRuleModeValues returns an array of possible values for the VpnNatRuleMode const type. +func PossibleVpnNatRuleModeValues() []VpnNatRuleMode { + return []VpnNatRuleMode{VpnNatRuleModeEgressSnat, VpnNatRuleModeIngressSnat} +} + +// VpnNatRuleType enumerates the values for vpn nat rule type. +type VpnNatRuleType string + +const ( + // VpnNatRuleTypeDynamic ... + VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" + // VpnNatRuleTypeStatic ... + VpnNatRuleTypeStatic VpnNatRuleType = "Static" +) + +// PossibleVpnNatRuleTypeValues returns an array of possible values for the VpnNatRuleType const type. +func PossibleVpnNatRuleTypeValues() []VpnNatRuleType { + return []VpnNatRuleType{VpnNatRuleTypeDynamic, VpnNatRuleTypeStatic} +} + // VpnType enumerates the values for vpn type. type VpnType string const ( - // PolicyBased ... - PolicyBased VpnType = "PolicyBased" - // RouteBased ... - RouteBased VpnType = "RouteBased" + // VpnTypePolicyBased ... + VpnTypePolicyBased VpnType = "PolicyBased" + // VpnTypeRouteBased ... + VpnTypeRouteBased VpnType = "RouteBased" ) // PossibleVpnTypeValues returns an array of possible values for the VpnType const type. func PossibleVpnTypeValues() []VpnType { - return []VpnType{PolicyBased, RouteBased} + return []VpnType{VpnTypePolicyBased, VpnTypeRouteBased} } // WebApplicationFirewallAction enumerates the values for web application firewall action. @@ -2579,27 +2658,27 @@ func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewall type WebApplicationFirewallMatchVariable string const ( - // PostArgs ... - PostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // QueryString ... - QueryString WebApplicationFirewallMatchVariable = "QueryString" - // RemoteAddr ... - RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // RequestBody ... - RequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // RequestCookies ... - RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // RequestHeaders ... - RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // RequestMethod ... - RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // RequestURI ... - RequestURI WebApplicationFirewallMatchVariable = "RequestUri" + // WebApplicationFirewallMatchVariablePostArgs ... + WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" + // WebApplicationFirewallMatchVariableQueryString ... + WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" + // WebApplicationFirewallMatchVariableRemoteAddr ... + WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + // WebApplicationFirewallMatchVariableRequestBody ... + WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // WebApplicationFirewallMatchVariableRequestCookies ... + WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + // WebApplicationFirewallMatchVariableRequestHeaders ... + WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + // WebApplicationFirewallMatchVariableRequestMethod ... + WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + // WebApplicationFirewallMatchVariableRequestURI ... + WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" ) // PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} + return []WebApplicationFirewallMatchVariable{WebApplicationFirewallMatchVariablePostArgs, WebApplicationFirewallMatchVariableQueryString, WebApplicationFirewallMatchVariableRemoteAddr, WebApplicationFirewallMatchVariableRequestBody, WebApplicationFirewallMatchVariableRequestCookies, WebApplicationFirewallMatchVariableRequestHeaders, WebApplicationFirewallMatchVariableRequestMethod, WebApplicationFirewallMatchVariableRequestURI} } // WebApplicationFirewallMode enumerates the values for web application firewall mode. @@ -2693,21 +2772,21 @@ func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRule type WebApplicationFirewallTransform string const ( - // HTMLEntityDecode ... - HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // Lowercase ... - Lowercase WebApplicationFirewallTransform = "Lowercase" - // RemoveNulls ... - RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // Trim ... - Trim WebApplicationFirewallTransform = "Trim" - // URLDecode ... - URLDecode WebApplicationFirewallTransform = "UrlDecode" - // URLEncode ... - URLEncode WebApplicationFirewallTransform = "UrlEncode" + // WebApplicationFirewallTransformHTMLEntityDecode ... + WebApplicationFirewallTransformHTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + // WebApplicationFirewallTransformLowercase ... + WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" + // WebApplicationFirewallTransformRemoveNulls ... + WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + // WebApplicationFirewallTransformTrim ... + WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + // WebApplicationFirewallTransformURLDecode ... + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + // WebApplicationFirewallTransformURLEncode ... + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" ) // PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} + return []WebApplicationFirewallTransform{WebApplicationFirewallTransformHTMLEntityDecode, WebApplicationFirewallTransformLowercase, WebApplicationFirewallTransformRemoveNulls, WebApplicationFirewallTransformTrim, WebApplicationFirewallTransformURLDecode, WebApplicationFirewallTransformURLEncode} } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitauthorizations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitauthorizations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitauthorizations.go index 7c15be19bfe9..4808a8a9b59e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitauthorizations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitauthorizations.go @@ -74,7 +74,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitconnections.go index 2ea7cc83b5ed..9a7e5bb94481 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitconnections.go @@ -75,7 +75,7 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client ExpressRouteCircuitConnectionsClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client ExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -332,7 +332,7 @@ func (client ExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitpeerings.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitpeerings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitpeerings.go index 02e5d2b1008d..46d3b67c2ea6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuitpeerings.go @@ -84,7 +84,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,7 +168,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -254,7 +254,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +335,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuits.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuits.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuits.go index 10f8ac9ea995..08cf29830e94 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecircuits.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecircuits.go @@ -70,7 +70,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client ExpressRouteCircuitsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client ExpressRouteCircuitsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -313,7 +313,7 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -389,7 +389,7 @@ func (client ExpressRouteCircuitsClient) GetStatsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -468,7 +468,7 @@ func (client ExpressRouteCircuitsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -581,7 +581,7 @@ func (client ExpressRouteCircuitsClient) ListAllPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -691,7 +691,7 @@ func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -774,7 +774,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -857,7 +857,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -943,7 +943,7 @@ func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteconnections.go index 496113718d0e..5ac7851b58ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteconnections.go @@ -81,7 +81,7 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client ExpressRouteConnectionsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client ExpressRouteConnectionsClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client ExpressRouteConnectionsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnectionpeerings.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnectionpeerings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnectionpeerings.go index 8449b6c3ce16..69589e10c45e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutecrossconnectionpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnectionpeerings.go @@ -86,7 +86,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdatePreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeletePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,7 +255,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) GetPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,7 +336,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) ListPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnections.go index af7f264d11eb..6459eec2a5c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressroutecrossconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutecrossconnections.go @@ -70,7 +70,7 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdatePreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ExpressRouteCrossConnectionsClient) GetPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -234,7 +234,7 @@ func (client ExpressRouteCrossConnectionsClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -345,7 +345,7 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTablePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTablePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -627,7 +627,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -713,7 +713,7 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutegateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutegateways.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutegateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutegateways.go index 7f0389ef1655..e10b4b7fde68 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutegateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutegateways.go @@ -78,7 +78,7 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -389,7 +389,7 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -419,3 +419,84 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http. result.Response = autorest.Response{Response: resp} return } + +// UpdateTags updates express route gateway tags. +// Parameters: +// resourceGroupName - the resource group name of the ExpressRouteGateway. +// expressRouteGatewayName - the name of the gateway. +// expressRouteGatewayParameters - parameters supplied to update a virtual wan express route gateway tags. +func (client ExpressRouteGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (result ExpressRouteGatewaysUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.UpdateTags") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", nil, "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client ExpressRouteGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), + autorest.WithJSON(expressRouteGatewayParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRouteGatewaysClient) UpdateTagsSender(req *http.Request) (future ExpressRouteGatewaysUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client ExpressRouteGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutelinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutelinks.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutelinks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutelinks.go index 736a16d07802..6772a6a5f672 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/expressroutelinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressroutelinks.go @@ -78,7 +78,7 @@ func (client ExpressRouteLinksClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteLinksClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteports.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteports.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteports.go index 622506c2118c..aacece3e1ecd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteports.go @@ -71,7 +71,7 @@ func (client ExpressRoutePortsClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRoutePortsClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client ExpressRoutePortsClient) GenerateLOAPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client ExpressRoutePortsClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -397,7 +397,7 @@ func (client ExpressRoutePortsClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -513,7 +513,7 @@ func (client ExpressRoutePortsClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -627,7 +627,7 @@ func (client ExpressRoutePortsClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteportslocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteportslocations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteportslocations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteportslocations.go index 7d412f872a50..c799bd1787a6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteportslocations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteportslocations.go @@ -75,7 +75,7 @@ func (client ExpressRoutePortsLocationsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRoutePortsLocationsClient) ListPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteserviceproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteserviceproviders.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteserviceproviders.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteserviceproviders.go index 90d28156f219..1849ec2326de 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/expressrouteserviceproviders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/expressrouteserviceproviders.go @@ -76,7 +76,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicies.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicies.go index 96d7b990c23a..4012596874df 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicies.go @@ -70,7 +70,7 @@ func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +431,7 @@ func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicyrulecollectiongroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicyrulecollectiongroups.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicyrulecollectiongroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicyrulecollectiongroups.go index 56416ea4d081..25a991ac378a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/firewallpolicyrulecollectiongroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/firewallpolicyrulecollectiongroups.go @@ -85,7 +85,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdatePreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) DeletePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,7 +255,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,7 +336,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/flowlogs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/flowlogs.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/flowlogs.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/flowlogs.go index 7e1f1a41b069..5d69386ba346 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/flowlogs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/flowlogs.go @@ -81,7 +81,7 @@ func (client FlowLogsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client FlowLogsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client FlowLogsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -331,7 +331,7 @@ func (client FlowLogsClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -447,7 +447,7 @@ func (client FlowLogsClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubroutetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubroutetables.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubroutetables.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubroutetables.go index b7008cd4718f..e96db20a5f83 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubroutetables.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubroutetables.go @@ -71,7 +71,7 @@ func (client HubRouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client HubRouteTablesClient) DeletePreparer(ctx context.Context, resourceG "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client HubRouteTablesClient) GetPreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +322,7 @@ func (client HubRouteTablesClient) ListPreparer(ctx context.Context, resourceGro "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubvirtualnetworkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubvirtualnetworkconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubvirtualnetworkconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubvirtualnetworkconnections.go index 3de6e7fb5337..2c57747c812a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/hubvirtualnetworkconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/hubvirtualnetworkconnections.go @@ -73,7 +73,7 @@ func (client HubVirtualNetworkConnectionsClient) CreateOrUpdatePreparer(ctx cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client HubVirtualNetworkConnectionsClient) DeletePreparer(ctx context.Cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Contex "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundnatrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundnatrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundnatrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundnatrules.go index ca16c5deec71..7853cd12ffef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundnatrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundnatrules.go @@ -95,7 +95,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -179,7 +179,7 @@ func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +266,7 @@ func (client InboundNatRulesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -350,7 +350,7 @@ func (client InboundNatRulesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundsecurityrule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundsecurityrule.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundsecurityrule.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundsecurityrule.go index 1f95c58b8e22..2ae1009956b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/inboundsecurityrule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/inboundsecurityrule.go @@ -73,7 +73,7 @@ func (client InboundSecurityRuleClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceipconfigurations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceipconfigurations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceipconfigurations.go index e9675265dc4f..6dd1d2654c02 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfaceipconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceipconfigurations.go @@ -78,7 +78,7 @@ func (client InterfaceIPConfigurationsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client InterfaceIPConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceloadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceloadbalancers.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceloadbalancers.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceloadbalancers.go index 4e98cec0b51f..57329deb9b82 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/interfaceloadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfaceloadbalancers.go @@ -81,7 +81,7 @@ func (client InterfaceLoadBalancersClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacesgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacesgroup.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacesgroup.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacesgroup.go index e24e0614e368..c7494ac93b08 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacesgroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacesgroup.go @@ -52,7 +52,15 @@ func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "parameters.ExtendedLocation", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { + }}, + {Target: "parameters.InterfacePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.PrivateEndpoint", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.PrivateEndpoint.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.PrivateEndpoint.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.InterfacePropertiesFormat.PrivateEndpoint.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("network.InterfacesClient", "CreateOrUpdate", err.Error()) } @@ -79,7 +87,7 @@ func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +168,7 @@ func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +253,7 @@ func (client InterfacesClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -283,7 +291,7 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa // Parameters: // resourceGroupName - the name of the resource group. // cloudServiceName - the name of the cloud service. -// roleInstanceName - the name of role instance +// roleInstanceName - the name of role instance. // networkInterfaceName - the name of the network interface. // expand - expands referenced resources. func (client InterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, expand string) (result Interface, err error) { @@ -329,7 +337,7 @@ func (client InterfacesClient) GetCloudServiceNetworkInterfacePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -401,7 +409,7 @@ func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -660,7 +668,7 @@ func (client InterfacesClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -773,7 +781,7 @@ func (client InterfacesClient) ListAllPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -891,7 +899,7 @@ func (client InterfacesClient) ListCloudServiceNetworkInterfacesPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -960,7 +968,7 @@ func (client InterfacesClient) ListCloudServiceNetworkInterfacesComplete(ctx con } // ListCloudServiceRoleInstanceNetworkInterfaces gets information about all network interfaces in a role instance in a -// cloud service +// cloud service. // Parameters: // resourceGroupName - the name of the resource group. // cloudServiceName - the name of the cloud service. @@ -1012,7 +1020,7 @@ func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesPrep "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1118,7 +1126,7 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1570,7 +1578,7 @@ func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacetapconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacetapconfigurations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacetapconfigurations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacetapconfigurations.go index 1357d1a9cc6f..147a80484b98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/interfacetapconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/interfacetapconfigurations.go @@ -116,7 +116,7 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdatePreparer(ctx contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,7 +200,7 @@ func (client InterfaceTapConfigurationsClient) DeletePreparer(ctx context.Contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,7 +286,7 @@ func (client InterfaceTapConfigurationsClient) GetPreparer(ctx context.Context, "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,7 +367,7 @@ func (client InterfaceTapConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipallocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipallocations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipallocations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipallocations.go index 57b94300c811..0b560b138078 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/ipallocations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipallocations.go @@ -69,7 +69,7 @@ func (client IPAllocationsClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client IPAllocationsClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client IPAllocationsClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client IPAllocationsClient) ListPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client IPAllocationsClient) ListByResourceGroupPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client IPAllocationsClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipgroups.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipgroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipgroups.go index 0893befe64fe..8a3d09b0bc96 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/ipgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/ipgroups.go @@ -69,7 +69,7 @@ func (client IPGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client IPGroupsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client IPGroupsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client IPGroupsClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +431,7 @@ func (client IPGroupsClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -545,7 +545,7 @@ func (client IPGroupsClient) UpdateGroupsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerbackendaddresspools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerbackendaddresspools.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerbackendaddresspools.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerbackendaddresspools.go index c2c6fb08b2b2..f09419e8c8fe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerbackendaddresspools.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerbackendaddresspools.go @@ -72,7 +72,7 @@ func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdatePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client LoadBalancerBackendAddressPoolsClient) DeletePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerfrontendipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerfrontendipconfigurations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerfrontendipconfigurations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerfrontendipconfigurations.go index f26bdcf98afb..694853a0b7ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerfrontendipconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerfrontendipconfigurations.go @@ -79,7 +79,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerloadbalancingrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerloadbalancingrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerloadbalancingrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerloadbalancingrules.go index 16527132751b..46ecd7abfe57 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancerloadbalancingrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerloadbalancingrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancernetworkinterfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancernetworkinterfaces.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancernetworkinterfaces.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancernetworkinterfaces.go index b6ae17974979..d73de3b0cb78 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancernetworkinterfaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancernetworkinterfaces.go @@ -81,7 +81,7 @@ func (client LoadBalancerNetworkInterfacesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalanceroutboundrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalanceroutboundrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalanceroutboundrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalanceroutboundrules.go index feb21700061b..00fcb69dede2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalanceroutboundrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalanceroutboundrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerOutboundRulesClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerOutboundRulesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerprobes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerprobes.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerprobes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerprobes.go index 44614387e390..fd2ca3855c97 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/loadbalancerprobes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancerprobes.go @@ -78,7 +78,7 @@ func (client LoadBalancerProbesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerProbesClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancers.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancers.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancers.go index e920663cf9fb..6cf7f0606ba5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/loadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/loadbalancers.go @@ -79,7 +79,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,7 +440,7 @@ func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -554,7 +554,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/localnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/localnetworkgateways.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/localnetworkgateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/localnetworkgateways.go index 663bbdfec1ba..ab8beec837e3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/localnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/localnetworkgateways.go @@ -86,7 +86,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -342,7 +342,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -462,7 +462,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/models.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/models.go index cdfce8bb4bad..f911270fade0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network" // AadAuthenticationParameters AAD Vpn authentication type related parameters. type AadAuthenticationParameters struct { @@ -274,7 +274,7 @@ func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []by type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { // Data - Certificate public data. Data *string `json:"data,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -405,7 +405,7 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { // PredefinedPolicies - List of available Ssl predefined policy. PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` - // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S' DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` // AvailableCipherSuites - List of available Ssl cipher suites. AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` @@ -687,7 +687,7 @@ type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` // BackendAddresses - Backend addresses. BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -738,7 +738,7 @@ type ApplicationGatewayBackendHealthServer struct { Address *string `json:"address,omitempty"` // IPConfiguration - Reference to IP configuration of backend server. IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` - // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + // Health - Health of backend server. Possible values include: 'ApplicationGatewayBackendHealthServerHealthUnknown', 'ApplicationGatewayBackendHealthServerHealthUp', 'ApplicationGatewayBackendHealthServerHealthDown', 'ApplicationGatewayBackendHealthServerHealthPartial', 'ApplicationGatewayBackendHealthServerHealthDraining' Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` // HealthProbeLog - Health Probe Log. HealthProbeLog *string `json:"healthProbeLog,omitempty"` @@ -838,9 +838,9 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { // Port - The destination port on the backend. Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS' + // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' + // CookieBasedAffinity - Cookie based affinity. Possible values include: 'ApplicationGatewayCookieBasedAffinityEnabled', 'ApplicationGatewayCookieBasedAffinityDisabled' CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. RequestTimeout *int32 `json:"requestTimeout,omitempty"` @@ -862,7 +862,7 @@ type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { ProbeEnabled *bool `json:"probeEnabled,omitempty"` // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. Path *string `json:"path,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -928,7 +928,7 @@ type ApplicationGatewayConnectionDraining struct { // ApplicationGatewayCustomError customer error of an application gateway. type ApplicationGatewayCustomError struct { - // StatusCode - Status code of the application gateway customer error. Possible values include: 'HTTPStatus403', 'HTTPStatus502' + // StatusCode - Status code of the application gateway customer error. Possible values include: 'ApplicationGatewayCustomErrorStatusCodeHTTPStatus403', 'ApplicationGatewayCustomErrorStatusCodeHTTPStatus502' StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` // CustomErrorPageURL - Error page URL of the application gateway customer error. CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` @@ -1077,7 +1077,7 @@ func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error // ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // RuleSetType - The type of the web application firewall rule set. RuleSetType *string `json:"ruleSetType,omitempty"` @@ -1196,7 +1196,7 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - Reference to the subnet resource. Subnet *SubResource `json:"subnet,omitempty"` @@ -1204,7 +1204,7 @@ type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` // PrivateLinkConfiguration - Reference to the application gateway private link configuration. PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -1322,7 +1322,7 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { type ApplicationGatewayFrontendPortPropertiesFormat struct { // Port - Frontend port. Port *int32 `json:"port,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -1438,7 +1438,7 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` // FrontendPort - Frontend port resource of an application gateway. FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the HTTP listener. Possible values include: 'HTTP', 'HTTPS' + // Protocol - Protocol of the HTTP listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // HostName - Host name of HTTP listener. HostName *string `json:"hostName,omitempty"` @@ -1448,7 +1448,7 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { SslProfile *SubResource `json:"sslProfile,omitempty"` // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CustomErrorConfigurations - Custom error configurations of the HTTP listener. CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` @@ -1589,7 +1589,7 @@ func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error type ApplicationGatewayIPConfigurationPropertiesFormat struct { // Subnet - Reference to the subnet resource. A subnet from where application gateway gets its private address. Subnet *SubResource `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application gateway IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -1763,7 +1763,7 @@ func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNe // ApplicationGatewayOnDemandProbe details of on demand test probe request. type ApplicationGatewayOnDemandProbe struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS' + // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -1882,7 +1882,7 @@ type ApplicationGatewayPathRulePropertiesFormat struct { RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` // RewriteRuleSet - Rewrite rule set resource of URL path map path rule. RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the path rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the path rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // FirewallPolicy - Reference to the FirewallPolicy resource. FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` @@ -2172,7 +2172,7 @@ type ApplicationGatewayPrivateEndpointConnectionProperties struct { PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // LinkIdentifier - READ-ONLY; The consumer link id. LinkIdentifier *string `json:"linkIdentifier,omitempty"` @@ -2361,7 +2361,7 @@ func (agplc *ApplicationGatewayPrivateLinkConfiguration) UnmarshalJSON(body []by type ApplicationGatewayPrivateLinkConfigurationProperties struct { // IPConfigurations - An array of application gateway private link ip configurations. IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -2468,13 +2468,13 @@ func (agplic *ApplicationGatewayPrivateLinkIPConfiguration) UnmarshalJSON(body [ type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - Reference to the subnet resource. Subnet *SubResource `json:"subnet,omitempty"` // Primary - Whether the ip configuration is primary or not. Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link IP configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -2865,7 +2865,7 @@ type ApplicationGatewayProbeHealthResponseMatch struct { // ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. type ApplicationGatewayProbePropertiesFormat struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS' + // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -2883,7 +2883,7 @@ type ApplicationGatewayProbePropertiesFormat struct { MinServers *int32 `json:"minServers,omitempty"` // Match - Criterion for classifying a healthy probe response. Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Port - Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 and WAF_v2 only. Port *int32 `json:"port,omitempty"` @@ -2931,7 +2931,7 @@ type ApplicationGatewayPropertiesFormat struct { Sku *ApplicationGatewaySku `json:"sku,omitempty"` // SslPolicy - SSL policy of the application gateway resource. SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' + // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'ApplicationGatewayOperationalStateStopped', 'ApplicationGatewayOperationalStateStarting', 'ApplicationGatewayOperationalStateRunning', 'ApplicationGatewayOperationalStateStopping' OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` // GatewayIPConfigurations - Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` @@ -2981,7 +2981,7 @@ type ApplicationGatewayPropertiesFormat struct { PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the application gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // CustomErrorConfigurations - Custom error configurations of the application gateway resource. CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` @@ -3165,7 +3165,7 @@ func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) // ApplicationGatewayRedirectConfigurationPropertiesFormat properties of redirect configuration of the // application gateway. type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - // RedirectType - HTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' + // RedirectType - HTTP redirection type. Possible values include: 'ApplicationGatewayRedirectTypePermanent', 'ApplicationGatewayRedirectTypeFound', 'ApplicationGatewayRedirectTypeSeeOther', 'ApplicationGatewayRedirectTypeTemporary' RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` // TargetListener - Reference to a listener to redirect the request to. TargetListener *SubResource `json:"targetListener,omitempty"` @@ -3275,7 +3275,7 @@ func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) er // ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the // application gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' + // RuleType - Rule type. Possible values include: 'ApplicationGatewayRequestRoutingRuleTypeBasic', 'ApplicationGatewayRequestRoutingRuleTypePathBasedRouting' RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` // Priority - Priority of the request routing rule. Priority *int32 `json:"priority,omitempty"` @@ -3291,7 +3291,7 @@ type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` // RedirectConfiguration - Redirect configuration resource of the application gateway. RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -3353,7 +3353,7 @@ type ApplicationGatewayRewriteRuleCondition struct { Variable *string `json:"variable,omitempty"` // Pattern - The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. Pattern *string `json:"pattern,omitempty"` - // IgnoreCase - Setting this paramter to truth value with force the pattern to do a case in-sensitive comparison. + // IgnoreCase - Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. IgnoreCase *bool `json:"ignoreCase,omitempty"` // Negate - Setting this value as truth will force to check the negation of the condition given by the user. Negate *bool `json:"negate,omitempty"` @@ -3442,7 +3442,7 @@ func (agrrs *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(body []byte) error type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { // RewriteRules - Rewrite rules in the rewrite rule set. RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the rewrite rule set resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the rewrite rule set resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -3623,7 +3623,7 @@ func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGateways // ApplicationGatewaySku SKU of an application gateway. type ApplicationGatewaySku struct { - // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'WAFV2' + // Name - Name of an application gateway SKU. Possible values include: 'ApplicationGatewaySkuNameStandardSmall', 'ApplicationGatewaySkuNameStandardMedium', 'ApplicationGatewaySkuNameStandardLarge', 'ApplicationGatewaySkuNameWAFMedium', 'ApplicationGatewaySkuNameWAFLarge', 'ApplicationGatewaySkuNameStandardV2', 'ApplicationGatewaySkuNameWAFV2' Name ApplicationGatewaySkuName `json:"name,omitempty"` // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2' Tier ApplicationGatewayTier `json:"tier,omitempty"` @@ -3731,7 +3731,7 @@ type ApplicationGatewaySslCertificatePropertiesFormat struct { PublicCertData *string `json:"publicCertData,omitempty"` // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the SSL certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the SSL certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -3754,13 +3754,13 @@ func (agscpf ApplicationGatewaySslCertificatePropertiesFormat) MarshalJSON() ([] type ApplicationGatewaySslPolicy struct { // DisabledSslProtocols - Ssl protocols to be disabled on application gateway. DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - // PolicyType - Type of Ssl Policy. Possible values include: 'Predefined', 'Custom' + // PolicyType - Type of Ssl Policy. Possible values include: 'ApplicationGatewaySslPolicyTypePredefined', 'ApplicationGatewaySslPolicyTypeCustom' PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` - // PolicyName - Name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' + // PolicyName - Name of Ssl predefined policy. Possible values include: 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S' PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` // CipherSuites - Ssl cipher suites to be enabled in the specified order to application gateway. CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' + // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'ApplicationGatewaySslProtocolTLSv10', 'ApplicationGatewaySslProtocolTLSv11', 'ApplicationGatewaySslProtocolTLSv12' MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } @@ -3837,7 +3837,7 @@ func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) e type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' + // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'ApplicationGatewaySslProtocolTLSv10', 'ApplicationGatewaySslProtocolTLSv11', 'ApplicationGatewaySslProtocolTLSv12' MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } @@ -3938,7 +3938,7 @@ type ApplicationGatewaySslProfilePropertiesFormat struct { SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` // ClientAuthConfiguration - Client authentication configuration of the application gateway resource. ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -4125,7 +4125,7 @@ func (agtcc *ApplicationGatewayTrustedClientCertificate) UnmarshalJSON(body []by type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { // Data - Certificate public data. Data *string `json:"data,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the trusted client certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the trusted client certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -4234,7 +4234,7 @@ type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { Data *string `json:"data,omitempty"` // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the trusted root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the trusted root certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -4362,7 +4362,7 @@ type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` // PathRules - Path rule of URL path map resource. PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the URL path map resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the URL path map resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -4392,7 +4392,7 @@ func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byt type ApplicationGatewayWebApplicationFirewallConfiguration struct { // Enabled - Whether the web application firewall is enabled or not. Enabled *bool `json:"enabled,omitempty"` - // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' + // FirewallMode - Web application firewall mode. Possible values include: 'ApplicationGatewayFirewallModeDetection', 'ApplicationGatewayFirewallModePrevention' FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. RuleSetType *string `json:"ruleSetType,omitempty"` @@ -4436,13 +4436,13 @@ type ApplicationRule struct { Name *string `json:"name,omitempty"` // Description - Description of the rule. Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' + // RuleType - Possible values include: 'RuleTypeRuleTypeFirewallPolicyRule', 'RuleTypeRuleTypeApplicationRule', 'RuleTypeRuleTypeNatRule', 'RuleTypeRuleTypeNetworkRule' RuleType RuleType `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for ApplicationRule. func (ar ApplicationRule) MarshalJSON() ([]byte, error) { - ar.RuleType = RuleTypeApplicationRule + ar.RuleType = RuleTypeRuleTypeApplicationRule objectMap := make(map[string]interface{}) if ar.SourceAddresses != nil { objectMap["sourceAddresses"] = ar.SourceAddresses @@ -4796,7 +4796,7 @@ func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListR type ApplicationSecurityGroupPropertiesFormat struct { // ResourceGUID - READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -5045,9 +5045,9 @@ func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage fun type AuthorizationPropertiesFormat struct { // AuthorizationKey - The authorization key. AuthorizationKey *string `json:"authorizationKey,omitempty"` - // AuthorizationUseStatus - The authorization use status. Possible values include: 'Available', 'InUse' + // AuthorizationUseStatus - The authorization use status. Possible values include: 'AuthorizationUseStatusAvailable', 'AuthorizationUseStatusInUse' AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -6088,7 +6088,7 @@ type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { Action *AzureFirewallRCAction `json:"action,omitempty"` // Rules - Collection of rules used by a application rule collection. Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the application rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -6391,7 +6391,7 @@ func NewAzureFirewallFqdnTagListResultPage(cur AzureFirewallFqdnTagListResult, g // AzureFirewallFqdnTagPropertiesFormat azure Firewall FQDN Tag Properties. type AzureFirewallFqdnTagPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // FqdnTagName - READ-ONLY; The name of this FQDN Tag. FqdnTagName *string `json:"fqdnTagName,omitempty"` @@ -6494,7 +6494,7 @@ type AzureFirewallIPConfigurationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` // PublicIPAddress - Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -6679,7 +6679,7 @@ func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage fun // AzureFirewallNatRCAction azureFirewall NAT Rule Collection Action. type AzureFirewallNatRCAction struct { - // Type - The type of action. Possible values include: 'Snat', 'Dnat' + // Type - The type of action. Possible values include: 'AzureFirewallNatRCActionTypeSnat', 'AzureFirewallNatRCActionTypeDnat' Type AzureFirewallNatRCActionType `json:"type,omitempty"` } @@ -6793,7 +6793,7 @@ type AzureFirewallNatRuleCollectionProperties struct { Action *AzureFirewallNatRCAction `json:"action,omitempty"` // Rules - Collection of rules used by a NAT rule collection. Rules *[]AzureFirewallNatRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the NAT rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -6920,7 +6920,7 @@ type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { Action *AzureFirewallRCAction `json:"action,omitempty"` // Rules - Collection of rules used by a network rule collection. Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network rule collection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -6951,7 +6951,7 @@ type AzureFirewallPropertiesFormat struct { IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` // ManagementIPConfiguration - IP configuration of the Azure Firewall used for management traffic. ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ThreatIntelMode - The operation mode for Threat Intelligence. Possible values include: 'AzureFirewallThreatIntelModeAlert', 'AzureFirewallThreatIntelModeDeny', 'AzureFirewallThreatIntelModeOff' ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` @@ -7102,9 +7102,9 @@ func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (a // AzureFirewallSku SKU of an Azure Firewall. type AzureFirewallSku struct { - // Name - Name of an Azure Firewall SKU. Possible values include: 'AZFWVNet', 'AZFWHub' + // Name - Name of an Azure Firewall SKU. Possible values include: 'AzureFirewallSkuNameAZFWVNet', 'AzureFirewallSkuNameAZFWHub' Name AzureFirewallSkuName `json:"name,omitempty"` - // Tier - Tier of an Azure Firewall. Possible values include: 'Standard', 'Premium' + // Tier - Tier of an Azure Firewall. Possible values include: 'AzureFirewallSkuTierStandard', 'AzureFirewallSkuTierPremium' Tier AzureFirewallSkuTier `json:"tier,omitempty"` } @@ -7548,6 +7548,8 @@ func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { // BackendAddressPoolPropertiesFormat properties of the backend address pool. type BackendAddressPoolPropertiesFormat struct { + // Location - The location of the backend address pool. + Location *string `json:"location,omitempty"` // LoadBalancerBackendAddresses - An array of backend addresses. LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` // BackendIPConfigurations - READ-ONLY; An array of references to IP addresses defined in network interfaces. @@ -7558,13 +7560,16 @@ type BackendAddressPoolPropertiesFormat struct { OutboundRule *SubResource `json:"outboundRule,omitempty"` // OutboundRules - READ-ONLY; An array of references to outbound rules that use this backend address pool. OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } // MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if bappf.Location != nil { + objectMap["location"] = bappf.Location + } if bappf.LoadBalancerBackendAddresses != nil { objectMap["loadBalancerBackendAddresses"] = bappf.LoadBalancerBackendAddresses } @@ -7589,7 +7594,7 @@ type BastionActiveSession struct { UserName *string `json:"userName,omitempty"` // TargetIPAddress - READ-ONLY; The IP Address of the target. TargetIPAddress *string `json:"targetIpAddress,omitempty"` - // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'SSH', 'RDP' + // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'BastionConnectProtocolSSH', 'BastionConnectProtocolRDP' Protocol BastionConnectProtocol `json:"protocol,omitempty"` // TargetResourceID - READ-ONLY; The resource id of the target. TargetResourceID *string `json:"targetResourceId,omitempty"` @@ -7967,9 +7972,9 @@ type BastionHostIPConfigurationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` // PublicIPAddress - Reference of the PublicIP resource. PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the bastion host IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` } @@ -8153,7 +8158,7 @@ type BastionHostPropertiesFormat struct { IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` // DNSName - FQDN for the endpoint on which bastion host is accessible. DNSName *string `json:"dnsName,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the bastion host resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -8717,7 +8722,7 @@ type BgpConnectionProperties struct { PeerAsn *int64 `json:"peerAsn,omitempty"` // PeerIP - Peer IP. PeerIP *string `json:"peerIp,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ConnectionState - READ-ONLY; The current state of the VirtualHub to Peer. Possible values include: 'HubBgpConnectionStatusUnknown', 'HubBgpConnectionStatusConnecting', 'HubBgpConnectionStatusConnected', 'HubBgpConnectionStatusNotConnected' ConnectionState HubBgpConnectionStatus `json:"connectionState,omitempty"` @@ -9092,7 +9097,7 @@ type ConfigurationDiagnosticParameters struct { // ConfigurationDiagnosticProfile parameters to compare with network configuration. type ConfigurationDiagnosticProfile struct { - // Direction - The direction of the traffic. Possible values include: 'Inbound', 'Outbound' + // Direction - The direction of the traffic. Possible values include: 'DirectionInbound', 'DirectionOutbound' Direction Direction `json:"direction,omitempty"` // Protocol - Protocol to be verified on. Accepted values are '*', TCP, UDP. Protocol *string `json:"protocol,omitempty"` @@ -9201,7 +9206,7 @@ type ConnectionMonitorDestination struct { type ConnectionMonitorEndpoint struct { // Name - The name of the connection monitor endpoint. Name *string `json:"name,omitempty"` - // Type - The endpoint type. Possible values include: 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork' + // Type - The endpoint type. Possible values include: 'EndpointTypeAzureVM', 'EndpointTypeAzureVNet', 'EndpointTypeAzureSubnet', 'EndpointTypeExternalAddress', 'EndpointTypeMMAWorkspaceMachine', 'EndpointTypeMMAWorkspaceNetwork' Type EndpointType `json:"type,omitempty"` // ResourceID - Resource ID of the connection monitor endpoint. ResourceID *string `json:"resourceId,omitempty"` @@ -9211,13 +9216,13 @@ type ConnectionMonitorEndpoint struct { Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` // Scope - Endpoint scope. Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - // CoverageLevel - Test coverage for the endpoint. Possible values include: 'Default', 'Low', 'BelowAverage', 'Average', 'AboveAverage', 'Full' + // CoverageLevel - Test coverage for the endpoint. Possible values include: 'CoverageLevelDefault', 'CoverageLevelLow', 'CoverageLevelBelowAverage', 'CoverageLevelAverage', 'CoverageLevelAboveAverage', 'CoverageLevelFull' CoverageLevel CoverageLevel `json:"coverageLevel,omitempty"` } // ConnectionMonitorEndpointFilter describes the connection monitor endpoint filter. type ConnectionMonitorEndpointFilter struct { - // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'Include' + // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'ConnectionMonitorEndpointFilterTypeInclude' Type ConnectionMonitorEndpointFilterType `json:"type,omitempty"` // Items - List of items in the filter. Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` @@ -9225,7 +9230,7 @@ type ConnectionMonitorEndpointFilter struct { // ConnectionMonitorEndpointFilterItem describes the connection monitor endpoint filter item. type ConnectionMonitorEndpointFilterItem struct { - // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'AgentAddress' + // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'ConnectionMonitorEndpointFilterItemTypeAgentAddress' Type ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` // Address - The address of the filter item. Address *string `json:"address,omitempty"` @@ -9249,7 +9254,7 @@ type ConnectionMonitorEndpointScopeItem struct { type ConnectionMonitorHTTPConfiguration struct { // Port - The port to connect to. Port *int32 `json:"port,omitempty"` - // Method - The HTTP method to use. Possible values include: 'Get', 'Post' + // Method - The HTTP method to use. Possible values include: 'HTTPConfigurationMethodGet', 'HTTPConfigurationMethodPost' Method HTTPConfigurationMethod `json:"method,omitempty"` // Path - The path component of the URI. For instance, "/dir1/dir2". Path *string `json:"path,omitempty"` @@ -9276,7 +9281,7 @@ type ConnectionMonitorListResult struct { // ConnectionMonitorOutput describes a connection monitor output destination. type ConnectionMonitorOutput struct { - // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'Workspace' + // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'OutputTypeWorkspace' Type OutputType `json:"type,omitempty"` // WorkspaceSettings - Describes the settings for producing output into a log analytics workspace. WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` @@ -9427,13 +9432,13 @@ func (cmr *ConnectionMonitorResult) UnmarshalJSON(body []byte) error { // ConnectionMonitorResultProperties describes the properties of a connection monitor. type ConnectionMonitorResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the connection monitor. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // StartTime - READ-ONLY; The date and time when the connection monitor was started. StartTime *date.Time `json:"startTime,omitempty"` // MonitoringStatus - READ-ONLY; The monitoring status of the connection monitor. MonitoringStatus *string `json:"monitoringStatus,omitempty"` - // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' + // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'ConnectionMonitorTypeMultiEndpoint', 'ConnectionMonitorTypeSingleSourceDestination' ConnectionMonitorType ConnectionMonitorType `json:"connectionMonitorType,omitempty"` // Source - Describes the source of connection monitor. Source *ConnectionMonitorSource `json:"source,omitempty"` @@ -9707,7 +9712,7 @@ type ConnectionMonitorTCPConfiguration struct { Port *int32 `json:"port,omitempty"` // DisableTraceRoute - Value indicating whether path evaluation with trace route should be disabled. DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` - // DestinationPortBehavior - Destination port behavior. Possible values include: 'None', 'ListenIfAvailable' + // DestinationPortBehavior - Destination port behavior. Possible values include: 'DestinationPortBehaviorNone', 'DestinationPortBehaviorListenIfAvailable' DestinationPortBehavior DestinationPortBehavior `json:"destinationPortBehavior,omitempty"` } @@ -9776,7 +9781,7 @@ type ConnectionStateSnapshot struct { StartTime *date.Time `json:"startTime,omitempty"` // EndTime - The end time of the connection snapshot. EndTime *date.Time `json:"endTime,omitempty"` - // EvaluationState - Connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed' + // EvaluationState - Connectivity analysis evaluation state. Possible values include: 'EvaluationStateNotStarted', 'EvaluationStateInProgress', 'EvaluationStateCompleted' EvaluationState EvaluationState `json:"evaluationState,omitempty"` // AvgLatencyInMs - Average latency in ms. AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` @@ -9898,7 +9903,7 @@ type ConnectivityParameters struct { Protocol Protocol `json:"protocol,omitempty"` // ProtocolConfiguration - Configuration of the protocol. ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPv4', 'IPv6' + // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PreferredIPVersion IPVersion `json:"preferredIPVersion,omitempty"` } @@ -10101,7 +10106,7 @@ type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` // ContainerNetworkInterfaces - A list of container network interfaces created from this container network interface configuration. ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the container network interface configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -10195,7 +10200,7 @@ func (cniic *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte // ContainerNetworkInterfaceIPConfigurationPropertiesFormat properties of the container network interface // IP configuration. type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the container network interface IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -10207,7 +10212,7 @@ type ContainerNetworkInterfacePropertiesFormat struct { Container *Container `json:"container,omitempty"` // IPConfigurations - READ-ONLY; Reference to the ip configuration on this container nic. IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the container network interface resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -10231,6 +10236,8 @@ type CustomDNSConfigPropertiesFormat struct { // CustomIPPrefix custom IP prefix resource. type CustomIPPrefix struct { autorest.Response `json:"-"` + // ExtendedLocation - The extended location of the custom IP prefix. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` // CustomIPPrefixPropertiesFormat - Custom IP prefix properties. *CustomIPPrefixPropertiesFormat `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -10252,6 +10259,9 @@ type CustomIPPrefix struct { // MarshalJSON is the custom marshaler for CustomIPPrefix. func (cip CustomIPPrefix) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if cip.ExtendedLocation != nil { + objectMap["extendedLocation"] = cip.ExtendedLocation + } if cip.CustomIPPrefixPropertiesFormat != nil { objectMap["properties"] = cip.CustomIPPrefixPropertiesFormat } @@ -10279,6 +10289,15 @@ func (cip *CustomIPPrefix) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + cip.ExtendedLocation = &extendedLocation + } case "properties": if v != nil { var customIPPrefixPropertiesFormat CustomIPPrefixPropertiesFormat @@ -10600,13 +10619,13 @@ func NewCustomIPPrefixListResultPage(cur CustomIPPrefixListResult, getNextPage f type CustomIPPrefixPropertiesFormat struct { // Cidr - The prefix range in CIDR notation. Should include the start address and the prefix length. Cidr *string `json:"cidr,omitempty"` - // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', 'Commissioned', 'Decommissioning', 'Deprovisioning' + // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'CommissionedStateProvisioning', 'CommissionedStateProvisioned', 'CommissionedStateCommissioning', 'CommissionedStateCommissioned', 'CommissionedStateDecommissioning', 'CommissionedStateDeprovisioning' CommissionedState CommissionedState `json:"commissionedState,omitempty"` // PublicIPPrefixes - READ-ONLY; The list of all referenced PublicIpPrefixes. PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the custom IP prefix resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the custom IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the custom IP prefix resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -10821,7 +10840,7 @@ func (dcp *DdosCustomPolicy) UnmarshalJSON(body []byte) error { type DdosCustomPolicyPropertiesFormat struct { // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS custom policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the DDoS custom policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PublicIPAddresses - READ-ONLY; The list of public IPs associated with the DDoS custom policy resource. This list is read-only. PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` @@ -11122,7 +11141,7 @@ func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNe type DdosProtectionPlanPropertiesFormat struct { // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VirtualNetworks - READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` @@ -11760,7 +11779,7 @@ type DscpConfigurationPropertiesFormat struct { AssociatedNetworkInterfaces *[]Interface `json:"associatedNetworkInterfaces,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the DSCP Configuration resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DSCP Configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the DSCP Configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -11887,7 +11906,7 @@ type EffectiveRoute struct { DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` // Source - Who created the route. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' Source EffectiveRouteSource `json:"source,omitempty"` - // State - The value of effective route. Possible values include: 'Active', 'Invalid' + // State - The value of effective route. Possible values include: 'EffectiveRouteStateActive', 'EffectiveRouteStateInvalid' State EffectiveRouteState `json:"state,omitempty"` // AddressPrefix - The address prefixes of the effective routes in CIDR notation. AddressPrefix *[]string `json:"addressPrefix,omitempty"` @@ -12735,9 +12754,9 @@ type ExpressRouteCircuitConnectionPropertiesFormat struct { AuthorizationKey *string `json:"authorizationKey,omitempty"` // Ipv6CircuitConnectionConfig - IPv6 Address PrefixProperties of the express route circuit connection. Ipv6CircuitConnectionConfig *Ipv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -13101,7 +13120,7 @@ type ExpressRouteCircuitPeeringConfig struct { AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` // AdvertisedCommunities - The communities of bgp peering. Specified for microsoft peering. AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded' AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` // LegacyMode - The legacy mode of the peering. LegacyMode *int32 `json:"legacyMode,omitempty"` @@ -13301,7 +13320,7 @@ func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringL // ExpressRouteCircuitPeeringPropertiesFormat properties of the express route circuit peering. type ExpressRouteCircuitPeeringPropertiesFormat struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + // PeeringType - The peering type. Possible values include: 'ExpressRoutePeeringTypeAzurePublicPeering', 'ExpressRoutePeeringTypeAzurePrivatePeering', 'ExpressRoutePeeringTypeMicrosoftPeering' PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' State ExpressRoutePeeringState `json:"state,omitempty"` @@ -13325,7 +13344,7 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct { MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` // Stats - The peering stats of express route circuit. Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // GatewayManagerEtag - The GatewayManager Etag. GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` @@ -13504,7 +13523,7 @@ type ExpressRouteCircuitPropertiesFormat struct { BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` // Stag - READ-ONLY; The identifier of the circuit traffic. Outer tag for QinQ encapsulation. Stag *int32 `json:"stag,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // GatewayManagerEtag - The GatewayManager Etag. GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` @@ -13695,7 +13714,7 @@ type ExpressRouteCircuitSku struct { Name *string `json:"name,omitempty"` // Tier - The tier of the SKU. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium', 'ExpressRouteCircuitSkuTierBasic', 'ExpressRouteCircuitSkuTierLocal' Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` - // Family - The family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData' + // Family - The family of the SKU. Possible values include: 'ExpressRouteCircuitSkuFamilyUnlimitedData', 'ExpressRouteCircuitSkuFamilyMeteredData' Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` } @@ -13944,7 +13963,7 @@ type ExpressRouteConnectionList struct { // ExpressRouteConnectionProperties properties of the ExpressRouteConnection subresource. type ExpressRouteConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the express route connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ExpressRouteCircuitPeering - The ExpressRoute circuit peering. ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID `json:"expressRouteCircuitPeering,omitempty"` @@ -13954,6 +13973,8 @@ type ExpressRouteConnectionProperties struct { RoutingWeight *int32 `json:"routingWeight,omitempty"` // EnableInternetSecurity - Enable internet security. EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` + // ExpressRouteGatewayBypass - Enable FastPath to vWan Firewall hub. + ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` } @@ -13973,6 +13994,9 @@ func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { if ercp.EnableInternetSecurity != nil { objectMap["enableInternetSecurity"] = ercp.EnableInternetSecurity } + if ercp.ExpressRouteGatewayBypass != nil { + objectMap["expressRouteGatewayBypass"] = ercp.ExpressRouteGatewayBypass + } if ercp.RoutingConfiguration != nil { objectMap["routingConfiguration"] = ercp.RoutingConfiguration } @@ -14594,7 +14618,7 @@ func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnecti // ExpressRouteCrossConnectionPeeringProperties properties of express route cross connection peering. type ExpressRouteCrossConnectionPeeringProperties struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + // PeeringType - The peering type. Possible values include: 'ExpressRoutePeeringTypeAzurePublicPeering', 'ExpressRoutePeeringTypeAzurePrivatePeering', 'ExpressRoutePeeringTypeMicrosoftPeering' PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' State ExpressRoutePeeringState `json:"state,omitempty"` @@ -14616,7 +14640,7 @@ type ExpressRouteCrossConnectionPeeringProperties struct { VlanID *int32 `json:"vlanId,omitempty"` // MicrosoftPeeringConfig - The Microsoft peering configuration. MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // GatewayManagerEtag - The GatewayManager Etag. GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` @@ -14760,7 +14784,7 @@ type ExpressRouteCrossConnectionProperties struct { ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` // ServiceProviderNotes - Additional read only notes set by the connectivity provider. ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Peerings - The list of peerings. Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` @@ -15115,7 +15139,7 @@ type ExpressRouteGatewayProperties struct { AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` // ExpressRouteConnections - READ-ONLY; List of ExpressRoute connections to the ExpressRoute gateway. ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VirtualHub - The Virtual Hub where the ExpressRoute gateway is or will be deployed. VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` @@ -15228,6 +15252,49 @@ func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewa return } +// ExpressRouteGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ExpressRouteGatewaysUpdateTagsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExpressRouteGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExpressRouteGatewaysUpdateTagsFuture.Result. +func (future *ExpressRouteGatewaysUpdateTagsFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + erg.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if erg.Response.Response, err = future.GetResult(sender); err == nil && erg.Response.Response.StatusCode != http.StatusNoContent { + erg, err = client.UpdateTagsResponder(erg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysUpdateTagsFuture", "Result", erg.Response.Response, "Failure responding to request") + } + } + return +} + // ExpressRouteLink expressRouteLink child resource definition. type ExpressRouteLink struct { autorest.Response `json:"-"` @@ -15472,7 +15539,7 @@ type ExpressRouteLinkMacSecConfig struct { CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` // CakSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CAK key. CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - // Cipher - Mac security cipher. Possible values include: 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' + // Cipher - Mac security cipher. Possible values include: 'ExpressRouteLinkMacSecCipherGcmAes256', 'ExpressRouteLinkMacSecCipherGcmAes128', 'ExpressRouteLinkMacSecCipherGcmAesXpn128', 'ExpressRouteLinkMacSecCipherGcmAesXpn256' Cipher ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` // SciState - Sci mode enabled/disabled. Possible values include: 'ExpressRouteLinkMacSecSciStateDisabled', 'ExpressRouteLinkMacSecSciStateEnabled' SciState ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` @@ -15488,11 +15555,11 @@ type ExpressRouteLinkPropertiesFormat struct { PatchPanelID *string `json:"patchPanelId,omitempty"` // RackID - READ-ONLY; Mapping of physical patch panel to rack. RackID *string `json:"rackId,omitempty"` - // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'LC', 'SC' + // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'ExpressRouteLinkConnectorTypeLC', 'ExpressRouteLinkConnectorTypeSC' ConnectorType ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` // AdminState - Administrative state of the physical port. Possible values include: 'ExpressRouteLinkAdminStateEnabled', 'ExpressRouteLinkAdminStateDisabled' AdminState ExpressRouteLinkAdminState `json:"adminState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // MacSecConfig - MacSec configuration. MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` @@ -15808,7 +15875,7 @@ type ExpressRoutePortPropertiesFormat struct { ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` // Mtu - READ-ONLY; Maximum transmission unit of the physical port pair(s). Mtu *string `json:"mtu,omitempty"` - // Encapsulation - Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' + // Encapsulation - Encapsulation method on physical ports. Possible values include: 'ExpressRoutePortsEncapsulationDot1Q', 'ExpressRoutePortsEncapsulationQinQ' Encapsulation ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` // EtherType - READ-ONLY; Ether type of the physical port. EtherType *string `json:"etherType,omitempty"` @@ -15818,7 +15885,7 @@ type ExpressRoutePortPropertiesFormat struct { Links *[]ExpressRouteLink `json:"links,omitempty"` // Circuits - READ-ONLY; Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. Circuits *[]SubResource `json:"circuits,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the express route port resource. ResourceGUID *string `json:"resourceGuid,omitempty"` @@ -16203,7 +16270,7 @@ type ExpressRoutePortsLocationPropertiesFormat struct { Contact *string `json:"contact,omitempty"` // AvailableBandwidths - The inventory of available ExpressRoutePort bandwidths. AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port location resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route port location resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -16494,7 +16561,7 @@ type ExpressRouteServiceProviderPropertiesFormat struct { PeeringLocations *[]string `json:"peeringLocations,omitempty"` // BandwidthsOffered - A list of bandwidths offered. BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route service provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the express route service provider resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -16745,13 +16812,13 @@ type FirewallPolicyFilterRuleCollection struct { Name *string `json:"name,omitempty"` // Priority - Priority of the Firewall Policy Rule Collection resource. Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' + // RuleCollectionType - Possible values include: 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection' RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` } // MarshalJSON is the custom marshaler for FirewallPolicyFilterRuleCollection. func (fpfrc FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - fpfrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyFilterRuleCollection + fpfrc.RuleCollectionType = RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection objectMap := make(map[string]interface{}) if fpfrc.Action != nil { objectMap["action"] = fpfrc.Action @@ -16856,6 +16923,16 @@ type FirewallPolicyFilterRuleCollectionAction struct { Type FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` } +// FirewallPolicyInsights firewall Policy Insights. +type FirewallPolicyInsights struct { + // IsEnabled - A flag to indicate if the insights are enabled on the policy. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RetentionDays - Number of days the insights should be enabled on the policy. + RetentionDays *int32 `json:"retentionDays,omitempty"` + // LogAnalyticsResources - Workspaces needed to configure the Firewall Policy Insights. + LogAnalyticsResources *FirewallPolicyLogAnalyticsResources `json:"logAnalyticsResources,omitempty"` +} + // FirewallPolicyIntrusionDetection configuration for intrusion detection mode and rules. type FirewallPolicyIntrusionDetection struct { // Mode - Intrusion detection general state. Possible values include: 'FirewallPolicyIntrusionDetectionStateTypeOff', 'FirewallPolicyIntrusionDetectionStateTypeAlert', 'FirewallPolicyIntrusionDetectionStateTypeDeny' @@ -17061,6 +17138,22 @@ func NewFirewallPolicyListResultPage(cur FirewallPolicyListResult, getNextPage f } } +// FirewallPolicyLogAnalyticsResources log Analytics Resources for Firewall Policy Insights. +type FirewallPolicyLogAnalyticsResources struct { + // Workspaces - List of workspaces for Firewall Policy Insights. + Workspaces *[]FirewallPolicyLogAnalyticsWorkspace `json:"workspaces,omitempty"` + // DefaultWorkspaceID - The default workspace Id for Firewall Policy Insights. + DefaultWorkspaceID *SubResource `json:"defaultWorkspaceId,omitempty"` +} + +// FirewallPolicyLogAnalyticsWorkspace log Analytics Workspace for Firewall Policy Insights. +type FirewallPolicyLogAnalyticsWorkspace struct { + // Region - Region to configure the Workspace. + Region *string `json:"region,omitempty"` + // WorkspaceID - The workspace Id for Firewall Policy Insights. + WorkspaceID *SubResource `json:"workspaceId,omitempty"` +} + // FirewallPolicyNatRuleCollection firewall Policy NAT Rule Collection. type FirewallPolicyNatRuleCollection struct { // Action - The action type of a Nat rule collection. @@ -17071,13 +17164,13 @@ type FirewallPolicyNatRuleCollection struct { Name *string `json:"name,omitempty"` // Priority - Priority of the Firewall Policy Rule Collection resource. Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' + // RuleCollectionType - Possible values include: 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection' RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` } // MarshalJSON is the custom marshaler for FirewallPolicyNatRuleCollection. func (fpnrc FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - fpnrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyNatRuleCollection + fpnrc.RuleCollectionType = RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection objectMap := make(map[string]interface{}) if fpnrc.Action != nil { objectMap["action"] = fpnrc.Action @@ -17178,7 +17271,7 @@ func (fpnrc *FirewallPolicyNatRuleCollection) UnmarshalJSON(body []byte) error { // FirewallPolicyNatRuleCollectionAction properties of the FirewallPolicyNatRuleCollectionAction. type FirewallPolicyNatRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'DNAT' + // Type - The type of action. Possible values include: 'FirewallPolicyNatRuleCollectionActionTypeDNAT' Type FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` } @@ -17186,7 +17279,7 @@ type FirewallPolicyNatRuleCollectionAction struct { type FirewallPolicyPropertiesFormat struct { // RuleCollectionGroups - READ-ONLY; List of references to FirewallPolicyRuleCollectionGroups. RuleCollectionGroups *[]SubResource `json:"ruleCollectionGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // BasePolicy - The parent firewall policy from which rules are inherited. BasePolicy *SubResource `json:"basePolicy,omitempty"` @@ -17198,6 +17291,10 @@ type FirewallPolicyPropertiesFormat struct { ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` // ThreatIntelWhitelist - ThreatIntel Whitelist for Firewall Policy. ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` + // Insights - Insights on Firewall Policy. + Insights *FirewallPolicyInsights `json:"insights,omitempty"` + // Snat - The private IP addresses/IP ranges to which traffic will not be SNAT. + Snat *FirewallPolicySNAT `json:"snat,omitempty"` // DNSSettings - DNS Proxy Settings definition. DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` // IntrusionDetection - The configuration for Intrusion detection. @@ -17220,6 +17317,12 @@ func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { if fppf.ThreatIntelWhitelist != nil { objectMap["threatIntelWhitelist"] = fppf.ThreatIntelWhitelist } + if fppf.Insights != nil { + objectMap["insights"] = fppf.Insights + } + if fppf.Snat != nil { + objectMap["snat"] = fppf.Snat + } if fppf.DNSSettings != nil { objectMap["dnsSettings"] = fppf.DNSSettings } @@ -17249,7 +17352,7 @@ type FirewallPolicyRule struct { Name *string `json:"name,omitempty"` // Description - Description of the rule. Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' + // RuleType - Possible values include: 'RuleTypeRuleTypeFirewallPolicyRule', 'RuleTypeRuleTypeApplicationRule', 'RuleTypeRuleTypeNatRule', 'RuleTypeRuleTypeNetworkRule' RuleType RuleType `json:"ruleType,omitempty"` } @@ -17261,15 +17364,15 @@ func unmarshalBasicFirewallPolicyRule(body []byte) (BasicFirewallPolicyRule, err } switch m["ruleType"] { - case string(RuleTypeApplicationRule): + case string(RuleTypeRuleTypeApplicationRule): var ar ApplicationRule err := json.Unmarshal(body, &ar) return ar, err - case string(RuleTypeNatRule): + case string(RuleTypeRuleTypeNatRule): var nr NatRule err := json.Unmarshal(body, &nr) return nr, err - case string(RuleTypeNetworkRule): + case string(RuleTypeRuleTypeNetworkRule): var r Rule err := json.Unmarshal(body, &r) return r, err @@ -17300,7 +17403,7 @@ func unmarshalBasicFirewallPolicyRuleArray(body []byte) ([]BasicFirewallPolicyRu // MarshalJSON is the custom marshaler for FirewallPolicyRule. func (fpr FirewallPolicyRule) MarshalJSON() ([]byte, error) { - fpr.RuleType = RuleTypeFirewallPolicyRule + fpr.RuleType = RuleTypeRuleTypeFirewallPolicyRule objectMap := make(map[string]interface{}) if fpr.Name != nil { objectMap["name"] = fpr.Name @@ -17360,7 +17463,7 @@ type FirewallPolicyRuleCollection struct { Name *string `json:"name,omitempty"` // Priority - Priority of the Firewall Policy Rule Collection resource. Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' + // RuleCollectionType - Possible values include: 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection' RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` } @@ -17372,11 +17475,11 @@ func unmarshalBasicFirewallPolicyRuleCollection(body []byte) (BasicFirewallPolic } switch m["ruleCollectionType"] { - case string(RuleCollectionTypeFirewallPolicyNatRuleCollection): + case string(RuleCollectionTypeRuleCollectionTypeFirewallPolicyNatRuleCollection): var fpnrc FirewallPolicyNatRuleCollection err := json.Unmarshal(body, &fpnrc) return fpnrc, err - case string(RuleCollectionTypeFirewallPolicyFilterRuleCollection): + case string(RuleCollectionTypeRuleCollectionTypeFirewallPolicyFilterRuleCollection): var fpfrc FirewallPolicyFilterRuleCollection err := json.Unmarshal(body, &fpfrc) return fpfrc, err @@ -17407,7 +17510,7 @@ func unmarshalBasicFirewallPolicyRuleCollectionArray(body []byte) ([]BasicFirewa // MarshalJSON is the custom marshaler for FirewallPolicyRuleCollection. func (fprc FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { - fprc.RuleCollectionType = RuleCollectionTypeFirewallPolicyRuleCollection + fprc.RuleCollectionType = RuleCollectionTypeRuleCollectionTypeFirewallPolicyRuleCollection objectMap := make(map[string]interface{}) if fprc.Name != nil { objectMap["name"] = fprc.Name @@ -17699,7 +17802,7 @@ type FirewallPolicyRuleCollectionGroupProperties struct { Priority *int32 `json:"priority,omitempty"` // RuleCollections - Group of Firewall Policy rule collections. RuleCollections *[]BasicFirewallPolicyRuleCollection `json:"ruleCollections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy rule collection group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy rule collection group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -17842,6 +17945,12 @@ type FirewallPolicySku struct { Tier FirewallPolicySkuTier `json:"tier,omitempty"` } +// FirewallPolicySNAT the private IP addresses/IP ranges to which traffic will not be SNAT. +type FirewallPolicySNAT struct { + // PrivateRanges - List of private IP addresses/IP address ranges to not be SNAT. + PrivateRanges *[]string `json:"privateRanges,omitempty"` +} + // FirewallPolicyThreatIntelWhitelist threatIntel Whitelist for Firewall Policy. type FirewallPolicyThreatIntelWhitelist struct { // IPAddresses - List of IP addresses for the ThreatIntel Whitelist. @@ -17973,7 +18082,7 @@ func (fl *FlowLog) UnmarshalJSON(body []byte) error { // FlowLogFormatParameters parameters that define the flow log format. type FlowLogFormatParameters struct { - // Type - The file type of flow log. Possible values include: 'JSON' + // Type - The file type of flow log. Possible values include: 'FlowLogFormatTypeJSON' Type FlowLogFormatType `json:"type,omitempty"` // Version - The version (revision) of the flow log. Version *int32 `json:"version,omitempty"` @@ -18243,7 +18352,7 @@ type FlowLogPropertiesFormat struct { Format *FlowLogFormatParameters `json:"format,omitempty"` // FlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the flow log. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the flow log. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -18474,9 +18583,9 @@ type FrontendIPConfigurationPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' + // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` @@ -18484,7 +18593,7 @@ type FrontendIPConfigurationPropertiesFormat struct { PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` // PublicIPPrefix - The reference to the Public IP Prefix resource. PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -18911,13 +19020,13 @@ func (hic *HubIPConfiguration) UnmarshalJSON(body []byte) error { type HubIPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` // PublicIPAddress - The reference to the public IP resource. PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -19061,7 +19170,7 @@ type HubRouteTableProperties struct { AssociatedConnections *[]string `json:"associatedConnections,omitempty"` // PropagatingConnections - READ-ONLY; List of all connections that advertise to this route table. PropagatingConnections *[]string `json:"propagatingConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the RouteTable resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the RouteTable resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -19248,7 +19357,7 @@ type HubVirtualNetworkConnectionProperties struct { EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the hub virtual network connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the hub virtual network connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -19460,7 +19569,7 @@ type InboundNatPoolPropertiesFormat struct { EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT pool resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -19770,7 +19879,7 @@ type InboundNatRulePropertiesFormat struct { EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -20018,7 +20127,7 @@ func (future *InboundSecurityRuleCreateOrUpdateFuture) result(client InboundSecu type InboundSecurityRuleProperties struct { // Rules - List of allowed rules. Rules *[]InboundSecurityRules `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -20523,9 +20632,9 @@ type InterfaceIPConfigurationPropertiesFormat struct { LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` // PrivateIPAddress - Private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' + // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` // Subnet - Subnet bound to the IP configuration. Subnet *Subnet `json:"subnet,omitempty"` @@ -20535,7 +20644,7 @@ type InterfaceIPConfigurationPropertiesFormat struct { PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` // ApplicationSecurityGroups - Application security groups in which the IP configuration is included. ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface IP configuration. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network interface IP configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateLinkConnectionProperties - READ-ONLY; PrivateLinkConnection properties for the network interface. PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` @@ -20944,7 +21053,7 @@ type InterfacePropertiesFormat struct { DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the network interface resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network interface resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -21398,7 +21507,7 @@ func NewInterfaceTapConfigurationListResultPage(cur InterfaceTapConfigurationLis type InterfaceTapConfigurationPropertiesFormat struct { // VirtualNetworkTap - The reference to the Virtual Network Tap resource. VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface tap configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network interface tap configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -21780,13 +21889,13 @@ type IPAllocationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` // VirtualNetwork - READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // Type - The type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' + // Type - The type for the IpAllocation. Possible values include: 'IPAllocationTypeUndefined', 'IPAllocationTypeHypernet' Type IPAllocationType `json:"type,omitempty"` // Prefix - The address prefix for the IpAllocation. Prefix *string `json:"prefix,omitempty"` // PrefixLength - The address prefix length for the IpAllocation. PrefixLength *int32 `json:"prefixLength,omitempty"` - // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' + // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PrefixType IPVersion `json:"prefixType,omitempty"` // IpamAllocationID - The IPAM allocation ID. IpamAllocationID *string `json:"ipamAllocationId,omitempty"` @@ -22093,7 +22202,7 @@ func (icp *IPConfigurationProfile) UnmarshalJSON(body []byte) error { type IPConfigurationProfilePropertiesFormat struct { // Subnet - The reference to the subnet resource to create a container network interface ip configuration. Subnet *Subnet `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration profile resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -22110,13 +22219,13 @@ func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error type IPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` // PublicIPAddress - The reference to the public IP resource. PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -22414,7 +22523,7 @@ func NewIPGroupListResultPage(cur IPGroupListResult, getNextPage func(context.Co // IPGroupPropertiesFormat the IpGroups property information. type IPGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the IpGroups resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the IpGroups resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // IPAddresses - IpAddresses/IpAddressPrefixes in the IpGroups resource. IPAddresses *[]string `json:"ipAddresses,omitempty"` @@ -22523,7 +22632,7 @@ type IpsecPolicy struct { IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'IkeEncryptionDES', 'IkeEncryptionDES3', 'IkeEncryptionAES128', 'IkeEncryptionAES192', 'IkeEncryptionAES256', 'IkeEncryptionGCMAES256', 'IkeEncryptionGCMAES128' IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` @@ -22545,7 +22654,7 @@ type IPTag struct { type Ipv6CircuitConnectionConfig struct { // AddressPrefix - /125 IP address space to carve out customer addresses for global reach. AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` } @@ -24019,6 +24128,166 @@ func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage f } } +// ListVpnGatewayNatRulesResult result of the request to list all nat rules to a virtual wan vpn gateway. +// It contains a list of Nat rules and a URL nextLink to get the next set of results. +type ListVpnGatewayNatRulesResult struct { + autorest.Response `json:"-"` + // Value - List of Nat Rules. + Value *[]VpnGatewayNatRule `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVpnGatewayNatRulesResultIterator provides access to a complete listing of VpnGatewayNatRule values. +type ListVpnGatewayNatRulesResultIterator struct { + i int + page ListVpnGatewayNatRulesResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVpnGatewayNatRulesResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewayNatRulesResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListVpnGatewayNatRulesResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVpnGatewayNatRulesResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVpnGatewayNatRulesResultIterator) Response() ListVpnGatewayNatRulesResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVpnGatewayNatRulesResultIterator) Value() VpnGatewayNatRule { + if !iter.page.NotDone() { + return VpnGatewayNatRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListVpnGatewayNatRulesResultIterator type. +func NewListVpnGatewayNatRulesResultIterator(page ListVpnGatewayNatRulesResultPage) ListVpnGatewayNatRulesResultIterator { + return ListVpnGatewayNatRulesResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvgnrr ListVpnGatewayNatRulesResult) IsEmpty() bool { + return lvgnrr.Value == nil || len(*lvgnrr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lvgnrr ListVpnGatewayNatRulesResult) hasNextLink() bool { + return lvgnrr.NextLink != nil && len(*lvgnrr.NextLink) != 0 +} + +// listVpnGatewayNatRulesResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvgnrr ListVpnGatewayNatRulesResult) listVpnGatewayNatRulesResultPreparer(ctx context.Context) (*http.Request, error) { + if !lvgnrr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvgnrr.NextLink))) +} + +// ListVpnGatewayNatRulesResultPage contains a page of VpnGatewayNatRule values. +type ListVpnGatewayNatRulesResultPage struct { + fn func(context.Context, ListVpnGatewayNatRulesResult) (ListVpnGatewayNatRulesResult, error) + lvgnrr ListVpnGatewayNatRulesResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVpnGatewayNatRulesResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewayNatRulesResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lvgnrr) + if err != nil { + return err + } + page.lvgnrr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListVpnGatewayNatRulesResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVpnGatewayNatRulesResultPage) NotDone() bool { + return !page.lvgnrr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVpnGatewayNatRulesResultPage) Response() ListVpnGatewayNatRulesResult { + return page.lvgnrr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVpnGatewayNatRulesResultPage) Values() []VpnGatewayNatRule { + if page.lvgnrr.IsEmpty() { + return nil + } + return *page.lvgnrr.Value +} + +// Creates a new instance of the ListVpnGatewayNatRulesResultPage type. +func NewListVpnGatewayNatRulesResultPage(cur ListVpnGatewayNatRulesResult, getNextPage func(context.Context, ListVpnGatewayNatRulesResult) (ListVpnGatewayNatRulesResult, error)) ListVpnGatewayNatRulesResultPage { + return ListVpnGatewayNatRulesResultPage{ + fn: getNextPage, + lvgnrr: cur, + } +} + // ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a // URL nextLink to get the next set of results. type ListVpnGatewaysResult struct { @@ -25270,6 +25539,8 @@ func (future *LoadBalancerBackendAddressPoolsDeleteFuture) result(client LoadBal type LoadBalancerBackendAddressPropertiesFormat struct { // VirtualNetwork - Reference to an existing virtual network. VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` + // Subnet - Reference to an existing subnet. + Subnet *SubResource `json:"subnet,omitempty"` // IPAddress - IP Address belonging to the referenced virtual network. IPAddress *string `json:"ipAddress,omitempty"` // NetworkInterfaceIPConfiguration - READ-ONLY; Reference to IP address defined in network interfaces. @@ -25284,6 +25555,9 @@ func (lbbapf LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, if lbbapf.VirtualNetwork != nil { objectMap["virtualNetwork"] = lbbapf.VirtualNetwork } + if lbbapf.Subnet != nil { + objectMap["subnet"] = lbbapf.Subnet + } if lbbapf.IPAddress != nil { objectMap["ipAddress"] = lbbapf.IPAddress } @@ -26153,7 +26427,7 @@ type LoadBalancerPropertiesFormat struct { OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the load balancer resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -26268,7 +26542,7 @@ func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar type LoadBalancerSku struct { // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard' Name LoadBalancerSkuName `json:"name,omitempty"` - // Tier - Tier of a load balancer SKU. Possible values include: 'Regional', 'Global' + // Tier - Tier of a load balancer SKU. Possible values include: 'LoadBalancerSkuTierRegional', 'LoadBalancerSkuTierGlobal' Tier LoadBalancerSkuTier `json:"tier,omitempty"` } @@ -26386,7 +26660,7 @@ type LoadBalancingRulePropertiesFormat struct { EnableTCPReset *bool `json:"enableTcpReset,omitempty"` // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -26725,7 +26999,7 @@ type LocalNetworkGatewayPropertiesFormat struct { BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the local network gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -26927,7 +27201,7 @@ type MatchedRule struct { // MatchVariable define match variables. type MatchVariable struct { - // VariableName - Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeaders', 'RequestBody', 'RequestCookies' + // VariableName - Match Variable. Possible values include: 'WebApplicationFirewallMatchVariableRemoteAddr', 'WebApplicationFirewallMatchVariableRequestMethod', 'WebApplicationFirewallMatchVariableQueryString', 'WebApplicationFirewallMatchVariablePostArgs', 'WebApplicationFirewallMatchVariableRequestURI', 'WebApplicationFirewallMatchVariableRequestHeaders', 'WebApplicationFirewallMatchVariableRequestBody', 'WebApplicationFirewallMatchVariableRequestCookies' VariableName WebApplicationFirewallMatchVariable `json:"variableName,omitempty"` // Selector - The selector of match variable. Selector *string `json:"selector,omitempty"` @@ -27279,7 +27553,7 @@ type NatGatewayPropertiesFormat struct { Subnets *[]SubResource `json:"subnets,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the NAT gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the NAT gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -27406,13 +27680,13 @@ type NatRule struct { Name *string `json:"name,omitempty"` // Description - Description of the rule. Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' + // RuleType - Possible values include: 'RuleTypeRuleTypeFirewallPolicyRule', 'RuleTypeRuleTypeApplicationRule', 'RuleTypeRuleTypeNatRule', 'RuleTypeRuleTypeNetworkRule' RuleType RuleType `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for NatRule. func (nr NatRule) MarshalJSON() ([]byte, error) { - nr.RuleType = RuleTypeNatRule + nr.RuleType = RuleTypeRuleTypeNatRule objectMap := make(map[string]interface{}) if nr.IPProtocols != nil { objectMap["ipProtocols"] = nr.IPProtocols @@ -27475,6 +27749,86 @@ func (nr NatRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { return &nr, true } +// NatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NatRulesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NatRulesClient) (VpnGatewayNatRule, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NatRulesCreateOrUpdateFuture.Result. +func (future *NatRulesCreateOrUpdateFuture) result(client NatRulesClient) (vgnr VpnGatewayNatRule, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.NatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vgnr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.NatRulesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vgnr.Response.Response, err = future.GetResult(sender); err == nil && vgnr.Response.Response.StatusCode != http.StatusNoContent { + vgnr, err = client.CreateOrUpdateResponder(vgnr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.NatRulesCreateOrUpdateFuture", "Result", vgnr.Response.Response, "Failure responding to request") + } + } + return +} + +// NatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NatRulesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(NatRulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *NatRulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for NatRulesDeleteFuture.Result. +func (future *NatRulesDeleteFuture) result(client NatRulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.NatRulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.NatRulesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // NextHopParameters parameters that define the source and destination endpoint. type NextHopParameters struct { // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. @@ -27885,7 +28239,7 @@ type OutboundRulePropertiesFormat struct { FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the outbound rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the outbound rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Protocol - The protocol for the outbound rule in load balancer. Possible values include: 'LoadBalancerOutboundRuleProtocolTCP', 'LoadBalancerOutboundRuleProtocolUDP', 'LoadBalancerOutboundRuleProtocolAll' Protocol LoadBalancerOutboundRuleProtocol `json:"protocol,omitempty"` @@ -27921,7 +28275,7 @@ func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { // OwaspCrsExclusionEntry allow to exclude some variable satisfy the condition for the WAF check. type OwaspCrsExclusionEntry struct { - // MatchVariable - The variable to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames' + // MatchVariable - The variable to be excluded. Possible values include: 'OwaspCrsExclusionEntryMatchVariableRequestHeaderNames', 'OwaspCrsExclusionEntryMatchVariableRequestCookieNames', 'OwaspCrsExclusionEntryMatchVariableRequestArgNames' MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. Possible values include: 'OwaspCrsExclusionEntrySelectorMatchOperatorEquals', 'OwaspCrsExclusionEntrySelectorMatchOperatorContains', 'OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny' SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` @@ -28015,7 +28369,7 @@ type P2SConnectionConfigurationProperties struct { RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` // EnableInternetSecurity - Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -28176,7 +28530,7 @@ type P2SVpnGatewayProperties struct { VirtualHub *SubResource `json:"virtualHub,omitempty"` // P2SConnectionConfigurations - List of all p2s connection configurations of the gateway. P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2S VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the P2S VPN gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VpnGatewayScaleUnit - The scale unit for this p2s vpn gateway. VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` @@ -28548,7 +28902,7 @@ func (future *P2sVpnGatewaysUpdateTagsFuture) result(client P2sVpnGatewaysClient // P2SVpnProfileParameters vpn Client Parameters for package generation. type P2SVpnProfileParameters struct { - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` } @@ -28720,7 +29074,7 @@ func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { // PacketCaptureResultProperties the properties of a packet capture session. type PacketCaptureResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Target - The ID of the targeted resource, only VM is currently supported. Target *string `json:"target,omitempty"` @@ -29368,13 +29722,13 @@ type PeerExpressRouteCircuitConnectionPropertiesFormat struct { PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' + // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` // ConnectionName - The name of the express route circuit connection resource. ConnectionName *string `json:"connectionName,omitempty"` // AuthResourceGUID - The resource guid of the authorization used for the express route circuit connection. AuthResourceGUID *string `json:"authResourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the peer express route circuit connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the peer express route circuit connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -29752,7 +30106,7 @@ func NewPrivateDNSZoneGroupListResultPage(cur PrivateDNSZoneGroupListResult, get // PrivateDNSZoneGroupPropertiesFormat properties of the private dns zone group. type PrivateDNSZoneGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private dns zone group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private dns zone group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateDNSZoneConfigs - A collection of private dns zone configurations of the private dns zone group. PrivateDNSZoneConfigs *[]PrivateDNSZoneConfig `json:"privateDnsZoneConfigs,omitempty"` @@ -29867,6 +30221,8 @@ func (pdzpf PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) { // PrivateEndpoint private endpoint resource. type PrivateEndpoint struct { autorest.Response `json:"-"` + // ExtendedLocation - The extended location of the load balancer. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` // PrivateEndpointProperties - Properties of the private endpoint. *PrivateEndpointProperties `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -29886,6 +30242,9 @@ type PrivateEndpoint struct { // MarshalJSON is the custom marshaler for PrivateEndpoint. func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if peVar.ExtendedLocation != nil { + objectMap["extendedLocation"] = peVar.ExtendedLocation + } if peVar.PrivateEndpointProperties != nil { objectMap["properties"] = peVar.PrivateEndpointProperties } @@ -29910,6 +30269,15 @@ func (peVar *PrivateEndpoint) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + peVar.ExtendedLocation = &extendedLocation + } case "properties": if v != nil { var privateEndpointProperties PrivateEndpointProperties @@ -30244,7 +30612,7 @@ type PrivateEndpointConnectionProperties struct { PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // LinkIdentifier - READ-ONLY; The consumer link id. LinkIdentifier *string `json:"linkIdentifier,omitempty"` @@ -30433,7 +30801,7 @@ type PrivateEndpointProperties struct { Subnet *Subnet `json:"subnet,omitempty"` // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private endpoint. NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` @@ -30544,6 +30912,8 @@ func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient // PrivateLinkService private link service resource. type PrivateLinkService struct { autorest.Response `json:"-"` + // ExtendedLocation - The extended location of the load balancer. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` // PrivateLinkServiceProperties - Properties of the private link service. *PrivateLinkServiceProperties `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -30563,6 +30933,9 @@ type PrivateLinkService struct { // MarshalJSON is the custom marshaler for PrivateLinkService. func (pls PrivateLinkService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if pls.ExtendedLocation != nil { + objectMap["extendedLocation"] = pls.ExtendedLocation + } if pls.PrivateLinkServiceProperties != nil { objectMap["properties"] = pls.PrivateLinkServiceProperties } @@ -30587,6 +30960,15 @@ func (pls *PrivateLinkService) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + pls.ExtendedLocation = &extendedLocation + } case "properties": if v != nil { var privateLinkServiceProperties PrivateLinkServiceProperties @@ -30747,7 +31129,7 @@ func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error { // PrivateLinkServiceConnectionProperties properties of the PrivateLinkServiceConnection. type PrivateLinkServiceConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private link service connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private link service connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateLinkServiceID - The resource id of private link service. PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"` @@ -30881,15 +31263,15 @@ func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error type PrivateLinkServiceIPConfigurationProperties struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` // Primary - Whether the ip configuration is primary or not. Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private link service IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' + // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` } @@ -31090,7 +31472,7 @@ type PrivateLinkServiceProperties struct { IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private link service. NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the private link service resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // PrivateEndpointConnections - READ-ONLY; An array of list about connections to the private endpoint. PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` @@ -31456,7 +31838,7 @@ type ProbePropertiesFormat struct { NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` // RequestPath - The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. RequestPath *string `json:"requestPath,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -31763,7 +32145,7 @@ type ProfilePropertiesFormat struct { ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the network profile resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network profile resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network profile resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -32247,9 +32629,9 @@ func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage // PublicIPAddressPropertiesFormat public IP address properties. type PublicIPAddressPropertiesFormat struct { - // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' + // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address. IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` @@ -32267,7 +32649,7 @@ type PublicIPAddressPropertiesFormat struct { IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the public IP address resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP address resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the public IP address resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -32707,7 +33089,7 @@ func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage f // PublicIPPrefixPropertiesFormat public IP prefix properties. type PublicIPPrefixPropertiesFormat struct { - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' + // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` // IPTags - The list of tags associated with the public IP prefix. IPTags *[]IPTag `json:"ipTags,omitempty"` @@ -32723,7 +33105,7 @@ type PublicIPPrefixPropertiesFormat struct { CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the public IP prefix resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP prefix resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the public IP prefix resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -32879,7 +33261,7 @@ type RecordSet struct { RecordSetName *string `json:"recordSetName,omitempty"` // Fqdn - Fqdn that resolves to private endpoint ip address. Fqdn *string `json:"fqdn,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the recordset. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the recordset. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // TTL - Recordset time to live. TTL *int32 `json:"ttl,omitempty"` @@ -33038,7 +33420,7 @@ type ResourceNavigationLinkFormat struct { LinkedResourceType *string `json:"linkedResourceType,omitempty"` // Link - Link to the external resource. Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource navigation link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource navigation link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -33095,6 +33477,8 @@ type Route struct { Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } @@ -33108,6 +33492,9 @@ func (r Route) MarshalJSON() ([]byte, error) { if r.Name != nil { objectMap["name"] = r.Name } + if r.Type != nil { + objectMap["type"] = r.Type + } if r.ID != nil { objectMap["id"] = r.ID } @@ -33150,6 +33537,15 @@ func (r *Route) UnmarshalJSON(body []byte) error { } r.Etag = &etag } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } case "id": if v != nil { var ID string @@ -33447,7 +33843,7 @@ type RouteFilterPropertiesFormat struct { Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` // Ipv6Peerings - READ-ONLY; A collection of references to express route circuit ipv6 peerings. Ipv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the route filter resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -33714,13 +34110,13 @@ func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage // RouteFilterRulePropertiesFormat route Filter Rule Resource. type RouteFilterRulePropertiesFormat struct { - // Access - The access type of the rule. Possible values include: 'Allow', 'Deny' + // Access - The access type of the rule. Possible values include: 'AccessAllow', 'AccessDeny' Access Access `json:"access,omitempty"` // RouteFilterRuleType - The rule type of the rule. RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` // Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. Communities *[]string `json:"communities,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the route filter rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -34066,8 +34462,10 @@ type RoutePropertiesFormat struct { NextHopType RouteNextHopType `json:"nextHopType,omitempty"` // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the route resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // HasBgpOverride - A value indicating whether this route overrides overlapping BGP routes regardless of LPM. + HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` } // MarshalJSON is the custom marshaler for RoutePropertiesFormat. @@ -34082,6 +34480,9 @@ func (rpf RoutePropertiesFormat) MarshalJSON() ([]byte, error) { if rpf.NextHopIPAddress != nil { objectMap["nextHopIpAddress"] = rpf.NextHopIPAddress } + if rpf.HasBgpOverride != nil { + objectMap["hasBgpOverride"] = rpf.HasBgpOverride + } return json.Marshal(objectMap) } @@ -34446,8 +34847,10 @@ type RouteTablePropertiesFormat struct { Subnets *[]Subnet `json:"subnets,omitempty"` // DisableBgpRoutePropagation - Whether to disable the routes learned by BGP on that route table. True means disable. DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route table resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the route table resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGUID - READ-ONLY; The resource GUID property of the route table. + ResourceGUID *string `json:"resourceGuid,omitempty"` } // MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. @@ -34573,13 +34976,13 @@ type Rule struct { Name *string `json:"name,omitempty"` // Description - Description of the rule. Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' + // RuleType - Possible values include: 'RuleTypeRuleTypeFirewallPolicyRule', 'RuleTypeRuleTypeApplicationRule', 'RuleTypeRuleTypeNatRule', 'RuleTypeRuleTypeNetworkRule' RuleType RuleType `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for Rule. func (r Rule) MarshalJSON() ([]byte, error) { - r.RuleType = RuleTypeNetworkRule + r.RuleType = RuleTypeRuleTypeNetworkRule objectMap := make(map[string]interface{}) if r.IPProtocols != nil { objectMap["ipProtocols"] = r.IPProtocols @@ -34935,7 +35338,7 @@ type SecurityGroupPropertiesFormat struct { FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the network security group resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network security group resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network security group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -35335,9 +35738,9 @@ func NewSecurityPartnerProviderListResultPage(cur SecurityPartnerProviderListRes // SecurityPartnerProviderPropertiesFormat properties of the Security Partner Provider. type SecurityPartnerProviderPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Security Partner Provider resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the Security Partner Provider resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' + // SecurityProviderName - The security provider name. Possible values include: 'SecurityProviderNameZScaler', 'SecurityProviderNameIBoss', 'SecurityProviderNameCheckpoint' SecurityProviderName SecurityProviderName `json:"securityProviderName,omitempty"` // ConnectionStatus - READ-ONLY; The connection status with the Security Partner Provider. Possible values include: 'SecurityPartnerProviderConnectionStatusUnknown', 'SecurityPartnerProviderConnectionStatusPartiallyConnected', 'SecurityPartnerProviderConnectionStatusConnected', 'SecurityPartnerProviderConnectionStatusNotConnected' ConnectionStatus SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` @@ -35446,6 +35849,8 @@ type SecurityRule struct { Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Type - The type of the resource. + Type *string `json:"type,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } @@ -35459,6 +35864,9 @@ func (sr SecurityRule) MarshalJSON() ([]byte, error) { if sr.Name != nil { objectMap["name"] = sr.Name } + if sr.Type != nil { + objectMap["type"] = sr.Type + } if sr.ID != nil { objectMap["id"] = sr.ID } @@ -35501,6 +35909,15 @@ func (sr *SecurityRule) UnmarshalJSON(body []byte) error { } sr.Etag = &etag } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sr.Type = &typeVar + } case "id": if v != nil { var ID string @@ -35720,7 +36137,7 @@ type SecurityRulePropertiesFormat struct { Priority *int32 `json:"priority,omitempty"` // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' Direction SecurityRuleDirection `json:"direction,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the security rule resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the security rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -35966,7 +36383,7 @@ type ServiceAssociationLinkPropertiesFormat struct { LinkedResourceType *string `json:"linkedResourceType,omitempty"` // Link - Link to the external resource. Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service association link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the service association link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // AllowDelete - If true, the resource can be deleted. AllowDelete *bool `json:"allowDelete,omitempty"` @@ -36016,7 +36433,7 @@ type ServiceDelegationPropertiesFormat struct { ServiceName *string `json:"serviceName,omitempty"` // Actions - READ-ONLY; The actions permitted to the service upon delegation. Actions *[]string `json:"actions,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service delegation resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the service delegation resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -36116,6 +36533,8 @@ type ServiceEndpointPolicy struct { *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // Kind - READ-ONLY; Kind of service endpoint policy. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -36173,6 +36592,15 @@ func (sep *ServiceEndpointPolicy) UnmarshalJSON(body []byte) error { } sep.Etag = &etag } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sep.Kind = &kind + } case "id": if v != nil { var ID string @@ -36472,7 +36900,7 @@ type ServiceEndpointPolicyDefinitionPropertiesFormat struct { Service *string `json:"service,omitempty"` // ServiceResources - A list of service resources. ServiceResources *[]string `json:"serviceResources,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy definition resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy definition resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -36748,7 +37176,7 @@ type ServiceEndpointPolicyPropertiesFormat struct { Subnets *[]Subnet `json:"subnets,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the service endpoint policy resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -36767,7 +37195,7 @@ type ServiceEndpointPropertiesFormat struct { Service *string `json:"service,omitempty"` // Locations - A list of locations. Locations *[]string `json:"locations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -37134,12 +37562,12 @@ type SubnetPropertiesFormat struct { Delegations *[]Delegation `json:"delegations,omitempty"` // Purpose - READ-ONLY; A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. Purpose *string `json:"purpose,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the subnet resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the subnet resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. - PrivateEndpointNetworkPolicies *string `json:"privateEndpointNetworkPolicies,omitempty"` - // PrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the subnet. - PrivateLinkServiceNetworkPolicies *string `json:"privateLinkServiceNetworkPolicies,omitempty"` + // PrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. Possible values include: 'VirtualNetworkPrivateEndpointNetworkPoliciesEnabled', 'VirtualNetworkPrivateEndpointNetworkPoliciesDisabled' + PrivateEndpointNetworkPolicies VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + // PrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the subnet. Possible values include: 'VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled', 'VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled' + PrivateLinkServiceNetworkPolicies VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` } // MarshalJSON is the custom marshaler for SubnetPropertiesFormat. @@ -37172,10 +37600,10 @@ func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { if spf.Delegations != nil { objectMap["delegations"] = spf.Delegations } - if spf.PrivateEndpointNetworkPolicies != nil { + if spf.PrivateEndpointNetworkPolicies != "" { objectMap["privateEndpointNetworkPolicies"] = spf.PrivateEndpointNetworkPolicies } - if spf.PrivateLinkServiceNetworkPolicies != nil { + if spf.PrivateLinkServiceNetworkPolicies != "" { objectMap["privateLinkServiceNetworkPolicies"] = spf.PrivateLinkServiceNetworkPolicies } return json.Marshal(objectMap) @@ -37384,7 +37812,7 @@ type TopologyAssociation struct { Name *string `json:"name,omitempty"` // ResourceID - The ID of the resource that is associated with the parent resource. ResourceID *string `json:"resourceId,omitempty"` - // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' + // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'AssociationTypeAssociated', 'AssociationTypeContains' AssociationType AssociationType `json:"associationType,omitempty"` } @@ -37761,7 +38189,7 @@ func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Cont type VerificationIPFlowParameters struct { // TargetResourceID - The ID of the target resource to perform next-hop on. TargetResourceID *string `json:"targetResourceId,omitempty"` - // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'DirectionInbound', 'DirectionOutbound' Direction Direction `json:"direction,omitempty"` // Protocol - Protocol to be verified on. Possible values include: 'IPFlowProtocolTCP', 'IPFlowProtocolUDP' Protocol IPFlowProtocol `json:"protocol,omitempty"` @@ -37780,7 +38208,7 @@ type VerificationIPFlowParameters struct { // VerificationIPFlowResult results of IP flow verification on the target resource. type VerificationIPFlowResult struct { autorest.Response `json:"-"` - // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' + // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'AccessAllow', 'AccessDeny' Access Access `json:"access,omitempty"` // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. RuleName *string `json:"ruleName,omitempty"` @@ -38106,7 +38534,7 @@ type VirtualAppliancePropertiesFormat struct { VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` // InboundSecurityRules - READ-ONLY; List of references to InboundSecurityRules. InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -38470,7 +38898,7 @@ type VirtualApplianceSiteProperties struct { AddressPrefix *string `json:"addressPrefix,omitempty"` // O365Policy - Office 365 Policy. O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -39283,7 +39711,7 @@ type VirtualHubProperties struct { AddressPrefix *string `json:"addressPrefix,omitempty"` // RouteTable - The routeTable associated with this virtual hub. RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // SecurityProviderName - The Security Provider name. SecurityProviderName *string `json:"securityProviderName,omitempty"` @@ -39455,7 +39883,7 @@ type VirtualHubRouteTableV2Properties struct { Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"` // AttachedConnections - List of all connections attached to this route table v2. AttachedConnections *[]string `json:"attachedConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub route table v2 resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub route table v2 resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -39837,6 +40265,8 @@ type VirtualNetworkConnectionGatewayReference struct { // VirtualNetworkGateway a common class for general resource information. type VirtualNetworkGateway struct { autorest.Response `json:"-"` + // ExtendedLocation - The extended location of type local virtual network gateway. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. @@ -39856,6 +40286,9 @@ type VirtualNetworkGateway struct { // MarshalJSON is the custom marshaler for VirtualNetworkGateway. func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if vng.ExtendedLocation != nil { + objectMap["extendedLocation"] = vng.ExtendedLocation + } if vng.VirtualNetworkGatewayPropertiesFormat != nil { objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat } @@ -39880,6 +40313,15 @@ func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + vng.ExtendedLocation = &extendedLocation + } case "properties": if v != nil { var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat @@ -40188,9 +40630,9 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` // LocalNetworkGateway2 - The reference to local network gateway resource. LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + // ConnectionType - Gateway connection type. Possible values include: 'VirtualNetworkGatewayConnectionTypeIPsec', 'VirtualNetworkGatewayConnectionTypeVnet2Vnet', 'VirtualNetworkGatewayConnectionTypeExpressRoute', 'VirtualNetworkGatewayConnectionTypeVPNClient' ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` // RoutingWeight - The routing weight. RoutingWeight *int32 `json:"routingWeight,omitempty"` @@ -40218,7 +40660,7 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` @@ -40455,9 +40897,9 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` // LocalNetworkGateway2 - The reference to local network gateway resource. LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + // ConnectionType - Gateway connection type. Possible values include: 'VirtualNetworkGatewayConnectionTypeIPsec', 'VirtualNetworkGatewayConnectionTypeVnet2Vnet', 'VirtualNetworkGatewayConnectionTypeExpressRoute', 'VirtualNetworkGatewayConnectionTypeVPNClient' ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` // RoutingWeight - The routing weight. RoutingWeight *int32 `json:"routingWeight,omitempty"` @@ -40489,7 +40931,7 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` @@ -40632,6 +41074,86 @@ func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client Virtua return } +// VirtualNetworkGatewayConnectionsGetIkeSasFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualNetworkGatewayConnectionsGetIkeSasFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (String, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsGetIkeSasFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkGatewayConnectionsGetIkeSasFuture.Result. +func (future *VirtualNetworkGatewayConnectionsGetIkeSasFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsGetIkeSasFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsGetIkeSasFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.GetIkeSasResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsGetIkeSasFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualNetworkGatewayConnectionsResetConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualNetworkGatewayConnectionsResetConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworkGatewayConnectionsResetConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworkGatewayConnectionsResetConnectionFuture.Result. +func (future *VirtualNetworkGatewayConnectionsResetConnectionFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetConnectionFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { @@ -40927,7 +41449,7 @@ func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) er // VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration. type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *SubResource `json:"subnet,omitempty"` @@ -40935,7 +41457,7 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` // PrivateIPAddress - READ-ONLY; Private IP Address for this gateway. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -41300,7 +41822,7 @@ type VirtualNetworkGatewayPropertiesFormat struct { IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` // GatewayType - The type of this virtual network gateway. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute', 'VirtualNetworkGatewayTypeLocalGateway' GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - // VpnType - The type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' + // VpnType - The type of this virtual network gateway. Possible values include: 'VpnTypePolicyBased', 'VpnTypeRouteBased' VpnType VpnType `json:"vpnType,omitempty"` // VpnGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. Possible values include: 'VpnGatewayGenerationNone', 'VpnGatewayGenerationGeneration1', 'VpnGatewayGenerationGeneration2' VpnGatewayGeneration VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` @@ -41322,16 +41844,14 @@ type VirtualNetworkGatewayPropertiesFormat struct { CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // EnableDNSForwarding - Whether dns forwarding is enabled or not. EnableDNSForwarding *bool `json:"enableDnsForwarding,omitempty"` // InboundDNSForwardingEndpoint - READ-ONLY; The IP address allocated by the gateway to which dns requests can be sent. InboundDNSForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - // VirtualNetworkExtendedLocationResourceID - MAS FIJI customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. - VirtualNetworkExtendedLocationResourceID *string `json:"virtualNetworkExtendedLocationResourceId,omitempty"` - // ExtendedLocation - The extended location of type local virtual network gateway. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // VNetExtendedLocationResourceID - Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. + VNetExtendedLocationResourceID *string `json:"vNetExtendedLocationResourceId,omitempty"` } // MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. @@ -41376,11 +41896,8 @@ func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) if vngpf.EnableDNSForwarding != nil { objectMap["enableDnsForwarding"] = vngpf.EnableDNSForwarding } - if vngpf.VirtualNetworkExtendedLocationResourceID != nil { - objectMap["virtualNetworkExtendedLocationResourceId"] = vngpf.VirtualNetworkExtendedLocationResourceID - } - if vngpf.ExtendedLocation != nil { - objectMap["extendedLocation"] = vngpf.ExtendedLocation + if vngpf.VNetExtendedLocationResourceID != nil { + objectMap["vNetExtendedLocationResourceId"] = vngpf.VNetExtendedLocationResourceID } return json.Marshal(objectMap) } @@ -42706,7 +43223,7 @@ type VirtualNetworkPeeringPropertiesFormat struct { RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` // PeeringState - The status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -42832,7 +43349,7 @@ type VirtualNetworkPropertiesFormat struct { VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` // ResourceGUID - READ-ONLY; The resourceGuid property of the Virtual Network resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // EnableDdosProtection - Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` @@ -43239,7 +43756,7 @@ type VirtualNetworkTapPropertiesFormat struct { NetworkInterfaceTapConfigurations *[]InterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network tap resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network tap resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network tap resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // DestinationNetworkInterfaceIPConfiguration - The reference to the private IP Address of the collector nic that will receive the tap. DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` @@ -43896,7 +44413,7 @@ type VirtualRouterPeeringProperties struct { PeerAsn *int64 `json:"peerAsn,omitempty"` // PeerIP - Peer IP. PeerIP *string `json:"peerIp,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -44004,7 +44521,7 @@ type VirtualRouterPropertiesFormat struct { HostedGateway *SubResource `json:"hostedGateway,omitempty"` // Peerings - READ-ONLY; List of references to VirtualRouterPeerings. Peerings *[]SubResource `json:"peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -44235,7 +44752,7 @@ type VirtualWanProperties struct { AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` // Office365LocalBreakoutCategory - The office local breakout category. Possible values include: 'OfficeTrafficCategoryOptimize', 'OfficeTrafficCategoryOptimizeAndAllow', 'OfficeTrafficCategoryAll', 'OfficeTrafficCategoryNone' Office365LocalBreakoutCategory OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual WAN resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the virtual WAN resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Type - The type of the VirtualWAN. Type *string `json:"type,omitempty"` @@ -44348,7 +44865,7 @@ type VirtualWanSecurityProvider struct { Name *string `json:"name,omitempty"` // URL - Url of the security provider. URL *string `json:"url,omitempty"` - // Type - Name of the security provider. Possible values include: 'External', 'Native' + // Type - Name of the security provider. Possible values include: 'VirtualWanSecurityProviderTypeExternal', 'VirtualWanSecurityProviderTypeNative' Type VirtualWanSecurityProviderType `json:"type,omitempty"` } @@ -44363,7 +44880,7 @@ type VirtualWanSecurityProviders struct { type VirtualWanVpnProfileParameters struct { // VpnServerConfigurationResourceID - VpnServerConfiguration partial resource uri with which VirtualWan is associated to. VpnServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` } @@ -44412,6 +44929,8 @@ type VpnClientConfiguration struct { VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` // VpnClientProtocols - VpnClientProtocols for Virtual network gateway. VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` + // VpnAuthenticationTypes - VPN authentication types for the virtual network gateway.. + VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` // VpnClientIpsecPolicies - VpnClientIpsecPolicies for virtual network gateway P2S client. VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` // RadiusServerAddress - The radius server address property of the VirtualNetworkGateway resource for vpn client connection. @@ -44498,7 +45017,7 @@ type VpnClientIPsecParameters struct { IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' + // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'IkeEncryptionDES', 'IkeEncryptionDES3', 'IkeEncryptionAES128', 'IkeEncryptionAES192', 'IkeEncryptionAES256', 'IkeEncryptionGCMAES256', 'IkeEncryptionGCMAES128' IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` @@ -44510,9 +45029,9 @@ type VpnClientIPsecParameters struct { // VpnClientParameters vpn Client Parameters for package generation. type VpnClientParameters struct { - // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'Amd64', 'X86' + // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'ProcessorArchitectureAmd64', 'ProcessorArchitectureX86' ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` // RadiusServerAuthCertificate - The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` @@ -44603,7 +45122,7 @@ func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { type VpnClientRevokedCertificatePropertiesFormat struct { // Thumbprint - The revoked VPN client certificate thumbprint. Thumbprint *string `json:"thumbprint,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -44698,7 +45217,7 @@ func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { type VpnClientRootCertificatePropertiesFormat struct { // PublicCertData - The certificate public data. PublicCertData *string `json:"publicCertData,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -44818,7 +45337,7 @@ type VpnConnectionProperties struct { DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` @@ -44834,13 +45353,15 @@ type VpnConnectionProperties struct { UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` // IpsecPolicies - The IPSec Policies to be considered by this connection. IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` + // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. + TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` // EnableRateLimiting - EnableBgp flag. EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` // EnableInternetSecurity - Enable internet security. EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` // UseLocalAzureIPAddress - Use local azure ip to initiate connection. UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VpnLinkConnections - List of all vpn site link connections to the gateway. VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` @@ -44881,6 +45402,9 @@ func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { if vcp.IpsecPolicies != nil { objectMap["ipsecPolicies"] = vcp.IpsecPolicies } + if vcp.TrafficSelectorPolicies != nil { + objectMap["trafficSelectorPolicies"] = vcp.TrafficSelectorPolicies + } if vcp.EnableRateLimiting != nil { objectMap["enableRateLimiting"] = vcp.EnableRateLimiting } @@ -45200,6 +45724,137 @@ type VpnGatewayIPConfiguration struct { PrivateIPAddress *string `json:"privateIpAddress,omitempty"` } +// VpnGatewayNatRule vpnGatewayNatRule Resource. +type VpnGatewayNatRule struct { + autorest.Response `json:"-"` + // VpnGatewayNatRuleProperties - Properties of the VpnGateway NAT rule. + *VpnGatewayNatRuleProperties `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VpnGatewayNatRule. +func (vgnr VpnGatewayNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgnr.VpnGatewayNatRuleProperties != nil { + objectMap["properties"] = vgnr.VpnGatewayNatRuleProperties + } + if vgnr.Name != nil { + objectMap["name"] = vgnr.Name + } + if vgnr.ID != nil { + objectMap["id"] = vgnr.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VpnGatewayNatRule struct. +func (vgnr *VpnGatewayNatRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnGatewayNatRuleProperties VpnGatewayNatRuleProperties + err = json.Unmarshal(*v, &vpnGatewayNatRuleProperties) + if err != nil { + return err + } + vgnr.VpnGatewayNatRuleProperties = &vpnGatewayNatRuleProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vgnr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vgnr.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vgnr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vgnr.ID = &ID + } + } + } + + return nil +} + +// VpnGatewayNatRuleProperties parameters for VpnGatewayNatRule. +type VpnGatewayNatRuleProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the NAT Rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Type - The type of NAT rule for VPN NAT. Possible values include: 'VpnNatRuleTypeStatic', 'VpnNatRuleTypeDynamic' + Type VpnNatRuleType `json:"type,omitempty"` + // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'VpnNatRuleModeEgressSnat', 'VpnNatRuleModeIngressSnat' + Mode VpnNatRuleMode `json:"mode,omitempty"` + // InternalMappings - The private IP address internal mapping for NAT. + InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` + // ExternalMappings - The private IP address external mapping for NAT. + ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` + // IPConfigurationID - The IP Configuration ID this NAT rule applies to. + IPConfigurationID *string `json:"ipConfigurationId,omitempty"` + // EgressVpnSiteLinkConnections - READ-ONLY; List of egress VpnSiteLinkConnections. + EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` + // IngressVpnSiteLinkConnections - READ-ONLY; List of ingress VpnSiteLinkConnections. + IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for VpnGatewayNatRuleProperties. +func (vgnrp VpnGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgnrp.Type != "" { + objectMap["type"] = vgnrp.Type + } + if vgnrp.Mode != "" { + objectMap["mode"] = vgnrp.Mode + } + if vgnrp.InternalMappings != nil { + objectMap["internalMappings"] = vgnrp.InternalMappings + } + if vgnrp.ExternalMappings != nil { + objectMap["externalMappings"] = vgnrp.ExternalMappings + } + if vgnrp.IPConfigurationID != nil { + objectMap["ipConfigurationId"] = vgnrp.IPConfigurationID + } + return json.Marshal(objectMap) +} + // VpnGatewayPacketCaptureStartParameters start packet capture parameters. type VpnGatewayPacketCaptureStartParameters struct { // FilterData - Start Packet capture parameters on vpn gateway. @@ -45220,7 +45875,7 @@ type VpnGatewayProperties struct { Connections *[]VpnConnection `json:"connections,omitempty"` // BgpSettings - Local network gateway's BGP speaker settings. BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN gateway resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VpnGatewayScaleUnit - The scale unit for this vpn gateway. VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` @@ -45228,6 +45883,8 @@ type VpnGatewayProperties struct { IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` // IsRoutingPreferenceInternet - Enable Routing Preference property for the Public IP Interface of the VpnGateway. IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` + // NatRules - List of all the nat Rules associated with the gateway. + NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` } // MarshalJSON is the custom marshaler for VpnGatewayProperties. @@ -45248,6 +45905,9 @@ func (vgp VpnGatewayProperties) MarshalJSON() ([]byte, error) { if vgp.IsRoutingPreferenceInternet != nil { objectMap["isRoutingPreferenceInternet"] = vgp.IsRoutingPreferenceInternet } + if vgp.NatRules != nil { + objectMap["natRules"] = vgp.NatRules + } return json.Marshal(objectMap) } @@ -45511,6 +46171,86 @@ type VpnLinkBgpSettings struct { BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` } +// VpnLinkConnectionsGetIkeSasFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VpnLinkConnectionsGetIkeSasFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnLinkConnectionsClient) (String, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnLinkConnectionsGetIkeSasFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VpnLinkConnectionsGetIkeSasFuture.Result. +func (future *VpnLinkConnectionsGetIkeSasFuture) result(client VpnLinkConnectionsClient) (s String, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsGetIkeSasFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VpnLinkConnectionsGetIkeSasFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.GetIkeSasResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsGetIkeSasFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// VpnLinkConnectionsResetConnectionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VpnLinkConnectionsResetConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VpnLinkConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VpnLinkConnectionsResetConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VpnLinkConnectionsResetConnectionFuture.Result. +func (future *VpnLinkConnectionsResetConnectionFuture) result(client VpnLinkConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsResetConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VpnLinkConnectionsResetConnectionFuture") + return + } + ar.Response = future.Response() + return +} + // VpnLinkProviderProperties list of properties of a link provider. type VpnLinkProviderProperties struct { // LinkProviderName - Name of the link provider. @@ -45519,6 +46259,12 @@ type VpnLinkProviderProperties struct { LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` } +// VpnNatRuleMapping vpn NatRule mapping. +type VpnNatRuleMapping struct { + // AddressSpace - Address space for Vpn NatRule mapping. + AddressSpace *string `json:"addressSpace,omitempty"` +} + // VpnPacketCaptureStartParameters start packet capture parameters on virtual network gateway. type VpnPacketCaptureStartParameters struct { // FilterData - Start Packet capture parameters. @@ -46202,9 +46948,11 @@ type VpnSiteLinkConnectionProperties struct { VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` // RoutingWeight - Routing weight for vpn connection. RoutingWeight *int32 `json:"routingWeight,omitempty"` + // VpnLinkConnectionMode - Vpn link connection mode. Possible values include: 'VpnLinkConnectionModeDefault', 'VpnLinkConnectionModeResponderOnly', 'VpnLinkConnectionModeInitiatorOnly' + VpnLinkConnectionMode VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' + // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` @@ -46224,8 +46972,12 @@ type VpnSiteLinkConnectionProperties struct { EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` // UseLocalAzureIPAddress - Use local azure ip to initiate connection. UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link connection resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // IngressNatRules - List of ingress NatRules. + IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` + // EgressNatRules - List of egress NatRules. + EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` } // MarshalJSON is the custom marshaler for VpnSiteLinkConnectionProperties. @@ -46237,6 +46989,9 @@ func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { if vslcp.RoutingWeight != nil { objectMap["routingWeight"] = vslcp.RoutingWeight } + if vslcp.VpnLinkConnectionMode != "" { + objectMap["vpnLinkConnectionMode"] = vslcp.VpnLinkConnectionMode + } if vslcp.ConnectionStatus != "" { objectMap["connectionStatus"] = vslcp.ConnectionStatus } @@ -46264,6 +47019,12 @@ func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { if vslcp.UseLocalAzureIPAddress != nil { objectMap["useLocalAzureIpAddress"] = vslcp.UseLocalAzureIPAddress } + if vslcp.IngressNatRules != nil { + objectMap["ingressNatRules"] = vslcp.IngressNatRules + } + if vslcp.EgressNatRules != nil { + objectMap["egressNatRules"] = vslcp.EgressNatRules + } return json.Marshal(objectMap) } @@ -46277,7 +47038,7 @@ type VpnSiteLinkProperties struct { Fqdn *string `json:"fqdn,omitempty"` // BgpProperties - The set of bgp properties. BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -46313,7 +47074,7 @@ type VpnSiteProperties struct { AddressSpace *AddressSpace `json:"addressSpace,omitempty"` // BgpProperties - The set of bgp properties. BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the VPN site resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // IsSecuritySite - IsSecuritySite flag. IsSecuritySite *bool `json:"isSecuritySite,omitempty"` @@ -46597,7 +47358,7 @@ type WatcherListResult struct { // WatcherPropertiesFormat the network watcher properties. type WatcherPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the network watcher resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the network watcher resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } @@ -47469,7 +48230,7 @@ type WebApplicationFirewallPolicyPropertiesFormat struct { CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"` // ApplicationGateways - READ-ONLY; A collection of references to application gateways. ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall policy resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceState - READ-ONLY; Resource status of the policy. Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/natgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natgateways.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/natgateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natgateways.go index 3805da268c5f..c99072efe26f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/natgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natgateways.go @@ -69,7 +69,7 @@ func (client NatGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client NatGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client NatGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client NatGatewaysClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client NatGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client NatGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natrules.go similarity index 55% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natrules.go index 9203372aa88d..024bb169f195 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/natrules.go @@ -14,32 +14,31 @@ import ( "net/http" ) -// VpnConnectionsClient is the network Client -type VpnConnectionsClient struct { +// NatRulesClient is the network Client +type NatRulesClient struct { BaseClient } -// NewVpnConnectionsClient creates an instance of the VpnConnectionsClient client. -func NewVpnConnectionsClient(subscriptionID string) VpnConnectionsClient { - return NewVpnConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewNatRulesClient creates an instance of the NatRulesClient client. +func NewNatRulesClient(subscriptionID string) NatRulesClient { + return NewNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVpnConnectionsClientWithBaseURI creates an instance of the VpnConnectionsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnConnectionsClient { - return VpnConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewNatRulesClientWithBaseURI creates an instance of the NatRulesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewNatRulesClientWithBaseURI(baseURI string, subscriptionID string) NatRulesClient { + return NatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing -// connection. +// CreateOrUpdate creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. // Parameters: // resourceGroupName - the resource group name of the VpnGateway. // gatewayName - the name of the gateway. -// connectionName - the name of the connection. -// vpnConnectionParameters - parameters supplied to create or Update a VPN Connection. -func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (result VpnConnectionsCreateOrUpdateFuture, err error) { +// natRuleName - the name of the nat rule. +// natRuleParameters - parameters supplied to create or Update a Nat Rule. +func (client NatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VpnGatewayNatRule) (result NatRulesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.CreateOrUpdate") defer func() { sc := -1 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { @@ -48,15 +47,15 @@ func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -64,33 +63,34 @@ func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (*http.Request, error) { +func (client NatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VpnGatewayNatRule) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), "gatewayName": autorest.Encode("path", gatewayName), + "natRuleName": autorest.Encode("path", natRuleName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - vpnConnectionParameters.Etag = nil + natRuleParameters.Etag = nil + natRuleParameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), - autorest.WithJSON(vpnConnectionParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), + autorest.WithJSON(natRuleParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VpnConnectionsCreateOrUpdateFuture, err error) { +func (client NatRulesClient) CreateOrUpdateSender(req *http.Request) (future NatRulesCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { @@ -105,7 +105,7 @@ func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (futu // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnConnection, err error) { +func (client NatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGatewayNatRule, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), @@ -115,14 +115,14 @@ func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete deletes a vpn connection. +// Delete deletes a nat rule. // Parameters: // resourceGroupName - the resource group name of the VpnGateway. // gatewayName - the name of the gateway. -// connectionName - the name of the connection. -func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnectionsDeleteFuture, err error) { +// natRuleName - the name of the nat rule. +func (client NatRulesClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (result NatRulesDeleteFuture, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.Delete") defer func() { sc := -1 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { @@ -131,15 +131,15 @@ func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName, connectionName) + req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName, natRuleName) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Delete", nil, "Failure sending request") return } @@ -147,15 +147,15 @@ func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName } // DeletePreparer prepares the Delete request. -func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { +func (client NatRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), "gatewayName": autorest.Encode("path", gatewayName), + "natRuleName": autorest.Encode("path", natRuleName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,14 +163,14 @@ func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnConnectionsDeleteFuture, err error) { +func (client NatRulesClient) DeleteSender(req *http.Request) (future NatRulesDeleteFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { @@ -185,7 +185,7 @@ func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnCo // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client NatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), @@ -194,14 +194,14 @@ func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result return } -// Get retrieves the details of a vpn connection. +// Get retrieves the details of a nat ruleGet. // Parameters: // resourceGroupName - the resource group name of the VpnGateway. // gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnection, err error) { +// natRuleName - the name of the nat rule. +func (client NatRulesClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (result VpnGatewayNatRule, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -210,22 +210,22 @@ func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, connectionName) + req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, natRuleName) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", resp, "Failure responding to request") return } @@ -233,15 +233,15 @@ func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName st } // GetPreparer prepares the Get request. -func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { +func (client NatRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), "gatewayName": autorest.Encode("path", gatewayName), + "natRuleName": autorest.Encode("path", natRuleName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,20 +249,20 @@ func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client VpnConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client NatRulesClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result VpnConnection, err error) { +func (client NatRulesClient) GetResponder(resp *http.Response) (result VpnGatewayNatRule, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -272,17 +272,17 @@ func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result Vpn return } -// ListByVpnGateway retrieves all vpn connections for a particular virtual wan vpn gateway. +// ListByVpnGateway retrieves all nat rules for a particular virtual wan vpn gateway. // Parameters: // resourceGroupName - the resource group name of the VpnGateway. // gatewayName - the name of the gateway. -func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnConnectionsResultPage, err error) { +func (client NatRulesClient) ListByVpnGateway(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnGatewayNatRulesResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.ListByVpnGateway") + ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.ListByVpnGateway") defer func() { sc := -1 - if result.lvcr.Response.Response != nil { - sc = result.lvcr.Response.Response.StatusCode + if result.lvgnrr.Response.Response != nil { + sc = result.lvgnrr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -290,23 +290,23 @@ func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourc result.fn = client.listByVpnGatewayNextResults req, err := client.ListByVpnGatewayPreparer(ctx, resourceGroupName, gatewayName) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", nil, "Failure preparing request") return } resp, err := client.ListByVpnGatewaySender(req) if err != nil { - result.lvcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure sending request") + result.lvgnrr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", resp, "Failure sending request") return } - result.lvcr, err = client.ListByVpnGatewayResponder(resp) + result.lvgnrr, err = client.ListByVpnGatewayResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", resp, "Failure responding to request") return } - if result.lvcr.hasNextLink() && result.lvcr.IsEmpty() { + if result.lvgnrr.hasNextLink() && result.lvgnrr.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -315,14 +315,14 @@ func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourc } // ListByVpnGatewayPreparer prepares the ListByVpnGateway request. -func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { +func (client NatRulesClient) ListByVpnGatewayPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "gatewayName": autorest.Encode("path", gatewayName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -330,20 +330,20 @@ func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByVpnGatewaySender sends the ListByVpnGateway request. The method will close the // http.Response Body if it receives an error. -func (client VpnConnectionsClient) ListByVpnGatewaySender(req *http.Request) (*http.Response, error) { +func (client NatRulesClient) ListByVpnGatewaySender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByVpnGatewayResponder handles the response to the ListByVpnGateway request. The method always // closes the http.Response Body. -func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnConnectionsResult, err error) { +func (client NatRulesClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnGatewayNatRulesResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -354,10 +354,10 @@ func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response } // listByVpnGatewayNextResults retrieves the next set of results, if any. -func (client VpnConnectionsClient) listByVpnGatewayNextResults(ctx context.Context, lastResults ListVpnConnectionsResult) (result ListVpnConnectionsResult, err error) { - req, err := lastResults.listVpnConnectionsResultPreparer(ctx) +func (client NatRulesClient) listByVpnGatewayNextResults(ctx context.Context, lastResults ListVpnGatewayNatRulesResult) (result ListVpnGatewayNatRulesResult, err error) { + req, err := lastResults.listVpnGatewayNatRulesResultPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -365,19 +365,19 @@ func (client VpnConnectionsClient) listByVpnGatewayNextResults(ctx context.Conte resp, err := client.ListByVpnGatewaySender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", resp, "Failure sending next results request") } result, err = client.ListByVpnGatewayResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", resp, "Failure responding to next results request") } return } // ListByVpnGatewayComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnConnectionsClient) ListByVpnGatewayComplete(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnConnectionsResultIterator, err error) { +func (client NatRulesClient) ListByVpnGatewayComplete(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnGatewayNatRulesResultIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.ListByVpnGateway") + ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.ListByVpnGateway") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/operations.go index 39b69d1b761f..bcc24507f986 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/operations.go @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/p2svpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/p2svpngateways.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/p2svpngateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/p2svpngateways.go index 7f0802eafcf6..59f437aaab6b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/p2svpngateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/p2svpngateways.go @@ -69,7 +69,7 @@ func (client P2sVpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client P2sVpnGatewaysClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -229,7 +229,7 @@ func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,7 +309,7 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfilePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -396,7 +396,7 @@ func (client P2sVpnGatewaysClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -466,7 +466,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -633,7 +633,7 @@ func (client P2sVpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -749,7 +749,7 @@ func (client P2sVpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -855,7 +855,7 @@ func (client P2sVpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -934,7 +934,7 @@ func (client P2sVpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/packetcaptures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/packetcaptures.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/packetcaptures.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/packetcaptures.go index 528444f9d741..a0a2fd675381 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/packetcaptures.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/packetcaptures.go @@ -93,7 +93,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,7 +175,7 @@ func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,7 +261,7 @@ func (client PacketCapturesClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -332,7 +332,7 @@ func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -417,7 +417,7 @@ func (client PacketCapturesClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -488,7 +488,7 @@ func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/peerexpressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/peerexpressroutecircuitconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/peerexpressroutecircuitconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/peerexpressroutecircuitconnections.go index 746183e4371f..16f69caf0544 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/peerexpressroutecircuitconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/peerexpressroutecircuitconnections.go @@ -81,7 +81,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatednszonegroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatednszonegroups.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatednszonegroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatednszonegroups.go index 610a744da893..ff5b39e24185 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privatednszonegroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatednszonegroups.go @@ -72,7 +72,7 @@ func (client PrivateDNSZoneGroupsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client PrivateDNSZoneGroupsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client PrivateDNSZoneGroupsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +322,7 @@ func (client PrivateDNSZoneGroupsClient) ListPreparer(ctx context.Context, priva "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privateendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privateendpoints.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privateendpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privateendpoints.go index c7d138a9f998..f8702d8b3412 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/privateendpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privateendpoints.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -47,6 +48,15 @@ func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.PrivateEndpointsClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateEndpointName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -70,7 +80,7 @@ func (client PrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +161,7 @@ func (client PrivateEndpointsClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +246,7 @@ func (client PrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +328,7 @@ func (client PrivateEndpointsClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +441,7 @@ func (client PrivateEndpointsClient) ListBySubscriptionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatelinkservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatelinkservices.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatelinkservices.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatelinkservices.go index b3c3b8a6973e..3505f35b48dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/privatelinkservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/privatelinkservices.go @@ -10,6 +10,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -68,7 +69,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPrepare "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +151,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -208,6 +209,15 @@ func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.PrivateLinkServicesClient", "CreateOrUpdate", err.Error()) + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure preparing request") @@ -231,7 +241,7 @@ func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +322,7 @@ func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,7 +401,7 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -476,7 +486,7 @@ func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -559,7 +569,7 @@ func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -641,7 +651,7 @@ func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -758,7 +768,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPrepa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -877,7 +887,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByRes "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -990,7 +1000,7 @@ func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1108,7 +1118,7 @@ func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1194,6 +1204,19 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx cont tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateEndpoint", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.PrivateEndpointConnectionProperties.PrivateEndpoint.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", err.Error()) + } + req, err := client.UpdatePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", nil, "Failure preparing request") @@ -1225,7 +1248,7 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/profiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/profiles.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/profiles.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/profiles.go index 05db9601b2bc..55491eec6faa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/profiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/profiles.go @@ -76,7 +76,7 @@ func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -148,7 +148,7 @@ func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -233,7 +233,7 @@ func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client ProfilesClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +428,7 @@ func (client ProfilesClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,7 +542,7 @@ func (client ProfilesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipaddresses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipaddresses.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipaddresses.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipaddresses.go index 3d9f9efeaee2..364b884eda2f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipaddresses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipaddresses.go @@ -86,7 +86,7 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,7 +167,7 @@ func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client PublicIPAddressesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -340,7 +340,7 @@ func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -510,7 +510,7 @@ func (client PublicIPAddressesClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -623,7 +623,7 @@ func (client PublicIPAddressesClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -741,7 +741,7 @@ func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -814,7 +814,7 @@ func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesComplete( // Parameters: // resourceGroupName - the name of the resource group. // cloudServiceName - the name of the cloud service. -// roleInstanceName - the name of role instance +// roleInstanceName - the name of role instance. // networkInterfaceName - the network interface name. // IPConfigurationName - the IP configuration name. func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddresses(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) { @@ -866,7 +866,7 @@ func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddres "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1224,7 +1224,7 @@ func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipprefixes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipprefixes.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipprefixes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipprefixes.go index 433dab4c6bed..85756f03e202 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/publicipprefixes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/publicipprefixes.go @@ -80,7 +80,7 @@ func (client PublicIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client PublicIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client PublicIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client PublicIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -441,7 +441,7 @@ func (client PublicIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -555,7 +555,7 @@ func (client PublicIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/resourcenavigationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/resourcenavigationlinks.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/resourcenavigationlinks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/resourcenavigationlinks.go index bf505d758e2e..40ff941773ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/resourcenavigationlinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/resourcenavigationlinks.go @@ -78,7 +78,7 @@ func (client ResourceNavigationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilterrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilterrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilterrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilterrules.go index c2f9fa7b4f2b..33252726bfb7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilterrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilterrules.go @@ -82,7 +82,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -332,7 +332,7 @@ func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilters.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilters.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilters.go index 7b39e551c6bd..9530ffd2c76e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/routefilters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routefilters.go @@ -69,7 +69,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client RouteFiltersClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client RouteFiltersClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client RouteFiltersClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client RouteFiltersClient) UpdateTagsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routes.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routes.go index de33081b9f92..1c3445945144 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routes.go @@ -71,7 +71,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -154,7 +154,7 @@ func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client RoutesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client RoutesClient) ListPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routetables.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routetables.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routetables.go index 2516a912e0cd..d0571c5a88a8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/routetables.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/routetables.go @@ -69,7 +69,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client RouteTablesClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client RouteTablesClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client RouteTablesClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitygroups.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitygroups.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitygroups.go index 509022cd4ef8..96f1b193eb9c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitygroups.go @@ -69,7 +69,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client SecurityGroupsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client SecurityGroupsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client SecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitypartnerproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitypartnerproviders.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitypartnerproviders.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitypartnerproviders.go index 94fbf6d62058..02f6d3f3d192 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securitypartnerproviders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securitypartnerproviders.go @@ -70,7 +70,7 @@ func (client SecurityPartnerProvidersClient) CreateOrUpdatePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client SecurityPartnerProvidersClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client SecurityPartnerProvidersClient) GetPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -311,7 +311,7 @@ func (client SecurityPartnerProvidersClient) ListPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -427,7 +427,7 @@ func (client SecurityPartnerProvidersClient) ListByResourceGroupPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -541,7 +541,7 @@ func (client SecurityPartnerProvidersClient) UpdateTagsPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securityrules.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securityrules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securityrules.go index f27a0ab719b7..3fa4d1619b7d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/securityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/securityrules.go @@ -71,7 +71,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -154,7 +154,7 @@ func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client SecurityRulesClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client SecurityRulesClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceassociationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceassociationlinks.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceassociationlinks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceassociationlinks.go index 05d600b47bcb..b95cca215e71 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/serviceassociationlinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceassociationlinks.go @@ -78,7 +78,7 @@ func (client ServiceAssociationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicies.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicies.go index 87271b8707b8..d7955c392139 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicies.go @@ -70,12 +70,13 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } parameters.Etag = nil + parameters.Kind = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -151,7 +152,7 @@ func (client ServiceEndpointPoliciesClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +237,7 @@ func (client ServiceEndpointPoliciesClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +316,7 @@ func (client ServiceEndpointPoliciesClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -431,7 +432,7 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -545,7 +546,7 @@ func (client ServiceEndpointPoliciesClient) UpdateTagsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicydefinitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicydefinitions.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicydefinitions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicydefinitions.go index 4f5a0c6cd847..1e93d70f20a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/serviceendpointpolicydefinitions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/serviceendpointpolicydefinitions.go @@ -73,7 +73,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeletePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) GetPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/servicetags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/servicetags.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/servicetags.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/servicetags.go index abfdf48942b0..44c8fc85aa98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/servicetags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/servicetags.go @@ -75,7 +75,7 @@ func (client ServiceTagsClient) ListPreparer(ctx context.Context, location strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/subnets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/subnets.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/subnets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/subnets.go index ba6d86de42aa..94ad166e5700 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/subnets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/subnets.go @@ -71,7 +71,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -154,7 +154,7 @@ func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupNam "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName s "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client SubnetsClient) ListPreparer(ctx context.Context, resourceGroupName "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +435,7 @@ func (client SubnetsClient) PrepareNetworkPoliciesPreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -518,7 +518,7 @@ func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/usages.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/usages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/usages.go index 4441ff18a76a..7529ba16cd00 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/usages.go @@ -85,7 +85,7 @@ func (client UsagesClient) ListPreparer(ctx context.Context, location string) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/version.go similarity index 90% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/version.go index bb1f92753170..426a4253811a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " network/2020-05-01" + return "Azure-SDK-For-Go/" + Version() + " network/2020-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliances.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliances.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliances.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliances.go index bdf15c410f27..81f76e22eb9b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliances.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliances.go @@ -82,7 +82,7 @@ func (client VirtualAppliancesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client VirtualAppliancesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client VirtualAppliancesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client VirtualAppliancesClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,7 +443,7 @@ func (client VirtualAppliancesClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -557,7 +557,7 @@ func (client VirtualAppliancesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliancesites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliancesites.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliancesites.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliancesites.go index 74e739ab0ec4..d39a743cd0a4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualappliancesites.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualappliancesites.go @@ -72,7 +72,7 @@ func (client VirtualApplianceSitesClient) CreateOrUpdatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client VirtualApplianceSitesClient) DeletePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client VirtualApplianceSitesClient) GetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client VirtualApplianceSitesClient) ListPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualapplianceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualapplianceskus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualapplianceskus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualapplianceskus.go index e35f39e848e0..3da46550eb0b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualapplianceskus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualapplianceskus.go @@ -74,7 +74,7 @@ func (client VirtualApplianceSkusClient) GetPreparer(ctx context.Context, skuNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client VirtualApplianceSkusClient) ListPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnection.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnection.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnection.go index 981c27832839..db45aa4cdd96 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnection.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnection.go @@ -85,7 +85,7 @@ func (client VirtualHubBgpConnectionClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client VirtualHubBgpConnectionClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,7 +255,7 @@ func (client VirtualHubBgpConnectionClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnections.go index 4c799095f819..49475bd13de9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubbgpconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubbgpconnections.go @@ -81,7 +81,7 @@ func (client VirtualHubBgpConnectionsClient) ListPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -189,7 +189,7 @@ func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -269,7 +269,7 @@ func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubipconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubipconfiguration.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubipconfiguration.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubipconfiguration.go index 58244a9d4b6b..719feba031ff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualhubipconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubipconfiguration.go @@ -93,7 +93,7 @@ func (client VirtualHubIPConfigurationClient) CreateOrUpdatePreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client VirtualHubIPConfigurationClient) DeletePreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client VirtualHubIPConfigurationClient) GetPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client VirtualHubIPConfigurationClient) ListPreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubroutetablev2s.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubroutetablev2s.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubroutetablev2s.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubroutetablev2s.go index 2fbd0b6e89e9..4260d586bf9d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubroutetablev2s.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubroutetablev2s.go @@ -73,7 +73,7 @@ func (client VirtualHubRouteTableV2sClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client VirtualHubRouteTableV2sClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client VirtualHubRouteTableV2sClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client VirtualHubRouteTableV2sClient) ListPreparer(ctx context.Context, re "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubs.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubs.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubs.go index f5db8120919e..c1d85317e272 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualhubs.go @@ -81,7 +81,7 @@ func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, reso "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupNa "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesPreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -406,7 +406,7 @@ func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -522,7 +522,7 @@ func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -636,7 +636,7 @@ func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resource "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgatewayconnections.go similarity index 83% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgatewayconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgatewayconnections.go index 5ba03dea1ed0..d1bae2ac9412 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgatewayconnections.go @@ -52,32 +52,32 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context. {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, }}, }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, }}, {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, }}, }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, }}, {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, @@ -116,7 +116,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context. "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -281,7 +281,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(ctx context.Con "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,6 +312,85 @@ func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Res return } +// GetIkeSas lists IKE Security Associations for the virtual network gateway connection in the specified resource +// group. +// Parameters: +// resourceGroupName - the name of the resource group. +// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. +func (client VirtualNetworkGatewayConnectionsClient) GetIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsGetIkeSasFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.GetIkeSas") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIkeSasPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetIkeSas", nil, "Failure preparing request") + return + } + + result, err = client.GetIkeSasSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetIkeSas", nil, "Failure sending request") + return + } + + return +} + +// GetIkeSasPreparer prepares the GetIkeSas request. +func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIkeSasSender sends the GetIkeSas request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasSender(req *http.Request) (future VirtualNetworkGatewayConnectionsGetIkeSasFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GetIkeSasResponder handles the response to the GetIkeSas request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified // virtual network gateway connection shared key through Network resource provider. // Parameters: @@ -358,7 +437,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -438,7 +517,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -506,6 +585,83 @@ func (client VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Co return } +// ResetConnection resets the virtual network gateway connection specified. +// Parameters: +// resourceGroupName - the name of the resource group. +// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. +func (client VirtualNetworkGatewayConnectionsClient) ResetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsResetConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.ResetConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetConnectionPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetConnection", nil, "Failure preparing request") + return + } + + result, err = client.ResetConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetConnection", nil, "Failure sending request") + return + } + + return +} + +// ResetConnectionPreparer prepares the ResetConnection request. +func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetConnectionSender sends the ResetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionSender(req *http.Request) (future VirtualNetworkGatewayConnectionsResetConnectionFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResetConnectionResponder handles the response to the ResetConnection request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway // connection shared key for passed virtual network gateway connection in the specified resource group through Network // resource provider. @@ -557,7 +713,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -647,7 +803,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -729,7 +885,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapturePreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -814,7 +970,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapturePreparer(c "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -895,7 +1051,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx cont "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgateways.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgateways.go index 843a11fc76b5..fb2b6dc079d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkgateways.go @@ -50,14 +50,18 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, r } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + Constraints: []validation.Constraint{{Target: "parameters.ExtendedLocation", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ExtendedLocation.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ExtendedLocation.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, + {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, }}, - }}, - }}}}}); err != nil { + }}}}}); err != nil { return result, validation.NewError("network.VirtualNetworkGatewaysClient", "CreateOrUpdate", err.Error()) } @@ -84,7 +88,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +169,7 @@ func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, r "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +248,7 @@ func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnCon "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +329,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -407,7 +411,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -494,7 +498,7 @@ func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, reso "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -565,7 +569,7 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "peer": autorest.Encode("query", peer), @@ -645,7 +649,7 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -727,7 +731,7 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -806,7 +810,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthPreparer( "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -886,7 +890,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -965,7 +969,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1053,7 +1057,7 @@ func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1171,7 +1175,7 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(ctx context.C "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1279,7 +1283,7 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, re "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1361,7 +1365,7 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1448,7 +1452,7 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1529,7 +1533,7 @@ func (client VirtualNetworkGatewaysClient) StartPacketCapturePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1613,7 +1617,7 @@ func (client VirtualNetworkGatewaysClient) StopPacketCapturePreparer(ctx context "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1700,7 +1704,7 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1770,7 +1774,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1859,7 +1863,7 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkpeerings.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkpeerings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkpeerings.go index 43171552db37..b8b58e26cf9d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworkpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworkpeerings.go @@ -83,7 +83,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, r "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client VirtualNetworkPeeringsClient) GetPreparer(ctx context.Context, reso "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client VirtualNetworkPeeringsClient) ListPreparer(ctx context.Context, res "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworks.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworks.go index d6289f6703aa..9d5cf65594c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworks.go @@ -77,7 +77,7 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(ctx conte "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "ipAddress": autorest.Encode("query", IPAddress), @@ -161,7 +161,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGro "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -409,7 +409,7 @@ func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -522,7 +522,7 @@ func (client VirtualNetworksClient) ListAllPreparer(ctx context.Context) (*http. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -640,7 +640,7 @@ func (client VirtualNetworksClient) ListUsagePreparer(ctx context.Context, resou "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -754,7 +754,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworktaps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworktaps.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworktaps.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworktaps.go index 788bafa64c83..9142201dae20 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualnetworktaps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualnetworktaps.go @@ -110,7 +110,7 @@ func (client VirtualNetworkTapsClient) CreateOrUpdatePreparer(ctx context.Contex "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -191,7 +191,7 @@ func (client VirtualNetworkTapsClient) DeletePreparer(ctx context.Context, resou "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client VirtualNetworkTapsClient) GetPreparer(ctx context.Context, resource "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +351,7 @@ func (client VirtualNetworkTapsClient) ListAllPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -467,7 +467,7 @@ func (client VirtualNetworkTapsClient) ListByResourceGroupPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -581,7 +581,7 @@ func (client VirtualNetworkTapsClient) UpdateTagsPreparer(ctx context.Context, r "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouterpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouterpeerings.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouterpeerings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouterpeerings.go index d82ba5bbd7fd..d11de334f655 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualrouterpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouterpeerings.go @@ -84,7 +84,7 @@ func (client VirtualRouterPeeringsClient) CreateOrUpdatePreparer(ctx context.Con "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,7 +168,7 @@ func (client VirtualRouterPeeringsClient) DeletePreparer(ctx context.Context, re "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -254,7 +254,7 @@ func (client VirtualRouterPeeringsClient) GetPreparer(ctx context.Context, resou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +335,7 @@ func (client VirtualRouterPeeringsClient) ListPreparer(ctx context.Context, reso "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouters.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouters.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouters.go index 4f3d0b51f9b1..62f9c93367ed 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/virtualrouters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualrouters.go @@ -81,7 +81,7 @@ func (client VirtualRoutersClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client VirtualRoutersClient) DeletePreparer(ctx context.Context, resourceG "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -247,7 +247,7 @@ func (client VirtualRoutersClient) GetPreparer(ctx context.Context, resourceGrou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VirtualRoutersClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client VirtualRoutersClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualwans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualwans.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualwans.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualwans.go index cba8d3436ced..5f4a3f0a28b0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/virtualwans.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/virtualwans.go @@ -69,7 +69,7 @@ func (client VirtualWansClient) CreateOrUpdatePreparer(ctx context.Context, reso "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client VirtualWansClient) DeletePreparer(ctx context.Context, resourceGrou "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -234,7 +234,7 @@ func (client VirtualWansClient) GetPreparer(ctx context.Context, resourceGroupNa "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +310,7 @@ func (client VirtualWansClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -426,7 +426,7 @@ func (client VirtualWansClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -540,7 +540,7 @@ func (client VirtualWansClient) UpdateTagsPreparer(ctx context.Context, resource "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnconnections.go index 106317686c84..e41736cceea8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnconnections.go @@ -72,7 +72,7 @@ func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +322,7 @@ func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client VpnConnectionsClient) StartPacketCapturePreparer(ctx context.Contex "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -518,7 +518,7 @@ func (client VpnConnectionsClient) StopPacketCapturePreparer(ctx context.Context "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpngateways.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpngateways.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpngateways.go index 987fa4838ec6..33dbfcc307ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpngateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpngateways.go @@ -83,7 +83,7 @@ func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,7 +440,7 @@ func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client VpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -625,7 +625,7 @@ func (client VpnGatewaysClient) StartPacketCapturePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -709,7 +709,7 @@ func (client VpnGatewaysClient) StopPacketCapturePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -793,7 +793,7 @@ func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnlinkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnlinkconnections.go new file mode 100644 index 000000000000..7ea1cc715b4e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnlinkconnections.go @@ -0,0 +1,315 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VpnLinkConnectionsClient is the network Client +type VpnLinkConnectionsClient struct { + BaseClient +} + +// NewVpnLinkConnectionsClient creates an instance of the VpnLinkConnectionsClient client. +func NewVpnLinkConnectionsClient(subscriptionID string) VpnLinkConnectionsClient { + return NewVpnLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVpnLinkConnectionsClientWithBaseURI creates an instance of the VpnLinkConnectionsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewVpnLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnLinkConnectionsClient { + return VpnLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetIkeSas lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// gatewayName - the name of the gateway. +// connectionName - the name of the vpn connection. +// linkConnectionName - the name of the vpn link connection. +func (client VpnLinkConnectionsClient) GetIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnLinkConnectionsGetIkeSasFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.GetIkeSas") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetIkeSasPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "GetIkeSas", nil, "Failure preparing request") + return + } + + result, err = client.GetIkeSasSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "GetIkeSas", nil, "Failure sending request") + return + } + + return +} + +// GetIkeSasPreparer prepares the GetIkeSas request. +func (client VpnLinkConnectionsClient) GetIkeSasPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "linkConnectionName": autorest.Encode("path", linkConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetIkeSasSender sends the GetIkeSas request. The method will close the +// http.Response Body if it receives an error. +func (client VpnLinkConnectionsClient) GetIkeSasSender(req *http.Request) (future VpnLinkConnectionsGetIkeSasFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GetIkeSasResponder handles the response to the GetIkeSas request. The method always +// closes the http.Response Body. +func (client VpnLinkConnectionsClient) GetIkeSasResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByVpnConnection retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. +// Parameters: +// resourceGroupName - the resource group name of the vpn gateway. +// gatewayName - the name of the gateway. +// connectionName - the name of the vpn connection. +func (client VpnLinkConnectionsClient) ListByVpnConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") + defer func() { + sc := -1 + if result.lvslcr.Response.Response != nil { + sc = result.lvslcr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByVpnConnectionNextResults + req, err := client.ListByVpnConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVpnConnectionSender(req) + if err != nil { + result.lvslcr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure sending request") + return + } + + result.lvslcr, err = client.ListByVpnConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure responding to request") + return + } + if result.lvslcr.hasNextLink() && result.lvslcr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByVpnConnectionPreparer prepares the ListByVpnConnection request. +func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVpnConnectionSender sends the ListByVpnConnection request. The method will close the +// http.Response Body if it receives an error. +func (client VpnLinkConnectionsClient) ListByVpnConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVpnConnectionResponder handles the response to the ListByVpnConnection request. The method always +// closes the http.Response Body. +func (client VpnLinkConnectionsClient) ListByVpnConnectionResponder(resp *http.Response) (result ListVpnSiteLinkConnectionsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVpnConnectionNextResults retrieves the next set of results, if any. +func (client VpnLinkConnectionsClient) listByVpnConnectionNextResults(ctx context.Context, lastResults ListVpnSiteLinkConnectionsResult) (result ListVpnSiteLinkConnectionsResult, err error) { + req, err := lastResults.listVpnSiteLinkConnectionsResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVpnConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVpnConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVpnConnectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client VpnLinkConnectionsClient) ListByVpnConnectionComplete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByVpnConnection(ctx, resourceGroupName, gatewayName, connectionName) + return +} + +// ResetConnection resets the VpnLink connection specified. +// Parameters: +// resourceGroupName - the name of the resource group. +// gatewayName - the name of the gateway. +// connectionName - the name of the vpn connection. +// linkConnectionName - the name of the vpn link connection. +func (client VpnLinkConnectionsClient) ResetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnLinkConnectionsResetConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ResetConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ResetConnection", nil, "Failure preparing request") + return + } + + result, err = client.ResetConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ResetConnection", nil, "Failure sending request") + return + } + + return +} + +// ResetConnectionPreparer prepares the ResetConnection request. +func (client VpnLinkConnectionsClient) ResetConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionName": autorest.Encode("path", connectionName), + "gatewayName": autorest.Encode("path", gatewayName), + "linkConnectionName": autorest.Encode("path", linkConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetConnectionSender sends the ResetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client VpnLinkConnectionsClient) ResetConnectionSender(req *http.Request) (future VpnLinkConnectionsResetConnectionFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResetConnectionResponder handles the response to the ResetConnection request. The method always +// closes the http.Response Body. +func (client VpnLinkConnectionsClient) ResetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurations.go index d2c5b7cd1322..9b79e685e24f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurations.go @@ -71,7 +71,7 @@ func (client VpnServerConfigurationsClient) CreateOrUpdatePreparer(ctx context.C "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client VpnServerConfigurationsClient) DeletePreparer(ctx context.Context, "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client VpnServerConfigurationsClient) GetPreparer(ctx context.Context, res "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client VpnServerConfigurationsClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +428,7 @@ func (client VpnServerConfigurationsClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,7 +542,7 @@ func (client VpnServerConfigurationsClient) UpdateTagsPreparer(ctx context.Conte "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go index 1ea7dede397b..1cc927b08e5f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go @@ -70,7 +70,7 @@ func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListPreparer "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinkconnections.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinkconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinkconnections.go index 31a9da99c5e9..6026e78ee32a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsitelinkconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinkconnections.go @@ -80,7 +80,7 @@ func (client VpnSiteLinkConnectionsClient) GetPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinks.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinks.go index bdfc0513f567..9e86a3cf6dfd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitelinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitelinks.go @@ -77,7 +77,7 @@ func (client VpnSiteLinksClient) GetPreparer(ctx context.Context, resourceGroupN "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client VpnSiteLinksClient) ListByVpnSitePreparer(ctx context.Context, reso "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsites.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsites.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsites.go index 55bca40a8ef3..fd6e140e8bd8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/vpnsites.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsites.go @@ -83,7 +83,7 @@ func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupNa "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,7 +440,7 @@ func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -554,7 +554,7 @@ func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitesconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitesconfiguration.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitesconfiguration.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitesconfiguration.go index 9ea920d5e44c..a092ed98e4bf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network/vpnsitesconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/vpnsitesconfiguration.go @@ -77,7 +77,7 @@ func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2020-05-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/watchers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/watchers.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/watchers.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/watchers.go index 5748e5f2abe3..78e6dc55a859 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/watchers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/watchers.go @@ -89,7 +89,7 @@ func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client WatchersClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -413,7 +413,7 @@ func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -500,7 +500,7 @@ func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -592,7 +592,7 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -681,7 +681,7 @@ func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -769,7 +769,7 @@ func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -851,7 +851,7 @@ func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -938,7 +938,7 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1025,7 +1025,7 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1110,7 +1110,7 @@ func (client WatchersClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1181,7 +1181,7 @@ func (client WatchersClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1252,7 +1252,7 @@ func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1343,7 +1343,7 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1431,7 +1431,7 @@ func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1513,7 +1513,7 @@ func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webapplicationfirewallpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webapplicationfirewallpolicies.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webapplicationfirewallpolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webapplicationfirewallpolicies.go index 597892b90e2b..cf4ef6ec544d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webapplicationfirewallpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webapplicationfirewallpolicies.go @@ -97,7 +97,7 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,7 +175,7 @@ func (client WebApplicationFirewallPoliciesClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +265,7 @@ func (client WebApplicationFirewallPoliciesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client WebApplicationFirewallPoliciesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -457,7 +457,7 @@ func (client WebApplicationFirewallPoliciesClient) ListAllPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webcategories.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webcategories.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webcategories.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webcategories.go index 0167d08854be..81d9c0e9a247 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network/webcategories.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network/webcategories.go @@ -74,7 +74,7 @@ func (client WebCategoriesClient) GetPreparer(ctx context.Context, name string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client WebCategoriesClient) ListBySubscriptionPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-07-01" + const APIVersion = "2020-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/modules.txt b/vendor/modules.txt index 986e37b38a91..aa69e6402fcf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -65,8 +65,7 @@ github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights github.com/Azure/azure-sdk-for-go/services/msi/mgmt/2018-11-30/msi github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2020-09-01/netapp -github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network -github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-07-01/network +github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-11-01/network github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2020-08-01/operationalinsights github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2020-01-01/postgresql diff --git a/website/docs/r/public_ip.html.markdown b/website/docs/r/public_ip.html.markdown index 120855bab1c3..9d4dd11fd825 100644 --- a/website/docs/r/public_ip.html.markdown +++ b/website/docs/r/public_ip.html.markdown @@ -50,6 +50,10 @@ The following arguments are supported: ~> **Note** `Dynamic` Public IP Addresses aren't allocated until they're assigned to a resource (such as a Virtual Machine or a Load Balancer) by design within Azure - [more information is available below](#ip_address). +* `availability_zone` - (Optional) The availability zone to allocate the Public IP in. Possible values are `Zone-Redundant`, `1`, `2`, `3`, and `No-Zone`. Defaults to `Zone-Redundant`. + +-> **Note**: Availability Zones are only supported with a [Standard SKU](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-ip-addresses-overview-arm#standard) and [in select regions](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview) at this time. Standard SKU Public IP Addresses that do not specify a zone are zone redundant by default. + * `ip_version` - (Optional) The IP Version to use, IPv6 or IPv4. -> **Note** Only `dynamic` IP address allocation is supported for IPv6. @@ -68,10 +72,6 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. -* `zones` - (Optional) A collection containing the availability zone to allocate the Public IP in. - --> **Please Note**: Availability Zones are only supported with a [Standard SKU](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-ip-addresses-overview-arm#standard) and [in select regions](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview) at this time. Standard SKU Public IP Addresses that do not specify a zone are zone redundant by default. - ## Attributes Reference The following attributes are exported: diff --git a/website/docs/r/public_ip_prefix.html.markdown b/website/docs/r/public_ip_prefix.html.markdown index d917eb9a45cd..f651ba0824fd 100644 --- a/website/docs/r/public_ip_prefix.html.markdown +++ b/website/docs/r/public_ip_prefix.html.markdown @@ -45,14 +45,16 @@ The following arguments are supported: -> **Note**: Public IP Prefix can only be created with Standard SKUs at this time. +* `availability_zone` - (Optional) The availability zone to allocate the Public IP in. Possible values are `Zone-Redundant`, `1`, `2`, `3`, and `No-Zone`. Defaults to `Zone-Redundant`. + +-> **Note**: Availability Zones are only supported with a [Standard SKU](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-ip-addresses-overview-arm#standard) and [in select regions](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview) at this time. + * `prefix_length` - (Optional) Specifies the number of bits of the prefix. The value can be set between 0 (4,294,967,296 addresses) and 31 (2 addresses). Defaults to `28`(16 addresses). Changing this forces a new resource to be created. -> **Please Note**: There may be Public IP address limits on the subscription . [More information available here](https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits?toc=%2fazure%2fvirtual-network%2ftoc.json#publicip-address) * `tags` - (Optional) A mapping of tags to assign to the resource. -* `zones` - (Optional) A collection containing the availability zone to allocate the Public IP Prefix in. - -> **Please Note**: Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview). ## Attributes Reference