// 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 armrecoveryservicesdatareplication_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/recoveryservicesdatareplication/armrecoveryservicesdatareplication"
	"log"
)

// Generated from example definition: 2024-09-01/ProtectedItem_Create.json
func ExampleProtectedItemClient_BeginCreate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProtectedItemClient().BeginCreate(ctx, "rgrecoveryservicesdatareplication", "4", "d", armrecoveryservicesdatareplication.ProtectedItemModel{
		Properties: &armrecoveryservicesdatareplication.ProtectedItemModelProperties{
			PolicyName:               to.Ptr("tjoeiynplt"),
			ReplicationExtensionName: to.Ptr("jwxdo"),
			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomProperties{
				InstanceType: to.Ptr("ProtectedItemModelCustomProperties"),
			},
		},
	}, 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 = armrecoveryservicesdatareplication.ProtectedItemClientCreateResponse{
	// 	ProtectedItemModel: &armrecoveryservicesdatareplication.ProtectedItemModel{
	// 		Properties: &armrecoveryservicesdatareplication.ProtectedItemModelProperties{
	// 			PolicyName: to.Ptr("tjoeiynplt"),
	// 			ReplicationExtensionName: to.Ptr("jwxdo"),
	// 			CorrelationID: to.Ptr("mvxvtcqwgp"),
	// 			ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
	// 			ProtectionState: to.Ptr(armrecoveryservicesdatareplication.ProtectionStateUnprotectedStatesBegin),
	// 			ProtectionStateDescription: to.Ptr("lp"),
	// 			TestFailoverState: to.Ptr(armrecoveryservicesdatareplication.TestFailoverStateNone),
	// 			TestFailoverStateDescription: to.Ptr("msjz"),
	// 			ResynchronizationState: to.Ptr(armrecoveryservicesdatareplication.ResynchronizationStateNone),
	// 			FabricObjectID: to.Ptr("kjcizdpahzqsrwyiywbhyzdxsufj"),
	// 			FabricObjectName: to.Ptr("glrjwtvmejxuagjepcwaxhih"),
	// 			SourceFabricProviderID: to.Ptr("srggkxaruzlegtpdalscio"),
	// 			TargetFabricProviderID: to.Ptr("sutiqezfbeiewwjezflvcitqj"),
	// 			FabricID: to.Ptr("ebsxoblmhlhqjzzjzdwo"),
	// 			TargetFabricID: to.Ptr("fb"),
	// 			FabricAgentID: to.Ptr("vxrmsufvxothxauhvqdowascmy"),
	// 			TargetFabricAgentID: to.Ptr("oscnhreunbyibimlpvsesu"),
	// 			ResyncRequired: to.Ptr(true),
	// 			LastSuccessfulPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulUnplannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			CurrentJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ljbnhbdmreowdqnlcqycvaramwuii"),
	// 				ID: to.Ptr("bnmbzxzyfgwh"),
	// 				Name: to.Ptr("kqtvbrfmqaxdgpttkbmzpwafjp"),
	// 				DisplayName: to.Ptr("awutlqrisstqb"),
	// 				State: to.Ptr("ztlpngveoqcdejpwaiudhrioskauqv"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			AllowedJobs: []*string{
	// 				to.Ptr("guryeoocjbvqvalfkrxecpxwynpxs"),
	// 			},
	// 			LastFailedEnableProtectionJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("fhz"),
	// 				ID: to.Ptr("hjzgyxgdy"),
	// 				Name: to.Ptr("hvvolptulpcxwbnjdzky"),
	// 				DisplayName: to.Ptr("zrqjbcozwiuypjjnvy"),
	// 				State: to.Ptr("ljsixxmmcaq"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastFailedPlannedFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ceksuyfiplxj"),
	// 				ID: to.Ptr("ndjurplurnkguwfxx"),
	// 				Name: to.Ptr("ofblltxwhwzhyr"),
	// 				DisplayName: to.Ptr("whxsvbrzdhqsepbocfzsfx"),
	// 				State: to.Ptr("wpur"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastTestFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("dfuovvz"),
	// 				ID: to.Ptr("cta"),
	// 				Name: to.Ptr("cedjijdtnznsnigghrxnsaz"),
	// 				DisplayName: to.Ptr("lhkjfbonwdtxckwzfebfwdyu"),
	// 				State: to.Ptr("nhbzw"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			ReplicationHealth: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
	// 			HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
	// 				{
	// 					AffectedResourceType: to.Ptr("scfniv"),
	// 					AffectedResourceCorrelationIDs: []*string{
	// 						to.Ptr("fope"),
	// 					},
	// 					ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
	// 						{
	// 							Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
	// 							HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
	// 							Category: to.Ptr("lcsdxrqxquke"),
	// 							Severity: to.Ptr("wqxxiuaqjyagq"),
	// 							Source: to.Ptr("wevvftugwydzzw"),
	// 							CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 							IsCustomerResolvable: to.Ptr(true),
	// 							Summary: to.Ptr("djsmgrltruljo"),
	// 							Message: to.Ptr("sskcei"),
	// 							Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
	// 							Recommendation: to.Ptr("kqybwaesqumywtjepi"),
	// 						},
	// 					},
	// 					Code: to.Ptr("dgxkefzmeukd"),
	// 					HealthCategory: to.Ptr("itc"),
	// 					Category: to.Ptr("leigw"),
	// 					Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
	// 					Source: to.Ptr("iy"),
	// 					CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 					IsCustomerResolvable: to.Ptr(true),
	// 					Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
	// 					Message: to.Ptr("lbywtdprdqdekl"),
	// 					Causes: to.Ptr("xznphqrrmsdzm"),
	// 					Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
	// 				},
	// 			},
	// 			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomProperties{
	// 				InstanceType: to.Ptr("ProtectedItemModelCustomProperties"),
	// 			},
	// 		},
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/protectedItems/item1"),
	// 		Name: to.Ptr("t"),
	// 		Type: to.Ptr("xlyjashandpfwivuipoplgkgsnwoh"),
	// 		SystemData: &armrecoveryservicesdatareplication.SystemData{
	// 			CreatedBy: to.Ptr("ghut"),
	// 			CreatedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("tzczp")),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("epo"),
	// 			LastModifiedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("ekzmwexhjttb")),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2024-09-01/ProtectedItem_Delete.json
func ExampleProtectedItemClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProtectedItemClient().BeginDelete(ctx, "rgrecoveryservicesdatareplication", "4", "d", &armrecoveryservicesdatareplication.ProtectedItemClientBeginDeleteOptions{
		ForceDelete: to.Ptr(true)})
	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: 2024-09-01/ProtectedItem_Get.json
func ExampleProtectedItemClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewProtectedItemClient().Get(ctx, "rgrecoveryservicesdatareplication", "4", "d", 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 = armrecoveryservicesdatareplication.ProtectedItemClientGetResponse{
	// 	ProtectedItemModel: &armrecoveryservicesdatareplication.ProtectedItemModel{
	// 		Properties: &armrecoveryservicesdatareplication.ProtectedItemModelProperties{
	// 			PolicyName: to.Ptr("tjoeiynplt"),
	// 			ReplicationExtensionName: to.Ptr("jwxdo"),
	// 			CorrelationID: to.Ptr("mvxvtcqwgp"),
	// 			ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
	// 			ProtectionState: to.Ptr(armrecoveryservicesdatareplication.ProtectionStateUnprotectedStatesBegin),
	// 			ProtectionStateDescription: to.Ptr("lp"),
	// 			TestFailoverState: to.Ptr(armrecoveryservicesdatareplication.TestFailoverStateNone),
	// 			TestFailoverStateDescription: to.Ptr("msjz"),
	// 			ResynchronizationState: to.Ptr(armrecoveryservicesdatareplication.ResynchronizationStateNone),
	// 			FabricObjectID: to.Ptr("kjcizdpahzqsrwyiywbhyzdxsufj"),
	// 			FabricObjectName: to.Ptr("glrjwtvmejxuagjepcwaxhih"),
	// 			SourceFabricProviderID: to.Ptr("srggkxaruzlegtpdalscio"),
	// 			TargetFabricProviderID: to.Ptr("sutiqezfbeiewwjezflvcitqj"),
	// 			FabricID: to.Ptr("ebsxoblmhlhqjzzjzdwo"),
	// 			TargetFabricID: to.Ptr("fb"),
	// 			FabricAgentID: to.Ptr("vxrmsufvxothxauhvqdowascmy"),
	// 			TargetFabricAgentID: to.Ptr("oscnhreunbyibimlpvsesu"),
	// 			ResyncRequired: to.Ptr(true),
	// 			LastSuccessfulPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulUnplannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			CurrentJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ljbnhbdmreowdqnlcqycvaramwuii"),
	// 				ID: to.Ptr("bnmbzxzyfgwh"),
	// 				Name: to.Ptr("kqtvbrfmqaxdgpttkbmzpwafjp"),
	// 				DisplayName: to.Ptr("awutlqrisstqb"),
	// 				State: to.Ptr("ztlpngveoqcdejpwaiudhrioskauqv"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			AllowedJobs: []*string{
	// 				to.Ptr("guryeoocjbvqvalfkrxecpxwynpxs"),
	// 			},
	// 			LastFailedEnableProtectionJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("fhz"),
	// 				ID: to.Ptr("hjzgyxgdy"),
	// 				Name: to.Ptr("hvvolptulpcxwbnjdzky"),
	// 				DisplayName: to.Ptr("zrqjbcozwiuypjjnvy"),
	// 				State: to.Ptr("ljsixxmmcaq"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastFailedPlannedFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ceksuyfiplxj"),
	// 				ID: to.Ptr("ndjurplurnkguwfxx"),
	// 				Name: to.Ptr("ofblltxwhwzhyr"),
	// 				DisplayName: to.Ptr("whxsvbrzdhqsepbocfzsfx"),
	// 				State: to.Ptr("wpur"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastTestFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("dfuovvz"),
	// 				ID: to.Ptr("cta"),
	// 				Name: to.Ptr("cedjijdtnznsnigghrxnsaz"),
	// 				DisplayName: to.Ptr("lhkjfbonwdtxckwzfebfwdyu"),
	// 				State: to.Ptr("nhbzw"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			ReplicationHealth: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
	// 			HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
	// 				{
	// 					AffectedResourceType: to.Ptr("scfniv"),
	// 					AffectedResourceCorrelationIDs: []*string{
	// 						to.Ptr("fope"),
	// 					},
	// 					ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
	// 						{
	// 							Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
	// 							HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
	// 							Category: to.Ptr("lcsdxrqxquke"),
	// 							Severity: to.Ptr("wqxxiuaqjyagq"),
	// 							Source: to.Ptr("wevvftugwydzzw"),
	// 							CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 							IsCustomerResolvable: to.Ptr(true),
	// 							Summary: to.Ptr("djsmgrltruljo"),
	// 							Message: to.Ptr("sskcei"),
	// 							Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
	// 							Recommendation: to.Ptr("kqybwaesqumywtjepi"),
	// 						},
	// 					},
	// 					Code: to.Ptr("dgxkefzmeukd"),
	// 					HealthCategory: to.Ptr("itc"),
	// 					Category: to.Ptr("leigw"),
	// 					Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
	// 					Source: to.Ptr("iy"),
	// 					CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 					IsCustomerResolvable: to.Ptr(true),
	// 					Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
	// 					Message: to.Ptr("lbywtdprdqdekl"),
	// 					Causes: to.Ptr("xznphqrrmsdzm"),
	// 					Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
	// 				},
	// 			},
	// 			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomProperties{
	// 				InstanceType: to.Ptr("ProtectedItemModelCustomProperties"),
	// 			},
	// 		},
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/protectedItems/item1"),
	// 		Name: to.Ptr("t"),
	// 		Type: to.Ptr("xlyjashandpfwivuipoplgkgsnwoh"),
	// 		SystemData: &armrecoveryservicesdatareplication.SystemData{
	// 			CreatedBy: to.Ptr("ghut"),
	// 			CreatedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("tzczp")),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("epo"),
	// 			LastModifiedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("ekzmwexhjttb")),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2024-09-01/ProtectedItem_List.json
func ExampleProtectedItemClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProtectedItemClient().NewListPager("rgrecoveryservicesdatareplication", "4", 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 = armrecoveryservicesdatareplication.ProtectedItemClientListResponse{
		// 	ProtectedItemModelListResult: armrecoveryservicesdatareplication.ProtectedItemModelListResult{
		// 		Value: []*armrecoveryservicesdatareplication.ProtectedItemModel{
		// 			{
		// 				Properties: &armrecoveryservicesdatareplication.ProtectedItemModelProperties{
		// 					PolicyName: to.Ptr("tjoeiynplt"),
		// 					ReplicationExtensionName: to.Ptr("jwxdo"),
		// 					CorrelationID: to.Ptr("mvxvtcqwgp"),
		// 					ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
		// 					ProtectionState: to.Ptr(armrecoveryservicesdatareplication.ProtectionStateUnprotectedStatesBegin),
		// 					ProtectionStateDescription: to.Ptr("lp"),
		// 					TestFailoverState: to.Ptr(armrecoveryservicesdatareplication.TestFailoverStateNone),
		// 					TestFailoverStateDescription: to.Ptr("msjz"),
		// 					ResynchronizationState: to.Ptr(armrecoveryservicesdatareplication.ResynchronizationStateNone),
		// 					FabricObjectID: to.Ptr("kjcizdpahzqsrwyiywbhyzdxsufj"),
		// 					FabricObjectName: to.Ptr("glrjwtvmejxuagjepcwaxhih"),
		// 					SourceFabricProviderID: to.Ptr("srggkxaruzlegtpdalscio"),
		// 					TargetFabricProviderID: to.Ptr("sutiqezfbeiewwjezflvcitqj"),
		// 					FabricID: to.Ptr("ebsxoblmhlhqjzzjzdwo"),
		// 					TargetFabricID: to.Ptr("fb"),
		// 					FabricAgentID: to.Ptr("vxrmsufvxothxauhvqdowascmy"),
		// 					TargetFabricAgentID: to.Ptr("oscnhreunbyibimlpvsesu"),
		// 					ResyncRequired: to.Ptr(true),
		// 					LastSuccessfulPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					LastSuccessfulUnplannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					CurrentJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
		// 						ScenarioName: to.Ptr("ljbnhbdmreowdqnlcqycvaramwuii"),
		// 						ID: to.Ptr("bnmbzxzyfgwh"),
		// 						Name: to.Ptr("kqtvbrfmqaxdgpttkbmzpwafjp"),
		// 						DisplayName: to.Ptr("awutlqrisstqb"),
		// 						State: to.Ptr("ztlpngveoqcdejpwaiudhrioskauqv"),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 						EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					},
		// 					AllowedJobs: []*string{
		// 						to.Ptr("guryeoocjbvqvalfkrxecpxwynpxs"),
		// 					},
		// 					LastFailedEnableProtectionJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
		// 						ScenarioName: to.Ptr("fhz"),
		// 						ID: to.Ptr("hjzgyxgdy"),
		// 						Name: to.Ptr("hvvolptulpcxwbnjdzky"),
		// 						DisplayName: to.Ptr("zrqjbcozwiuypjjnvy"),
		// 						State: to.Ptr("ljsixxmmcaq"),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 						EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					},
		// 					LastFailedPlannedFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
		// 						ScenarioName: to.Ptr("ceksuyfiplxj"),
		// 						ID: to.Ptr("ndjurplurnkguwfxx"),
		// 						Name: to.Ptr("ofblltxwhwzhyr"),
		// 						DisplayName: to.Ptr("whxsvbrzdhqsepbocfzsfx"),
		// 						State: to.Ptr("wpur"),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 						EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					},
		// 					LastTestFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
		// 						ScenarioName: to.Ptr("dfuovvz"),
		// 						ID: to.Ptr("cta"),
		// 						Name: to.Ptr("cedjijdtnznsnigghrxnsaz"),
		// 						DisplayName: to.Ptr("lhkjfbonwdtxckwzfebfwdyu"),
		// 						State: to.Ptr("nhbzw"),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 						EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					},
		// 					ReplicationHealth: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
		// 					HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
		// 						{
		// 							AffectedResourceType: to.Ptr("scfniv"),
		// 							AffectedResourceCorrelationIDs: []*string{
		// 								to.Ptr("fope"),
		// 							},
		// 							ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
		// 								{
		// 									Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
		// 									HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
		// 									Category: to.Ptr("lcsdxrqxquke"),
		// 									Severity: to.Ptr("wqxxiuaqjyagq"),
		// 									Source: to.Ptr("wevvftugwydzzw"),
		// 									CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
		// 									IsCustomerResolvable: to.Ptr(true),
		// 									Summary: to.Ptr("djsmgrltruljo"),
		// 									Message: to.Ptr("sskcei"),
		// 									Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
		// 									Recommendation: to.Ptr("kqybwaesqumywtjepi"),
		// 								},
		// 							},
		// 							Code: to.Ptr("dgxkefzmeukd"),
		// 							HealthCategory: to.Ptr("itc"),
		// 							Category: to.Ptr("leigw"),
		// 							Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
		// 							Source: to.Ptr("iy"),
		// 							CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
		// 							IsCustomerResolvable: to.Ptr(true),
		// 							Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
		// 							Message: to.Ptr("lbywtdprdqdekl"),
		// 							Causes: to.Ptr("xznphqrrmsdzm"),
		// 							Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
		// 						},
		// 					},
		// 					CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomProperties{
		// 						InstanceType: to.Ptr("ProtectedItemModelCustomProperties"),
		// 					},
		// 				},
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/protectedItems/item1"),
		// 				Name: to.Ptr("t"),
		// 				Type: to.Ptr("xlyjashandpfwivuipoplgkgsnwoh"),
		// 				SystemData: &armrecoveryservicesdatareplication.SystemData{
		// 					CreatedBy: to.Ptr("ghut"),
		// 					CreatedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("tzczp")),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("epo"),
		// 					LastModifiedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("ekzmwexhjttb")),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-09-01/ProtectedItem_PlannedFailover.json
func ExampleProtectedItemClient_BeginPlannedFailover() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProtectedItemClient().BeginPlannedFailover(ctx, "rgrecoveryservicesdatareplication", "4", "d", armrecoveryservicesdatareplication.PlannedFailoverModel{
		Properties: &armrecoveryservicesdatareplication.PlannedFailoverModelProperties{
			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIPlannedFailoverModelCustomProperties{
				InstanceType: to.Ptr("PlannedFailoverModelCustomProperties"),
			},
		},
	}, 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 = armrecoveryservicesdatareplication.ProtectedItemClientPlannedFailoverResponse{
	// 	PlannedFailoverModel: &armrecoveryservicesdatareplication.PlannedFailoverModel{
	// 		Properties: &armrecoveryservicesdatareplication.PlannedFailoverModelProperties{
	// 			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIPlannedFailoverModelCustomProperties{
	// 				InstanceType: to.Ptr("PlannedFailoverModelCustomProperties"),
	// 			},
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2024-09-01/ProtectedItem_Update.json
func ExampleProtectedItemClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecoveryservicesdatareplication.NewClientFactory("930CEC23-4430-4513-B855-DBA237E2F3BF", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewProtectedItemClient().BeginUpdate(ctx, "rgswagger_2024-09-01", "4", "d", armrecoveryservicesdatareplication.ProtectedItemModelUpdate{
		Properties: &armrecoveryservicesdatareplication.ProtectedItemModelPropertiesUpdate{
			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomPropertiesUpdate{
				InstanceType: to.Ptr("ProtectedItemModelCustomPropertiesUpdate"),
			},
		},
	}, 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 = armrecoveryservicesdatareplication.ProtectedItemClientUpdateResponse{
	// 	ProtectedItemModel: &armrecoveryservicesdatareplication.ProtectedItemModel{
	// 		Properties: &armrecoveryservicesdatareplication.ProtectedItemModelProperties{
	// 			PolicyName: to.Ptr("tjoeiynplt"),
	// 			ReplicationExtensionName: to.Ptr("jwxdo"),
	// 			CustomProperties: &armrecoveryservicesdatareplication.HyperVToAzStackHCIProtectedItemModelCustomProperties{
	// 				InstanceType: to.Ptr("ProtectedItemModelCustomProperties"),
	// 			},
	// 			CorrelationID: to.Ptr("mvxvtcqwgp"),
	// 			ProvisioningState: to.Ptr(armrecoveryservicesdatareplication.ProvisioningStateCanceled),
	// 			ProtectionState: to.Ptr(armrecoveryservicesdatareplication.ProtectionStateUnprotectedStatesBegin),
	// 			ProtectionStateDescription: to.Ptr("lp"),
	// 			TestFailoverState: to.Ptr(armrecoveryservicesdatareplication.TestFailoverStateNone),
	// 			TestFailoverStateDescription: to.Ptr("msjz"),
	// 			ResynchronizationState: to.Ptr(armrecoveryservicesdatareplication.ResynchronizationStateNone),
	// 			FabricObjectID: to.Ptr("kjcizdpahzqsrwyiywbhyzdxsufj"),
	// 			FabricObjectName: to.Ptr("glrjwtvmejxuagjepcwaxhih"),
	// 			SourceFabricProviderID: to.Ptr("srggkxaruzlegtpdalscio"),
	// 			TargetFabricProviderID: to.Ptr("sutiqezfbeiewwjezflvcitqj"),
	// 			FabricID: to.Ptr("ebsxoblmhlhqjzzjzdwo"),
	// 			TargetFabricID: to.Ptr("fb"),
	// 			FabricAgentID: to.Ptr("c"),
	// 			TargetFabricAgentID: to.Ptr("tsekhcwafyaoujmijzawvexruifs"),
	// 			ResyncRequired: to.Ptr(true),
	// 			LastSuccessfulPlannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulUnplannedFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			LastSuccessfulTestFailoverTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			CurrentJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ljbnhbdmreowdqnlcqycvaramwuii"),
	// 				ID: to.Ptr("bnmbzxzyfgwh"),
	// 				Name: to.Ptr("kqtvbrfmqaxdgpttkbmzpwafjp"),
	// 				DisplayName: to.Ptr("awutlqrisstqb"),
	// 				State: to.Ptr("ztlpngveoqcdejpwaiudhrioskauqv"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			AllowedJobs: []*string{
	// 				to.Ptr("guryeoocjbvqvalfkrxecpxwynpxs"),
	// 			},
	// 			LastFailedEnableProtectionJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("fhz"),
	// 				ID: to.Ptr("hjzgyxgdy"),
	// 				Name: to.Ptr("hvvolptulpcxwbnjdzky"),
	// 				DisplayName: to.Ptr("zrqjbcozwiuypjjnvy"),
	// 				State: to.Ptr("ljsixxmmcaq"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastFailedPlannedFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("ceksuyfiplxj"),
	// 				ID: to.Ptr("ndjurplurnkguwfxx"),
	// 				Name: to.Ptr("ofblltxwhwzhyr"),
	// 				DisplayName: to.Ptr("whxsvbrzdhqsepbocfzsfx"),
	// 				State: to.Ptr("wpur"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			LastTestFailoverJob: &armrecoveryservicesdatareplication.ProtectedItemJobProperties{
	// 				ScenarioName: to.Ptr("dfuovvz"),
	// 				ID: to.Ptr("cta"),
	// 				Name: to.Ptr("cedjijdtnznsnigghrxnsaz"),
	// 				DisplayName: to.Ptr("lhkjfbonwdtxckwzfebfwdyu"),
	// 				State: to.Ptr("nhbzw"),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 				EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:55.456Z"); return t}()),
	// 			},
	// 			ReplicationHealth: to.Ptr(armrecoveryservicesdatareplication.HealthStatusNormal),
	// 			HealthErrors: []*armrecoveryservicesdatareplication.HealthErrorModel{
	// 				{
	// 					AffectedResourceType: to.Ptr("scfniv"),
	// 					AffectedResourceCorrelationIDs: []*string{
	// 						to.Ptr("fope"),
	// 					},
	// 					ChildErrors: []*armrecoveryservicesdatareplication.InnerHealthErrorModel{
	// 						{
	// 							Code: to.Ptr("yuxxpblihirpedwkigywgwjjrlzq"),
	// 							HealthCategory: to.Ptr("mhdgfjqwbikhxmhtomkl"),
	// 							Category: to.Ptr("lcsdxrqxquke"),
	// 							Severity: to.Ptr("wqxxiuaqjyagq"),
	// 							Source: to.Ptr("wevvftugwydzzw"),
	// 							CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 							IsCustomerResolvable: to.Ptr(true),
	// 							Summary: to.Ptr("djsmgrltruljo"),
	// 							Message: to.Ptr("sskcei"),
	// 							Causes: to.Ptr("kefaugkpxjkpulimjthjnl"),
	// 							Recommendation: to.Ptr("kqybwaesqumywtjepi"),
	// 						},
	// 					},
	// 					Code: to.Ptr("dgxkefzmeukd"),
	// 					HealthCategory: to.Ptr("itc"),
	// 					Category: to.Ptr("leigw"),
	// 					Severity: to.Ptr("vvdajssdcypewdyechilxjmuijvdd"),
	// 					Source: to.Ptr("iy"),
	// 					CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:52.128Z"); return t}()),
	// 					IsCustomerResolvable: to.Ptr(true),
	// 					Summary: to.Ptr("jtooblbvaxxrvcwgscbobq"),
	// 					Message: to.Ptr("lbywtdprdqdekl"),
	// 					Causes: to.Ptr("xznphqrrmsdzm"),
	// 					Recommendation: to.Ptr("gmssteizlhjtclyeoo"),
	// 				},
	// 			},
	// 		},
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataReplication/replicationVaults/vault1/protectedItems/item1"),
	// 		Name: to.Ptr("t"),
	// 		Type: to.Ptr("xlyjashandpfwivuipoplgkgsnwoh"),
	// 		SystemData: &armrecoveryservicesdatareplication.SystemData{
	// 			CreatedBy: to.Ptr("ewufpudzcjrljhmmzhfnxoqdqwnya"),
	// 			CreatedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("zioqm")),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("rx"),
	// 			LastModifiedByType: to.Ptr(armrecoveryservicesdatareplication.CreatedByType("tqbvuqoakaaqij")),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-25T00:28:53.022Z"); return t}()),
	// 		},
	// 	},
	// }
}
