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

package com.azure.resourcemanager.resourcemover.generated;

import com.azure.resourcemanager.resourcemover.models.MoveResourceDependencyOverride;
import com.azure.resourcemanager.resourcemover.models.MoveResourceProperties;
import com.azure.resourcemanager.resourcemover.models.TargetAvailabilityZone;
import com.azure.resourcemanager.resourcemover.models.VirtualMachineResourceSettings;
import java.util.Arrays;

/** Samples for MoveResources Create. */
public final class MoveResourcesCreateSamples {
    /*
     * x-ms-original-file: specification/resourcemover/resource-manager/Microsoft.Migrate/stable/2021-01-01/examples/MoveResources_Create.json
     */
    /**
     * Sample code: MoveResources_Create.
     *
     * @param manager Entry point to ResourceMoverManager.
     */
    public static void moveResourcesCreate(com.azure.resourcemanager.resourcemover.ResourceMoverManager manager) {
        manager
            .moveResources()
            .define("moveresourcename1")
            .withExistingMoveCollection("rg1", "movecollection1")
            .withProperties(
                new MoveResourceProperties()
                    .withSourceId(
                        "/subscriptions/subid/resourceGroups/eastusRG/providers/Microsoft.Compute/virtualMachines/eastusvm1")
                    .withResourceSettings(
                        new VirtualMachineResourceSettings()
                            .withTargetResourceName("westusvm1")
                            .withTargetAvailabilityZone(TargetAvailabilityZone.TWO)
                            .withTargetAvailabilitySetId(
                                "/subscriptions/subid/resourceGroups/eastusRG/providers/Microsoft.Compute/availabilitySets/avset1"))
                    .withDependsOnOverrides(
                        Arrays
                            .asList(
                                new MoveResourceDependencyOverride()
                                    .withId(
                                        "/subscriptions/c4488a3f-a7f7-4ad4-aa72-0e1f4d9c0756/resourceGroups/eastusRG/providers/Microsoft.Network/networkInterfaces/eastusvm140")
                                    .withTargetId(
                                        "/subscriptions/c4488a3f-a7f7-4ad4-aa72-0e1f4d9c0756/resourceGroups/westusRG/providers/Microsoft.Network/networkInterfaces/eastusvm140"))))
            .create();
    }
}
