// 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 armrecoveryservicessiterecovery_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/recoveryservices/armrecoveryservicessiterecovery/v3"
	"log"
)

// Generated from example definition: 2025-08-01/ReplicationProtectionContainerMappings_Create.json
func ExampleReplicationProtectionContainerMappingsClient_BeginCreate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginCreate(ctx, "resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.CreateProtectionContainerMappingInput{
		Properties: &armrecoveryservicessiterecovery.CreateProtectionContainerMappingInputProperties{
			PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
			ProviderSpecificInput: &armrecoveryservicessiterecovery.A2AContainerMappingInput{
				InstanceType: to.Ptr("ReplicationProviderSpecificContainerMappingInput"),
			},
			TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
		},
	}, 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 = armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientCreateResponse{
	// 	ProtectionContainerMapping: armrecoveryservicessiterecovery.ProtectionContainerMapping{
	// 		Name: to.Ptr("cloud1protectionprofile1"),
	// 		Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"),
	// 		ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"),
	// 		Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{
	// 			Health: to.Ptr("Normal"),
	// 			HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{
	// 			},
	// 			PolicyFriendlyName: to.Ptr("protectionprofile1"),
	// 			PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
	// 			SourceFabricFriendlyName: to.Ptr("cloud1"),
	// 			SourceProtectionContainerFriendlyName: to.Ptr("cloud1"),
	// 			State: to.Ptr("Paired"),
	// 			TargetFabricFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-08-01/ReplicationProtectionContainerMappings_Delete.json
func ExampleReplicationProtectionContainerMappingsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginDelete(ctx, "resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInput{
		Properties: &armrecoveryservicessiterecovery.RemoveProtectionContainerMappingInputProperties{
			ProviderSpecificInput: &armrecoveryservicessiterecovery.ReplicationProviderContainerUnmappingInput{},
		},
	}, 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: 2025-08-01/ReplicationProtectionContainerMappings_Get.json
func ExampleReplicationProtectionContainerMappingsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewReplicationProtectionContainerMappingsClient().Get(ctx, "resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", 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 = armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientGetResponse{
	// 	ProtectionContainerMapping: armrecoveryservicessiterecovery.ProtectionContainerMapping{
	// 		Name: to.Ptr("cloud1protectionprofile1"),
	// 		Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"),
	// 		ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"),
	// 		Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{
	// 			Health: to.Ptr("Normal"),
	// 			HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{
	// 			},
	// 			PolicyFriendlyName: to.Ptr("protectionprofile1"),
	// 			PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
	// 			SourceFabricFriendlyName: to.Ptr("cloud1"),
	// 			SourceProtectionContainerFriendlyName: to.Ptr("cloud1"),
	// 			State: to.Ptr("Paired"),
	// 			TargetFabricFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-08-01/ReplicationProtectionContainerMappings_List.json
func ExampleReplicationProtectionContainerMappingsClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReplicationProtectionContainerMappingsClient().NewListPager("resourceGroupPS1", "vault1", 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 = armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListResponse{
		// 	ProtectionContainerMappingCollection: armrecoveryservicessiterecovery.ProtectionContainerMappingCollection{
		// 		Value: []*armrecoveryservicessiterecovery.ProtectionContainerMapping{
		// 			{
		// 				Name: to.Ptr("cloud1protectionprofile1"),
		// 				Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationProtectionContainerMappings"),
		// 				ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"),
		// 				Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{
		// 					Health: to.Ptr("Normal"),
		// 					HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{
		// 					},
		// 					PolicyFriendlyName: to.Ptr("protectionprofile1"),
		// 					PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
		// 					SourceFabricFriendlyName: to.Ptr("cloud1"),
		// 					SourceProtectionContainerFriendlyName: to.Ptr("cloud1"),
		// 					State: to.Ptr("Paired"),
		// 					TargetFabricFriendlyName: to.Ptr("Microsoft Azure"),
		// 					TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"),
		// 					TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-08-01/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json
func ExampleReplicationProtectionContainerMappingsClient_NewListByReplicationProtectionContainersPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReplicationProtectionContainerMappingsClient().NewListByReplicationProtectionContainersPager("resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", 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 = armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientListByReplicationProtectionContainersResponse{
		// 	ProtectionContainerMappingCollection: armrecoveryservicessiterecovery.ProtectionContainerMappingCollection{
		// 		Value: []*armrecoveryservicessiterecovery.ProtectionContainerMapping{
		// 			{
		// 				Name: to.Ptr("cloud1protectionprofile1"),
		// 				Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"),
		// 				ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"),
		// 				Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{
		// 					Health: to.Ptr("Normal"),
		// 					HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{
		// 					},
		// 					PolicyFriendlyName: to.Ptr("protectionprofile1"),
		// 					PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
		// 					SourceFabricFriendlyName: to.Ptr("cloud1"),
		// 					SourceProtectionContainerFriendlyName: to.Ptr("cloud1"),
		// 					State: to.Ptr("Paired"),
		// 					TargetFabricFriendlyName: to.Ptr("Microsoft Azure"),
		// 					TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"),
		// 					TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-08-01/ReplicationProtectionContainerMappings_Purge.json
func ExampleReplicationProtectionContainerMappingsClient_BeginPurge() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginPurge(ctx, "resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", 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: 2025-08-01/ReplicationProtectionContainerMappings_Update.json
func ExampleReplicationProtectionContainerMappingsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicessiterecovery.NewClientFactory("c183865e-6077-46f2-a3b1-deb0f4f4650a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationProtectionContainerMappingsClient().BeginUpdate(ctx, "resourceGroupPS1", "vault1", "cloud1", "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179", "cloud1protectionprofile1", armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInput{
		Properties: &armrecoveryservicessiterecovery.UpdateProtectionContainerMappingInputProperties{
			ProviderSpecificInput: &armrecoveryservicessiterecovery.A2AUpdateContainerMappingInput{
				AgentAutoUpdateStatus:  to.Ptr(armrecoveryservicessiterecovery.AgentAutoUpdateStatusEnabled),
				AutomationAccountArmID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"),
				InstanceType:           to.Ptr("A2A"),
			},
		},
	}, 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 = armrecoveryservicessiterecovery.ReplicationProtectionContainerMappingsClientUpdateResponse{
	// 	ProtectionContainerMapping: armrecoveryservicessiterecovery.ProtectionContainerMapping{
	// 		Name: to.Ptr("cloud1protectionprofile1"),
	// 		Type: to.Ptr("Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings"),
	// 		ID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectionContainerMappings/cloud1protectionprofile1"),
	// 		Properties: &armrecoveryservicessiterecovery.ProtectionContainerMappingProperties{
	// 			Health: to.Ptr("Normal"),
	// 			HealthErrorDetails: []*armrecoveryservicessiterecovery.HealthError{
	// 			},
	// 			PolicyFriendlyName: to.Ptr("protectionprofile1"),
	// 			PolicyID: to.Ptr("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1"),
	// 			ProviderSpecificDetails: &armrecoveryservicessiterecovery.A2AProtectionContainerMappingDetails{
	// 				AgentAutoUpdateStatus: to.Ptr(armrecoveryservicessiterecovery.AgentAutoUpdateStatusEnabled),
	// 				AutomationAccountArmID: to.Ptr("/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1"),
	// 				InstanceType: to.Ptr("A2A"),
	// 				JobScheduleName: to.Ptr("ffd503ec-5f88-4b58-97c8-841466e7aa47"),
	// 				ScheduleName: to.Ptr("cloud1protectionprofile1_a85ea38f-62a8-471b-93cc-69b74fd9578c"),
	// 			},
	// 			SourceFabricFriendlyName: to.Ptr("cloud1"),
	// 			SourceProtectionContainerFriendlyName: to.Ptr("cloud1"),
	// 			State: to.Ptr("Paired"),
	// 			TargetFabricFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerFriendlyName: to.Ptr("Microsoft Azure"),
	// 			TargetProtectionContainerID: to.Ptr("Microsoft Azure"),
	// 		},
	// 	},
	// }
}
