// 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.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Recovery plan A2A specific details. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("A2A")
@Fluent
public final class RecoveryPlanA2ADetails extends RecoveryPlanProviderSpecificDetails {
    /*
     * The primary zone.
     */
    @JsonProperty(value = "primaryZone")
    private String primaryZone;

    /*
     * The recovery zone.
     */
    @JsonProperty(value = "recoveryZone")
    private String recoveryZone;

    /*
     * The primary extended location.
     */
    @JsonProperty(value = "primaryExtendedLocation")
    private ExtendedLocation primaryExtendedLocation;

    /*
     * The recovery extended location.
     */
    @JsonProperty(value = "recoveryExtendedLocation")
    private ExtendedLocation recoveryExtendedLocation;

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

    /**
     * Get the primaryZone property: The primary zone.
     *
     * @return the primaryZone value.
     */
    public String primaryZone() {
        return this.primaryZone;
    }

    /**
     * Set the primaryZone property: The primary zone.
     *
     * @param primaryZone the primaryZone value to set.
     * @return the RecoveryPlanA2ADetails object itself.
     */
    public RecoveryPlanA2ADetails withPrimaryZone(String primaryZone) {
        this.primaryZone = primaryZone;
        return this;
    }

    /**
     * Get the recoveryZone property: The recovery zone.
     *
     * @return the recoveryZone value.
     */
    public String recoveryZone() {
        return this.recoveryZone;
    }

    /**
     * Set the recoveryZone property: The recovery zone.
     *
     * @param recoveryZone the recoveryZone value to set.
     * @return the RecoveryPlanA2ADetails object itself.
     */
    public RecoveryPlanA2ADetails withRecoveryZone(String recoveryZone) {
        this.recoveryZone = recoveryZone;
        return this;
    }

    /**
     * Get the primaryExtendedLocation property: The primary extended location.
     *
     * @return the primaryExtendedLocation value.
     */
    public ExtendedLocation primaryExtendedLocation() {
        return this.primaryExtendedLocation;
    }

    /**
     * Set the primaryExtendedLocation property: The primary extended location.
     *
     * @param primaryExtendedLocation the primaryExtendedLocation value to set.
     * @return the RecoveryPlanA2ADetails object itself.
     */
    public RecoveryPlanA2ADetails withPrimaryExtendedLocation(ExtendedLocation primaryExtendedLocation) {
        this.primaryExtendedLocation = primaryExtendedLocation;
        return this;
    }

    /**
     * Get the recoveryExtendedLocation property: The recovery extended location.
     *
     * @return the recoveryExtendedLocation value.
     */
    public ExtendedLocation recoveryExtendedLocation() {
        return this.recoveryExtendedLocation;
    }

    /**
     * Set the recoveryExtendedLocation property: The recovery extended location.
     *
     * @param recoveryExtendedLocation the recoveryExtendedLocation value to set.
     * @return the RecoveryPlanA2ADetails object itself.
     */
    public RecoveryPlanA2ADetails withRecoveryExtendedLocation(ExtendedLocation recoveryExtendedLocation) {
        this.recoveryExtendedLocation = recoveryExtendedLocation;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (primaryExtendedLocation() != null) {
            primaryExtendedLocation().validate();
        }
        if (recoveryExtendedLocation() != null) {
            recoveryExtendedLocation().validate();
        }
    }
}
