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

/** Existing recovery virtual network input. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType")
@JsonTypeName("Existing")
@Fluent
public final class ExistingRecoveryVirtualNetwork extends RecoveryVirtualNetworkCustomDetails {
    /*
     * The recovery virtual network Id. Will throw error, if resource does not exist.
     */
    @JsonProperty(value = "recoveryVirtualNetworkId", required = true)
    private String recoveryVirtualNetworkId;

    /*
     * The recovery subnet name.
     */
    @JsonProperty(value = "recoverySubnetName")
    private String recoverySubnetName;

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

    /**
     * Get the recoveryVirtualNetworkId property: The recovery virtual network Id. Will throw error, if resource does
     * not exist.
     *
     * @return the recoveryVirtualNetworkId value.
     */
    public String recoveryVirtualNetworkId() {
        return this.recoveryVirtualNetworkId;
    }

    /**
     * Set the recoveryVirtualNetworkId property: The recovery virtual network Id. Will throw error, if resource does
     * not exist.
     *
     * @param recoveryVirtualNetworkId the recoveryVirtualNetworkId value to set.
     * @return the ExistingRecoveryVirtualNetwork object itself.
     */
    public ExistingRecoveryVirtualNetwork withRecoveryVirtualNetworkId(String recoveryVirtualNetworkId) {
        this.recoveryVirtualNetworkId = recoveryVirtualNetworkId;
        return this;
    }

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

    /**
     * Set the recoverySubnetName property: The recovery subnet name.
     *
     * @param recoverySubnetName the recoverySubnetName value to set.
     * @return the ExistingRecoveryVirtualNetwork object itself.
     */
    public ExistingRecoveryVirtualNetwork withRecoverySubnetName(String recoverySubnetName) {
        this.recoverySubnetName = recoverySubnetName;
        return this;
    }

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

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