//go:build go1.18
// +build go1.18

// 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.
// DO NOT EDIT.

package armnetwork_test

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayGet.json
func ExampleP2SVPNGatewaysClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewP2SVPNGatewaysClient().Get(ctx, "rg1", "p2sVpnGateway1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNGateway = armnetwork.P2SVPNGateway{
	// 	Name: to.Ptr("p2sVpnGateway1"),
	// 	Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
	// 	Location: to.Ptr("West US"),
	// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 	Properties: &armnetwork.P2SVPNGatewayProperties{
	// 		CustomDNSServers: []*string{
	// 			to.Ptr("3.3.3.3")},
	// 			IsRoutingPreferenceInternet: to.Ptr(false),
	// 			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
	// 					Name: to.Ptr("P2SConnectionConfig1"),
	// 					Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 					Properties: &armnetwork.P2SConnectionConfigurationProperties{
	// 						ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
	// 						}},
	// 						EnableInternetSecurity: to.Ptr(false),
	// 						PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
	// 								Name: to.Ptr("policyGroup1"),
	// 								Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
	// 									IsDefault: to.Ptr(true),
	// 									PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
	// 										{
	// 											Name: to.Ptr("policy1"),
	// 											AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
	// 											AttributeValue: to.Ptr("6ad1bd08"),
	// 									}},
	// 									Priority: to.Ptr[int32](0),
	// 									ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 								},
	// 						}},
	// 						ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 						RoutingConfiguration: &armnetwork.RoutingConfiguration{
	// 							AssociatedRouteTable: &armnetwork.SubResource{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 							},
	// 							PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
	// 								IDs: []*armnetwork.SubResource{
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
	// 								}},
	// 								Labels: []*string{
	// 									to.Ptr("label1"),
	// 									to.Ptr("label2")},
	// 								},
	// 								VnetRoutes: &armnetwork.VnetRoute{
	// 									StaticRoutes: []*armnetwork.StaticRoute{
	// 									},
	// 								},
	// 							},
	// 							VPNClientAddressPool: &armnetwork.AddressSpace{
	// 								AddressPrefixes: []*string{
	// 									to.Ptr("101.3.0.0/16")},
	// 								},
	// 							},
	// 					}},
	// 					ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 					VirtualHub: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
	// 					},
	// 					VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
	// 						AllocatedIPAddresses: []*string{
	// 							to.Ptr("1.1.1.1"),
	// 							to.Ptr("2.2.2.2")},
	// 							TotalEgressBytesTransferred: to.Ptr[int64](3000),
	// 							TotalIngressBytesTransferred: to.Ptr[int64](2000),
	// 							VPNClientConnectionsCount: to.Ptr[int32](2),
	// 						},
	// 						VPNGatewayScaleUnit: to.Ptr[int32](1),
	// 						VPNServerConfiguration: &armnetwork.SubResource{
	// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
	// 						},
	// 					},
	// 				}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayPut.json
func ExampleP2SVPNGatewaysClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNGateway{
		Location: to.Ptr("West US"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Properties: &armnetwork.P2SVPNGatewayProperties{
			CustomDNSServers: []*string{
				to.Ptr("1.1.1.1"),
				to.Ptr("2.2.2.2")},
			IsRoutingPreferenceInternet: to.Ptr(false),
			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
				{
					ID:   to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
					Name: to.Ptr("P2SConnectionConfig1"),
					Properties: &armnetwork.P2SConnectionConfigurationProperties{
						RoutingConfiguration: &armnetwork.RoutingConfiguration{
							AssociatedRouteTable: &armnetwork.SubResource{
								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
							},
							PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
								IDs: []*armnetwork.SubResource{
									{
										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
									},
									{
										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
									},
									{
										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
									}},
								Labels: []*string{
									to.Ptr("label1"),
									to.Ptr("label2")},
							},
							VnetRoutes: &armnetwork.VnetRoute{
								StaticRoutes: []*armnetwork.StaticRoute{},
							},
						},
						VPNClientAddressPool: &armnetwork.AddressSpace{
							AddressPrefixes: []*string{
								to.Ptr("101.3.0.0/16")},
						},
					},
				}},
			VirtualHub: &armnetwork.SubResource{
				ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
			},
			VPNGatewayScaleUnit: to.Ptr[int32](1),
			VPNServerConfiguration: &armnetwork.SubResource{
				ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNGateway = armnetwork.P2SVPNGateway{
	// 	Name: to.Ptr("p2sVpnGateway1"),
	// 	Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
	// 	Location: to.Ptr("West US"),
	// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 	Properties: &armnetwork.P2SVPNGatewayProperties{
	// 		CustomDNSServers: []*string{
	// 			to.Ptr("1.1.1.1"),
	// 			to.Ptr("2.2.2.2")},
	// 			IsRoutingPreferenceInternet: to.Ptr(false),
	// 			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
	// 					Name: to.Ptr("P2SConnectionConfig1"),
	// 					Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 					Properties: &armnetwork.P2SConnectionConfigurationProperties{
	// 						ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
	// 						}},
	// 						EnableInternetSecurity: to.Ptr(false),
	// 						PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
	// 								Name: to.Ptr("policyGroup1"),
	// 								Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
	// 									IsDefault: to.Ptr(true),
	// 									PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
	// 										{
	// 											Name: to.Ptr("policy1"),
	// 											AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
	// 											AttributeValue: to.Ptr("6ad1bd08"),
	// 									}},
	// 									Priority: to.Ptr[int32](0),
	// 									ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 								},
	// 						}},
	// 						ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 						RoutingConfiguration: &armnetwork.RoutingConfiguration{
	// 							AssociatedRouteTable: &armnetwork.SubResource{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 							},
	// 							PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
	// 								IDs: []*armnetwork.SubResource{
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
	// 								}},
	// 								Labels: []*string{
	// 									to.Ptr("label1"),
	// 									to.Ptr("label2")},
	// 								},
	// 								VnetRoutes: &armnetwork.VnetRoute{
	// 									StaticRoutes: []*armnetwork.StaticRoute{
	// 									},
	// 								},
	// 							},
	// 							VPNClientAddressPool: &armnetwork.AddressSpace{
	// 								AddressPrefixes: []*string{
	// 									to.Ptr("101.3.0.0/16")},
	// 								},
	// 							},
	// 					}},
	// 					ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 					VirtualHub: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
	// 					},
	// 					VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
	// 						AllocatedIPAddresses: []*string{
	// 						},
	// 						TotalEgressBytesTransferred: to.Ptr[int64](0),
	// 						TotalIngressBytesTransferred: to.Ptr[int64](0),
	// 						VPNClientConnectionsCount: to.Ptr[int32](0),
	// 					},
	// 					VPNGatewayScaleUnit: to.Ptr[int32](1),
	// 					VPNServerConfiguration: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
	// 					},
	// 				},
	// 			}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayUpdateTags.json
func ExampleP2SVPNGatewaysClient_BeginUpdateTags() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginUpdateTags(ctx, "rg1", "p2sVpnGateway1", armnetwork.TagsObject{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNGateway = armnetwork.P2SVPNGateway{
	// 	Name: to.Ptr("p2sVpnGateway1"),
	// 	Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
	// 	Location: to.Ptr("West US"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 		"key2": to.Ptr("value2"),
	// 	},
	// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 	Properties: &armnetwork.P2SVPNGatewayProperties{
	// 		CustomDNSServers: []*string{
	// 			to.Ptr("3.3.3.3")},
	// 			IsRoutingPreferenceInternet: to.Ptr(false),
	// 			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
	// 					Name: to.Ptr("P2SConnectionConfig1"),
	// 					Properties: &armnetwork.P2SConnectionConfigurationProperties{
	// 						ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
	// 						}},
	// 						EnableInternetSecurity: to.Ptr(false),
	// 						PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
	// 								Name: to.Ptr("policyGroup1"),
	// 								Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
	// 									IsDefault: to.Ptr(true),
	// 									PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
	// 										{
	// 											Name: to.Ptr("policy1"),
	// 											AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
	// 											AttributeValue: to.Ptr("6ad1bd08"),
	// 									}},
	// 									Priority: to.Ptr[int32](0),
	// 									ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 								},
	// 						}},
	// 						RoutingConfiguration: &armnetwork.RoutingConfiguration{
	// 							AssociatedRouteTable: &armnetwork.SubResource{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 							},
	// 							PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
	// 								IDs: []*armnetwork.SubResource{
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
	// 									},
	// 									{
	// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
	// 								}},
	// 								Labels: []*string{
	// 									to.Ptr("label1"),
	// 									to.Ptr("label2")},
	// 								},
	// 								VnetRoutes: &armnetwork.VnetRoute{
	// 									StaticRoutes: []*armnetwork.StaticRoute{
	// 									},
	// 								},
	// 							},
	// 							VPNClientAddressPool: &armnetwork.AddressSpace{
	// 								AddressPrefixes: []*string{
	// 									to.Ptr("101.3.0.0/16")},
	// 								},
	// 							},
	// 					}},
	// 					ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 					VirtualHub: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
	// 					},
	// 					VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
	// 						AllocatedIPAddresses: []*string{
	// 							to.Ptr("1.1.1.1"),
	// 							to.Ptr("2.2.2.2")},
	// 							TotalEgressBytesTransferred: to.Ptr[int64](3000),
	// 							TotalIngressBytesTransferred: to.Ptr[int64](2000),
	// 							VPNClientConnectionsCount: to.Ptr[int32](2),
	// 						},
	// 						VPNGatewayScaleUnit: to.Ptr[int32](1),
	// 						VPNServerConfiguration: &armnetwork.SubResource{
	// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
	// 						},
	// 					},
	// 				}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayDelete.json
func ExampleP2SVPNGatewaysClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDelete(ctx, "rg1", "p2sVpnGateway1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayListByResourceGroup.json
func ExampleP2SVPNGatewaysClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewP2SVPNGatewaysClient().NewListByResourceGroupPager("rg1", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{
		// 	Value: []*armnetwork.P2SVPNGateway{
		// 		{
		// 			Name: to.Ptr("p2sVpnGateway1"),
		// 			Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
		// 			Location: to.Ptr("West US"),
		// 			Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 			Properties: &armnetwork.P2SVPNGatewayProperties{
		// 				CustomDNSServers: []*string{
		// 					to.Ptr("3.3.3.3")},
		// 					IsRoutingPreferenceInternet: to.Ptr(false),
		// 					P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
		// 						{
		// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
		// 							Name: to.Ptr("P2SConnectionConfig1"),
		// 							Properties: &armnetwork.P2SConnectionConfigurationProperties{
		// 								ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
		// 									{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
		// 								}},
		// 								EnableInternetSecurity: to.Ptr(false),
		// 								PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
		// 									{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
		// 										Name: to.Ptr("policyGroup1"),
		// 										Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
		// 											IsDefault: to.Ptr(true),
		// 											PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
		// 												{
		// 													Name: to.Ptr("policy1"),
		// 													AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
		// 													AttributeValue: to.Ptr("6ad1bd08"),
		// 											}},
		// 											Priority: to.Ptr[int32](0),
		// 											ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 										},
		// 								}},
		// 								RoutingConfiguration: &armnetwork.RoutingConfiguration{
		// 									AssociatedRouteTable: &armnetwork.SubResource{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
		// 									},
		// 									PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
		// 										IDs: []*armnetwork.SubResource{
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
		// 											},
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
		// 											},
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
		// 										}},
		// 										Labels: []*string{
		// 											to.Ptr("label1"),
		// 											to.Ptr("label2")},
		// 										},
		// 										VnetRoutes: &armnetwork.VnetRoute{
		// 											StaticRoutes: []*armnetwork.StaticRoute{
		// 											},
		// 										},
		// 									},
		// 									VPNClientAddressPool: &armnetwork.AddressSpace{
		// 										AddressPrefixes: []*string{
		// 											to.Ptr("101.3.0.0/16")},
		// 										},
		// 									},
		// 							}},
		// 							ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 							VirtualHub: &armnetwork.SubResource{
		// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
		// 							},
		// 							VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
		// 								AllocatedIPAddresses: []*string{
		// 									to.Ptr("1.1.1.1"),
		// 									to.Ptr("2.2.2.2")},
		// 									TotalEgressBytesTransferred: to.Ptr[int64](3000),
		// 									TotalIngressBytesTransferred: to.Ptr[int64](2000),
		// 									VPNClientConnectionsCount: to.Ptr[int32](2),
		// 								},
		// 								VPNGatewayScaleUnit: to.Ptr[int32](1),
		// 								VPNServerConfiguration: &armnetwork.SubResource{
		// 									ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
		// 								},
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("p2sVpnGateway2"),
		// 							Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
		// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"),
		// 							Location: to.Ptr("West US"),
		// 							Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 							Properties: &armnetwork.P2SVPNGatewayProperties{
		// 								CustomDNSServers: []*string{
		// 									to.Ptr("4.4.4.4")},
		// 									IsRoutingPreferenceInternet: to.Ptr(false),
		// 									P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
		// 										{
		// 											ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
		// 											Name: to.Ptr("P2SConnectionConfig1"),
		// 											Properties: &armnetwork.P2SConnectionConfigurationProperties{
		// 												ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
		// 													{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
		// 												}},
		// 												EnableInternetSecurity: to.Ptr(false),
		// 												PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
		// 													{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
		// 														Name: to.Ptr("policyGroup1"),
		// 														Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
		// 															IsDefault: to.Ptr(true),
		// 															PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
		// 																{
		// 																	Name: to.Ptr("policy1"),
		// 																	AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
		// 																	AttributeValue: to.Ptr("6ad1bd08"),
		// 															}},
		// 															Priority: to.Ptr[int32](0),
		// 															ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 														},
		// 												}},
		// 												RoutingConfiguration: &armnetwork.RoutingConfiguration{
		// 													AssociatedRouteTable: &armnetwork.SubResource{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"),
		// 													},
		// 													PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
		// 														IDs: []*armnetwork.SubResource{
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"),
		// 															},
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"),
		// 															},
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"),
		// 														}},
		// 														Labels: []*string{
		// 															to.Ptr("label1"),
		// 															to.Ptr("label2")},
		// 														},
		// 														VnetRoutes: &armnetwork.VnetRoute{
		// 															StaticRoutes: []*armnetwork.StaticRoute{
		// 															},
		// 														},
		// 													},
		// 													VPNClientAddressPool: &armnetwork.AddressSpace{
		// 														AddressPrefixes: []*string{
		// 															to.Ptr("101.3.0.0/16")},
		// 														},
		// 													},
		// 											}},
		// 											ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 											VirtualHub: &armnetwork.SubResource{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"),
		// 											},
		// 											VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
		// 												AllocatedIPAddresses: []*string{
		// 													to.Ptr("1.1.1.1"),
		// 													to.Ptr("2.2.2.2")},
		// 													TotalEgressBytesTransferred: to.Ptr[int64](3000),
		// 													TotalIngressBytesTransferred: to.Ptr[int64](2000),
		// 													VPNClientConnectionsCount: to.Ptr[int32](2),
		// 												},
		// 												VPNGatewayScaleUnit: to.Ptr[int32](1),
		// 												VPNServerConfiguration: &armnetwork.SubResource{
		// 													ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
		// 												},
		// 											},
		// 									}},
		// 								}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayList.json
func ExampleP2SVPNGatewaysClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewP2SVPNGatewaysClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListP2SVPNGatewaysResult = armnetwork.ListP2SVPNGatewaysResult{
		// 	Value: []*armnetwork.P2SVPNGateway{
		// 		{
		// 			Name: to.Ptr("p2sVpnGateway1"),
		// 			Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
		// 			ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
		// 			Location: to.Ptr("West US"),
		// 			Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 			Properties: &armnetwork.P2SVPNGatewayProperties{
		// 				CustomDNSServers: []*string{
		// 					to.Ptr("3.3.3.3")},
		// 					IsRoutingPreferenceInternet: to.Ptr(false),
		// 					P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
		// 						{
		// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
		// 							Name: to.Ptr("P2SConnectionConfig1"),
		// 							Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 							Properties: &armnetwork.P2SConnectionConfigurationProperties{
		// 								ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
		// 									{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
		// 								}},
		// 								EnableInternetSecurity: to.Ptr(true),
		// 								PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
		// 									{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
		// 										Name: to.Ptr("policyGroup1"),
		// 										Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
		// 											IsDefault: to.Ptr(true),
		// 											PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
		// 												{
		// 													Name: to.Ptr("policy1"),
		// 													AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
		// 													AttributeValue: to.Ptr("6ad1bd08"),
		// 											}},
		// 											Priority: to.Ptr[int32](0),
		// 											ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 										},
		// 								}},
		// 								ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 								RoutingConfiguration: &armnetwork.RoutingConfiguration{
		// 									AssociatedRouteTable: &armnetwork.SubResource{
		// 										ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
		// 									},
		// 									PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
		// 										IDs: []*armnetwork.SubResource{
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"),
		// 											},
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"),
		// 											},
		// 											{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3"),
		// 										}},
		// 										Labels: []*string{
		// 											to.Ptr("label1"),
		// 											to.Ptr("label2")},
		// 										},
		// 										VnetRoutes: &armnetwork.VnetRoute{
		// 											StaticRoutes: []*armnetwork.StaticRoute{
		// 											},
		// 										},
		// 									},
		// 									VPNClientAddressPool: &armnetwork.AddressSpace{
		// 										AddressPrefixes: []*string{
		// 											to.Ptr("101.3.0.0/16")},
		// 										},
		// 									},
		// 							}},
		// 							ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 							VirtualHub: &armnetwork.SubResource{
		// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
		// 							},
		// 							VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
		// 								AllocatedIPAddresses: []*string{
		// 									to.Ptr("1.1.1.1"),
		// 									to.Ptr("2.2.2.2")},
		// 									TotalEgressBytesTransferred: to.Ptr[int64](3000),
		// 									TotalIngressBytesTransferred: to.Ptr[int64](2000),
		// 									VPNClientConnectionsCount: to.Ptr[int32](2),
		// 								},
		// 								VPNGatewayScaleUnit: to.Ptr[int32](1),
		// 								VPNServerConfiguration: &armnetwork.SubResource{
		// 									ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
		// 								},
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("p2sVpnGateway2"),
		// 							Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
		// 							ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway2"),
		// 							Location: to.Ptr("West US"),
		// 							Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 							Properties: &armnetwork.P2SVPNGatewayProperties{
		// 								CustomDNSServers: []*string{
		// 									to.Ptr("4.4.4.4")},
		// 									IsRoutingPreferenceInternet: to.Ptr(false),
		// 									P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
		// 										{
		// 											ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
		// 											Name: to.Ptr("P2SConnectionConfig1"),
		// 											Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
		// 											Properties: &armnetwork.P2SConnectionConfigurationProperties{
		// 												ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
		// 													{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
		// 												}},
		// 												EnableInternetSecurity: to.Ptr(true),
		// 												PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
		// 													{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
		// 														Name: to.Ptr("policyGroup1"),
		// 														Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
		// 															IsDefault: to.Ptr(true),
		// 															PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
		// 																{
		// 																	Name: to.Ptr("policy1"),
		// 																	AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
		// 																	AttributeValue: to.Ptr("6ad1bd08"),
		// 															}},
		// 															Priority: to.Ptr[int32](0),
		// 															ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 														},
		// 												}},
		// 												ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 												RoutingConfiguration: &armnetwork.RoutingConfiguration{
		// 													AssociatedRouteTable: &armnetwork.SubResource{
		// 														ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"),
		// 													},
		// 													PropagatedRouteTables: &armnetwork.PropagatedRouteTable{
		// 														IDs: []*armnetwork.SubResource{
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable1"),
		// 															},
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable2"),
		// 															},
		// 															{
		// 																ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2/hubRouteTables/hubRouteTable3"),
		// 														}},
		// 														Labels: []*string{
		// 															to.Ptr("label1"),
		// 															to.Ptr("label2")},
		// 														},
		// 														VnetRoutes: &armnetwork.VnetRoute{
		// 															StaticRoutes: []*armnetwork.StaticRoute{
		// 															},
		// 														},
		// 													},
		// 													VPNClientAddressPool: &armnetwork.AddressSpace{
		// 														AddressPrefixes: []*string{
		// 															to.Ptr("101.4.0.0/16")},
		// 														},
		// 													},
		// 											}},
		// 											ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
		// 											VirtualHub: &armnetwork.SubResource{
		// 												ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2"),
		// 											},
		// 											VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
		// 												AllocatedIPAddresses: []*string{
		// 													to.Ptr("1.1.1.1"),
		// 													to.Ptr("2.2.2.2")},
		// 													TotalEgressBytesTransferred: to.Ptr[int64](3000),
		// 													TotalIngressBytesTransferred: to.Ptr[int64](2000),
		// 													VPNClientConnectionsCount: to.Ptr[int32](2),
		// 												},
		// 												VPNGatewayScaleUnit: to.Ptr[int32](1),
		// 												VPNServerConfiguration: &armnetwork.SubResource{
		// 													ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
		// 												},
		// 											},
		// 									}},
		// 								}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayReset.json
func ExampleP2SVPNGatewaysClient_BeginReset() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginReset(ctx, "rg1", "p2sVpnGateway1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNGateway = armnetwork.P2SVPNGateway{
	// 	Name: to.Ptr("p2sVpnGateway1"),
	// 	Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
	// 	Location: to.Ptr("West US"),
	// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 	Properties: &armnetwork.P2SVPNGatewayProperties{
	// 		CustomDNSServers: []*string{
	// 			to.Ptr("3.3.3.3")},
	// 			IsRoutingPreferenceInternet: to.Ptr(false),
	// 			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
	// 					Name: to.Ptr("P2SConnectionConfig1"),
	// 					Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 					Properties: &armnetwork.P2SConnectionConfigurationProperties{
	// 						ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
	// 						}},
	// 						EnableInternetSecurity: to.Ptr(false),
	// 						PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
	// 								Name: to.Ptr("policyGroup1"),
	// 								Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
	// 									IsDefault: to.Ptr(true),
	// 									PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
	// 										{
	// 											Name: to.Ptr("policy1"),
	// 											AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
	// 											AttributeValue: to.Ptr("6ad1bd08"),
	// 									}},
	// 									Priority: to.Ptr[int32](0),
	// 									ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 								},
	// 						}},
	// 						ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 						VPNClientAddressPool: &armnetwork.AddressSpace{
	// 							AddressPrefixes: []*string{
	// 								to.Ptr("101.3.0.0/16")},
	// 							},
	// 						},
	// 				}},
	// 				ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 				VirtualHub: &armnetwork.SubResource{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
	// 				},
	// 				VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
	// 					AllocatedIPAddresses: []*string{
	// 						to.Ptr("1.1.1.1"),
	// 						to.Ptr("2.2.2.2")},
	// 						TotalEgressBytesTransferred: to.Ptr[int64](3000),
	// 						TotalIngressBytesTransferred: to.Ptr[int64](2000),
	// 						VPNClientConnectionsCount: to.Ptr[int32](2),
	// 					},
	// 					VPNGatewayScaleUnit: to.Ptr[int32](1),
	// 					VPNServerConfiguration: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
	// 					},
	// 				},
	// 			}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayGenerateVpnProfile.json
func ExampleP2SVPNGatewaysClient_BeginGenerateVPNProfile() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGenerateVPNProfile(ctx, "rg1", "p2sVpnGateway1", armnetwork.P2SVPNProfileParameters{
		AuthenticationMethod: to.Ptr(armnetwork.AuthenticationMethodEAPTLS),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.VPNProfileResponse = armnetwork.VPNProfileResponse{
	// 	ProfileURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"),
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayGetConnectionHealth.json
func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealth() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealth(ctx, "rg1", "p2sVpnGateway1", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNGateway = armnetwork.P2SVPNGateway{
	// 	Name: to.Ptr("p2sVpnGateway1"),
	// 	Type: to.Ptr("Microsoft.Network/p2sVpnGateways"),
	// 	ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/P2SvpnGateways/p2sVpnGateway1"),
	// 	Location: to.Ptr("West US"),
	// 	Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 	Properties: &armnetwork.P2SVPNGatewayProperties{
	// 		CustomDNSServers: []*string{
	// 			to.Ptr("3.3.3.3")},
	// 			IsRoutingPreferenceInternet: to.Ptr(false),
	// 			P2SConnectionConfigurations: []*armnetwork.P2SConnectionConfiguration{
	// 				{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1"),
	// 					Name: to.Ptr("P2SConnectionConfig1"),
	// 					Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"),
	// 					Properties: &armnetwork.P2SConnectionConfigurationProperties{
	// 						ConfigurationPolicyGroupAssociations: []*armnetwork.SubResource{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/configurationPolicyGroups/policyGroup1"),
	// 						}},
	// 						EnableInternetSecurity: to.Ptr(false),
	// 						PreviousConfigurationPolicyGroupAssociations: []*armnetwork.VPNServerConfigurationPolicyGroup{
	// 							{
	// 								ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1"),
	// 								Name: to.Ptr("policyGroup1"),
	// 								Properties: &armnetwork.VPNServerConfigurationPolicyGroupProperties{
	// 									IsDefault: to.Ptr(true),
	// 									PolicyMembers: []*armnetwork.VPNServerConfigurationPolicyGroupMember{
	// 										{
	// 											Name: to.Ptr("policy1"),
	// 											AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeRadiusAzureGroupID),
	// 											AttributeValue: to.Ptr("6ad1bd08"),
	// 									}},
	// 									Priority: to.Ptr[int32](0),
	// 									ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 								},
	// 						}},
	// 						ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 						VPNClientAddressPool: &armnetwork.AddressSpace{
	// 							AddressPrefixes: []*string{
	// 								to.Ptr("101.3.0.0/16")},
	// 							},
	// 						},
	// 				}},
	// 				ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
	// 				VirtualHub: &armnetwork.SubResource{
	// 					ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"),
	// 				},
	// 				VPNClientConnectionHealth: &armnetwork.VPNClientConnectionHealth{
	// 					AllocatedIPAddresses: []*string{
	// 						to.Ptr("1.1.1.1"),
	// 						to.Ptr("2.2.2.2")},
	// 						TotalEgressBytesTransferred: to.Ptr[int64](3000),
	// 						TotalIngressBytesTransferred: to.Ptr[int64](2000),
	// 						VPNClientConnectionsCount: to.Ptr[int32](2),
	// 					},
	// 					VPNGatewayScaleUnit: to.Ptr[int32](1),
	// 					VPNServerConfiguration: &armnetwork.SubResource{
	// 						ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"),
	// 					},
	// 				},
	// 			}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2SVpnGatewayGetConnectionHealthDetailed.json
func ExampleP2SVPNGatewaysClient_BeginGetP2SVPNConnectionHealthDetailed() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginGetP2SVPNConnectionHealthDetailed(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionHealthRequest{
		OutputBlobSasURL: to.Ptr("https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"),
		VPNUserNamesFilter: []*string{
			to.Ptr("vpnUser1"),
			to.Ptr("vpnUser2")},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.P2SVPNConnectionHealth = armnetwork.P2SVPNConnectionHealth{
	// 	SasURL: to.Ptr("aaaaaaaaaaaaaaaaaa"),
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/network/resource-manager/Microsoft.Network/stable/2023-05-01/examples/P2sVpnGatewaysDisconnectP2sVpnConnections.json
func ExampleP2SVPNGatewaysClient_BeginDisconnectP2SVPNConnections() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDisconnectP2SVPNConnections(ctx, "p2s-vpn-gateway-test", "p2svpngateway", armnetwork.P2SVPNConnectionRequest{
		VPNConnectionIDs: []*string{
			to.Ptr("vpnconnId1"),
			to.Ptr("vpnconnId2")},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
