// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.recoveryservicessiterecovery.generated;

import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ACreateProtectionIntentInput;
import com.azure.resourcemanager.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType;
import com.azure.resourcemanager.recoveryservicessiterecovery.models.CreateProtectionIntentProperties;

/** Samples for ReplicationProtectionIntents Create. */
public final class ReplicationProtectionIntentsCreateSamples {
    /*
     * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json
     */
    /**
     * Sample code: Create protection intent Resource.
     *
     * @param manager Entry point to SiteRecoveryManager.
     */
    public static void createProtectionIntentResource(
        com.azure.resourcemanager.recoveryservicessiterecovery.SiteRecoveryManager manager) {
        manager
            .replicationProtectionIntents()
            .define("vm1")
            .withExistingVault("vault1", "resourceGroupPS1")
            .withProperties(
                new CreateProtectionIntentProperties()
                    .withProviderSpecificDetails(
                        new A2ACreateProtectionIntentInput()
                            .withFabricObjectId(
                                "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5")
                            .withPrimaryLocation("eastUs2")
                            .withRecoveryLocation("westus2")
                            .withRecoverySubscriptionId("ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640")
                            .withRecoveryAvailabilityType(A2ARecoveryAvailabilityType.SINGLE)
                            .withRecoveryResourceGroupId(
                                "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr")))
            .create();
    }
}
