// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Recovery plan HVR Azure failback input. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("HyperVReplicaAzureFailback")
@Fluent
public final class RecoveryPlanHyperVReplicaAzureFailbackInput extends RecoveryPlanProviderSpecificFailoverInput {
    /*
     * The data sync option.
     */
    @JsonProperty(value = "dataSyncOption", required = true)
    private DataSyncStatus dataSyncOption;

    /*
     * The ALR option.
     */
    @JsonProperty(value = "recoveryVmCreationOption", required = true)
    private AlternateLocationRecoveryOption recoveryVmCreationOption;

    /** Creates an instance of RecoveryPlanHyperVReplicaAzureFailbackInput class. */
    public RecoveryPlanHyperVReplicaAzureFailbackInput() {
    }

    /**
     * Get the dataSyncOption property: The data sync option.
     *
     * @return the dataSyncOption value.
     */
    public DataSyncStatus dataSyncOption() {
        return this.dataSyncOption;
    }

    /**
     * Set the dataSyncOption property: The data sync option.
     *
     * @param dataSyncOption the dataSyncOption value to set.
     * @return the RecoveryPlanHyperVReplicaAzureFailbackInput object itself.
     */
    public RecoveryPlanHyperVReplicaAzureFailbackInput withDataSyncOption(DataSyncStatus dataSyncOption) {
        this.dataSyncOption = dataSyncOption;
        return this;
    }

    /**
     * Get the recoveryVmCreationOption property: The ALR option.
     *
     * @return the recoveryVmCreationOption value.
     */
    public AlternateLocationRecoveryOption recoveryVmCreationOption() {
        return this.recoveryVmCreationOption;
    }

    /**
     * Set the recoveryVmCreationOption property: The ALR option.
     *
     * @param recoveryVmCreationOption the recoveryVmCreationOption value to set.
     * @return the RecoveryPlanHyperVReplicaAzureFailbackInput object itself.
     */
    public RecoveryPlanHyperVReplicaAzureFailbackInput withRecoveryVmCreationOption(
        AlternateLocationRecoveryOption recoveryVmCreationOption) {
        this.recoveryVmCreationOption = recoveryVmCreationOption;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (dataSyncOption() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property dataSyncOption in model"
                            + " RecoveryPlanHyperVReplicaAzureFailbackInput"));
        }
        if (recoveryVmCreationOption() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property recoveryVmCreationOption in model"
                            + " RecoveryPlanHyperVReplicaAzureFailbackInput"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RecoveryPlanHyperVReplicaAzureFailbackInput.class);
}
