// 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) Go Code Generator. DO NOT EDIT.

package armchaos_test

import (
	"context"
	"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/chaos/armchaos/v2"
	"log"
)

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource.json
func ExamplePrivateAccessesClient_BeginCreateOrUpdate_createOrUpdateAPrivateAccessResource() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateAccessesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPrivateAccess", armchaos.PrivateAccess{
		Location:   to.Ptr("centraluseuap"),
		Properties: &armchaos.PrivateAccessProperties{},
	}, 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 poll 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 = armchaos.PrivateAccessesClientCreateOrUpdateResponse{
	// 	PrivateAccess: armchaos.PrivateAccess{
	// 		Name: to.Ptr("myPrivateAccess"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
	// 		Location: to.Ptr("centraluseuap"),
	// 		Properties: &armchaos.PrivateAccessProperties{
	// 			ProvisioningState: to.Ptr(armchaos.ProvisioningStateUpdating),
	// 		},
	// 		SystemData: &armchaos.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_CreateOrUpdate_Create_Or_Update_A_Private_Access_Resource_With_Public_Network_Access.json
func ExamplePrivateAccessesClient_BeginCreateOrUpdate_createOrUpdateAPrivateAccessResourceWithPublicNetworkAccess() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateAccessesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPrivateAccess", armchaos.PrivateAccess{
		Location: to.Ptr("centraluseuap"),
		Properties: &armchaos.PrivateAccessProperties{
			PublicNetworkAccess: to.Ptr(armchaos.PublicNetworkAccessOptionEnabled),
		},
	}, 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 poll 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 = armchaos.PrivateAccessesClientCreateOrUpdateResponse{
	// 	PrivateAccess: armchaos.PrivateAccess{
	// 		Name: to.Ptr("myPrivateAccess"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
	// 		Location: to.Ptr("centraluseuap"),
	// 		Properties: &armchaos.PrivateAccessProperties{
	// 			ProvisioningState: to.Ptr(armchaos.ProvisioningStateUpdating),
	// 			PublicNetworkAccess: to.Ptr(armchaos.PublicNetworkAccessOptionEnabled),
	// 		},
	// 		SystemData: &armchaos.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_Delete.json
func ExamplePrivateAccessesClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateAccessesClient().BeginDelete(ctx, "myResourceGroup", "myPrivateAccess", 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 poll the result: %v", err)
	}
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_DeleteAPrivateEndpointConnection.json
func ExamplePrivateAccessesClient_BeginDeleteAPrivateEndpointConnection() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateAccessesClient().BeginDeleteAPrivateEndpointConnection(ctx, "myResourceGroup", "myPrivateAccess", "myPrivateEndpointConnection", 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 poll the result: %v", err)
	}
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource.json
func ExamplePrivateAccessesClient_Get_getAPrivateAccessResource() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateAccessesClient().Get(ctx, "myResourceGroup", "myPrivateAccess", 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 = armchaos.PrivateAccessesClientGetResponse{
	// 	PrivateAccess: armchaos.PrivateAccess{
	// 		Name: to.Ptr("myPrivateAccess"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
	// 		Location: to.Ptr("centraluseuap"),
	// 		Properties: &armchaos.PrivateAccessProperties{
	// 		},
	// 		SystemData: &armchaos.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_Get_Get_A_Private_Access_Resource_With_Private_Endpoint.json
func ExamplePrivateAccessesClient_Get_getAPrivateAccessResourceWithPrivateEndpoint() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateAccessesClient().Get(ctx, "myResourceGroup", "myPrivateAccess", 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 = armchaos.PrivateAccessesClientGetResponse{
	// 	PrivateAccess: armchaos.PrivateAccess{
	// 		Name: to.Ptr("myPrivateAccess"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myprivateAccess"),
	// 		Location: to.Ptr("centraluseuap"),
	// 		Properties: &armchaos.PrivateAccessProperties{
	// 			PrivateEndpointConnections: []*armchaos.PrivateEndpointConnection{
	// 				{
	// 					Name: to.Ptr("myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
	// 					Type: to.Ptr("Microsoft.Chaos/privateAccesses/PrivateEndpointConnections"),
	// 					ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
	// 					Properties: &armchaos.PrivateEndpointConnectionProperties{
	// 						PrivateEndpoint: &armchaos.PrivateEndpoint{
	// 							ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"),
	// 						},
	// 						PrivateLinkServiceConnectionState: &armchaos.PrivateLinkServiceConnectionState{
	// 							Description: to.Ptr("Auto-Approved"),
	// 							ActionsRequired: to.Ptr("None"),
	// 							Status: to.Ptr(armchaos.PrivateEndpointServiceConnectionStatusApproved),
	// 						},
	// 						ProvisioningState: to.Ptr(armchaos.ProvisioningStateSucceeded),
	// 					},
	// 				},
	// 			},
	// 			PublicNetworkAccess: to.Ptr(armchaos.PublicNetworkAccessOptionEnabled),
	// 		},
	// 		SystemData: &armchaos.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_GetAPrivateEndpointConnection.json
func ExamplePrivateAccessesClient_GetAPrivateEndpointConnection() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateAccessesClient().GetAPrivateEndpointConnection(ctx, "myResourceGroup", "myPrivateAccess", "myPrivateEndpointConnection", 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 = armchaos.PrivateAccessesClientGetAPrivateEndpointConnectionResponse{
	// 	PrivateEndpointConnection: armchaos.PrivateEndpointConnection{
	// 		Name: to.Ptr("myPrivateEndpointConnection"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses/PrivateEndpointConnections"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateEndpointConnection"),
	// 		Properties: &armchaos.PrivateEndpointConnectionProperties{
	// 			PrivateEndpoint: &armchaos.PrivateEndpoint{
	// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"),
	// 			},
	// 			PrivateLinkServiceConnectionState: &armchaos.PrivateLinkServiceConnectionState{
	// 				Description: to.Ptr("Auto-Approved"),
	// 				ActionsRequired: to.Ptr("None"),
	// 				Status: to.Ptr(armchaos.PrivateEndpointServiceConnectionStatusApproved),
	// 			},
	// 			ProvisioningState: to.Ptr(armchaos.ProvisioningStateSucceeded),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_GetPrivateLinkResources.json
func ExamplePrivateAccessesClient_GetPrivateLinkResources() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateAccessesClient().GetPrivateLinkResources(ctx, "myResourceGroup", "myPrivateAccess", 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 = armchaos.PrivateAccessesClientGetPrivateLinkResourcesResponse{
	// 	PrivateLinkResourceListResult: armchaos.PrivateLinkResourceListResult{
	// 		Value: []*armchaos.PrivateLinkResource{
	// 			{
	// 				Name: to.Ptr("agents"),
	// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses/privateLinkResources"),
	// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateLinkResources/agents"),
	// 				Location: to.Ptr("centraluseuap"),
	// 				Properties: &armchaos.PrivateLinkResourceProperties{
	// 					GroupID: to.Ptr("agents"),
	// 					RequiredMembers: []*string{
	// 						to.Ptr("privateAccess_1"),
	// 					},
	// 					RequiredZoneNames: []*string{
	// 						to.Ptr("privatelink.agents.core.windows.net"),
	// 					},
	// 				},
	// 			},
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_List.json
func ExamplePrivateAccessesClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateAccessesClient().NewListPager("myResourceGroup", 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 = armchaos.PrivateAccessesClientListResponse{
		// 	PrivateAccessListResult: armchaos.PrivateAccessListResult{
		// 		NextLink: to.Ptr("https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses?continuationToken=&api-version=2026-05-01-preview"),
		// 		Value: []*armchaos.PrivateAccess{
		// 			{
		// 				Name: to.Ptr("myPrivateAccess2"),
		// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
		// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess2"),
		// 				Location: to.Ptr("centraluseuap"),
		// 				Properties: &armchaos.PrivateAccessProperties{
		// 				},
		// 				SystemData: &armchaos.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("myPrivateAccess"),
		// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
		// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
		// 				Location: to.Ptr("centraluseuap"),
		// 				Properties: &armchaos.PrivateAccessProperties{
		// 					PrivateEndpointConnections: []*armchaos.PrivateEndpointConnection{
		// 						{
		// 							Name: to.Ptr("myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
		// 							Type: to.Ptr("Microsoft.Chaos/privateAccesses/PrivateEndpointConnections"),
		// 							ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
		// 							Properties: &armchaos.PrivateEndpointConnectionProperties{
		// 								PrivateEndpoint: &armchaos.PrivateEndpoint{
		// 									ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"),
		// 								},
		// 								PrivateLinkServiceConnectionState: &armchaos.PrivateLinkServiceConnectionState{
		// 									Description: to.Ptr("Auto-Approved"),
		// 									ActionsRequired: to.Ptr("None"),
		// 									Status: to.Ptr(armchaos.PrivateEndpointServiceConnectionStatusApproved),
		// 								},
		// 							},
		// 						},
		// 					},
		// 					PublicNetworkAccess: to.Ptr(armchaos.PublicNetworkAccessOptionEnabled),
		// 				},
		// 				SystemData: &armchaos.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-01T00:00:00.0Z"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-01T00:00:00.0Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_ListAll.json
func ExamplePrivateAccessesClient_NewListAllPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateAccessesClient().NewListAllPager(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 = armchaos.PrivateAccessesClientListAllResponse{
		// 	PrivateAccessListResult: armchaos.PrivateAccessListResult{
		// 		NextLink: to.Ptr("https://management.azure.com/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/providers/Microsoft.Chaos/privateAccesses?continuationToken=&api-version=2026-05-01-preview"),
		// 		Value: []*armchaos.PrivateAccess{
		// 			{
		// 				Name: to.Ptr("myPrivateAccess2"),
		// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
		// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess2"),
		// 				Location: to.Ptr("centraluseuap"),
		// 				Properties: &armchaos.PrivateAccessProperties{
		// 				},
		// 				SystemData: &armchaos.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("myPrivateAccess"),
		// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
		// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
		// 				Location: to.Ptr("centraluseuap"),
		// 				Properties: &armchaos.PrivateAccessProperties{
		// 					PrivateEndpointConnections: []*armchaos.PrivateEndpointConnection{
		// 						{
		// 							Name: to.Ptr("myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
		// 							Type: to.Ptr("Microsoft.Chaos/privateAccesses/PrivateEndpointConnections"),
		// 							ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpoinConnections/myPrivateAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"),
		// 							Properties: &armchaos.PrivateEndpointConnectionProperties{
		// 								PrivateEndpoint: &armchaos.PrivateEndpoint{
		// 									ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup2/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"),
		// 								},
		// 								PrivateLinkServiceConnectionState: &armchaos.PrivateLinkServiceConnectionState{
		// 									Description: to.Ptr("Auto-Approved"),
		// 									ActionsRequired: to.Ptr("None"),
		// 									Status: to.Ptr(armchaos.PrivateEndpointServiceConnectionStatusApproved),
		// 								},
		// 							},
		// 						},
		// 					},
		// 					PublicNetworkAccess: to.Ptr(armchaos.PublicNetworkAccessOptionDisabled),
		// 				},
		// 				SystemData: &armchaos.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-01T00:00:00.0Z"); return t}()),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-01T00:00:00.0Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_ListPrivateEndpointConnections.json
func ExamplePrivateAccessesClient_NewListPrivateEndpointConnectionsPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateAccessesClient().NewListPrivateEndpointConnectionsPager("myResourceGroup", "myPrivateAccess", 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 = armchaos.PrivateAccessesClientListPrivateEndpointConnectionsResponse{
		// 	PrivateEndpointConnectionListResult: armchaos.PrivateEndpointConnectionListResult{
		// 		Value: []*armchaos.PrivateEndpointConnection{
		// 			{
		// 				Name: to.Ptr("myPrivateEndpointConnection"),
		// 				Type: to.Ptr("Microsoft.Chaos/privateAccesses/PrivateEndpointConnections"),
		// 				ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess/privateEndpointConnections/myPrivateEndpointConnection"),
		// 				Properties: &armchaos.PrivateEndpointConnectionProperties{
		// 					PrivateEndpoint: &armchaos.PrivateEndpoint{
		// 						ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"),
		// 					},
		// 					PrivateLinkServiceConnectionState: &armchaos.PrivateLinkServiceConnectionState{
		// 						Description: to.Ptr("Auto-Approved"),
		// 						ActionsRequired: to.Ptr("None"),
		// 						Status: to.Ptr(armchaos.PrivateEndpointServiceConnectionStatusApproved),
		// 					},
		// 					ProvisioningState: to.Ptr(armchaos.ProvisioningStateSucceeded),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-05-01-preview/PrivateAccesses_Update.json
func ExamplePrivateAccessesClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armchaos.NewClientFactory("6b052e15-03d3-4f17-b2e1-be7f07588291", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateAccessesClient().BeginUpdate(ctx, "myResourceGroup", "myPrivateAccess", armchaos.PrivateAccessPatch{
		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 poll 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 = armchaos.PrivateAccessesClientUpdateResponse{
	// 	PrivateAccess: armchaos.PrivateAccess{
	// 		Name: to.Ptr("myPrivateAccess"),
	// 		Type: to.Ptr("Microsoft.Chaos/privateAccesses"),
	// 		ID: to.Ptr("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/myResourcegroup/providers/Microsoft.Chaos/privateAccesses/myPrivateAccess"),
	// 		Location: to.Ptr("centraluseuap"),
	// 		Properties: &armchaos.PrivateAccessProperties{
	// 			ProvisioningState: to.Ptr(armchaos.ProvisioningStateSucceeded),
	// 		},
	// 		SystemData: &armchaos.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-01T00:00:00.0Z"); return t}()),
	// 		},
	// 		Tags: map[string]*string{
	// 			"tag1": to.Ptr("value1"),
	// 			"tag2": to.Ptr("value2"),
	// 		},
	// 	},
	// }
}
