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

/** Common input details for network mapping operation. */
@Fluent
public final class CreateNetworkMappingInputProperties {
    /*
     * Recovery fabric Name.
     */
    @JsonProperty(value = "recoveryFabricName")
    private String recoveryFabricName;

    /*
     * Recovery network Id.
     */
    @JsonProperty(value = "recoveryNetworkId", required = true)
    private String recoveryNetworkId;

    /*
     * Fabric specific input properties.
     */
    @JsonProperty(value = "fabricSpecificDetails")
    private FabricSpecificCreateNetworkMappingInput fabricSpecificDetails;

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

    /**
     * Get the recoveryFabricName property: Recovery fabric Name.
     *
     * @return the recoveryFabricName value.
     */
    public String recoveryFabricName() {
        return this.recoveryFabricName;
    }

    /**
     * Set the recoveryFabricName property: Recovery fabric Name.
     *
     * @param recoveryFabricName the recoveryFabricName value to set.
     * @return the CreateNetworkMappingInputProperties object itself.
     */
    public CreateNetworkMappingInputProperties withRecoveryFabricName(String recoveryFabricName) {
        this.recoveryFabricName = recoveryFabricName;
        return this;
    }

    /**
     * Get the recoveryNetworkId property: Recovery network Id.
     *
     * @return the recoveryNetworkId value.
     */
    public String recoveryNetworkId() {
        return this.recoveryNetworkId;
    }

    /**
     * Set the recoveryNetworkId property: Recovery network Id.
     *
     * @param recoveryNetworkId the recoveryNetworkId value to set.
     * @return the CreateNetworkMappingInputProperties object itself.
     */
    public CreateNetworkMappingInputProperties withRecoveryNetworkId(String recoveryNetworkId) {
        this.recoveryNetworkId = recoveryNetworkId;
        return this;
    }

    /**
     * Get the fabricSpecificDetails property: Fabric specific input properties.
     *
     * @return the fabricSpecificDetails value.
     */
    public FabricSpecificCreateNetworkMappingInput fabricSpecificDetails() {
        return this.fabricSpecificDetails;
    }

    /**
     * Set the fabricSpecificDetails property: Fabric specific input properties.
     *
     * @param fabricSpecificDetails the fabricSpecificDetails value to set.
     * @return the CreateNetworkMappingInputProperties object itself.
     */
    public CreateNetworkMappingInputProperties withFabricSpecificDetails(
        FabricSpecificCreateNetworkMappingInput fabricSpecificDetails) {
        this.fabricSpecificDetails = fabricSpecificDetails;
        return this;
    }

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

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