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

/** InMageRcm fabric provider specific settings. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("InMageRcm")
@Fluent
public final class InMageRcmFabricCreationInput extends FabricSpecificCreationInput {
    /*
     * The ARM Id of the VMware site.
     */
    @JsonProperty(value = "vmwareSiteId", required = true)
    private String vmwareSiteId;

    /*
     * The ARM Id of the physical site.
     */
    @JsonProperty(value = "physicalSiteId", required = true)
    private String physicalSiteId;

    /*
     * The identity provider input for source agent authentication.
     */
    @JsonProperty(value = "sourceAgentIdentity", required = true)
    private IdentityProviderInput sourceAgentIdentity;

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

    /**
     * Get the vmwareSiteId property: The ARM Id of the VMware site.
     *
     * @return the vmwareSiteId value.
     */
    public String vmwareSiteId() {
        return this.vmwareSiteId;
    }

    /**
     * Set the vmwareSiteId property: The ARM Id of the VMware site.
     *
     * @param vmwareSiteId the vmwareSiteId value to set.
     * @return the InMageRcmFabricCreationInput object itself.
     */
    public InMageRcmFabricCreationInput withVmwareSiteId(String vmwareSiteId) {
        this.vmwareSiteId = vmwareSiteId;
        return this;
    }

    /**
     * Get the physicalSiteId property: The ARM Id of the physical site.
     *
     * @return the physicalSiteId value.
     */
    public String physicalSiteId() {
        return this.physicalSiteId;
    }

    /**
     * Set the physicalSiteId property: The ARM Id of the physical site.
     *
     * @param physicalSiteId the physicalSiteId value to set.
     * @return the InMageRcmFabricCreationInput object itself.
     */
    public InMageRcmFabricCreationInput withPhysicalSiteId(String physicalSiteId) {
        this.physicalSiteId = physicalSiteId;
        return this;
    }

    /**
     * Get the sourceAgentIdentity property: The identity provider input for source agent authentication.
     *
     * @return the sourceAgentIdentity value.
     */
    public IdentityProviderInput sourceAgentIdentity() {
        return this.sourceAgentIdentity;
    }

    /**
     * Set the sourceAgentIdentity property: The identity provider input for source agent authentication.
     *
     * @param sourceAgentIdentity the sourceAgentIdentity value to set.
     * @return the InMageRcmFabricCreationInput object itself.
     */
    public InMageRcmFabricCreationInput withSourceAgentIdentity(IdentityProviderInput sourceAgentIdentity) {
        this.sourceAgentIdentity = sourceAgentIdentity;
        return this;
    }

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

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