// 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 specific provider input. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("InMageRcm")
@Fluent
public final class InMageRcmReprotectInput extends ReverseReplicationProviderSpecificInput {
    /*
     * The reprotect agent Id.
     */
    @JsonProperty(value = "reprotectAgentId", required = true)
    private String reprotectAgentId;

    /*
     * The target datastore name.
     */
    @JsonProperty(value = "datastoreName", required = true)
    private String datastoreName;

    /*
     * The log storage account ARM Id.
     */
    @JsonProperty(value = "logStorageAccountId", required = true)
    private String logStorageAccountId;

    /*
     * The Policy Id.
     */
    @JsonProperty(value = "policyId")
    private String policyId;

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

    /**
     * Get the reprotectAgentId property: The reprotect agent Id.
     *
     * @return the reprotectAgentId value.
     */
    public String reprotectAgentId() {
        return this.reprotectAgentId;
    }

    /**
     * Set the reprotectAgentId property: The reprotect agent Id.
     *
     * @param reprotectAgentId the reprotectAgentId value to set.
     * @return the InMageRcmReprotectInput object itself.
     */
    public InMageRcmReprotectInput withReprotectAgentId(String reprotectAgentId) {
        this.reprotectAgentId = reprotectAgentId;
        return this;
    }

    /**
     * Get the datastoreName property: The target datastore name.
     *
     * @return the datastoreName value.
     */
    public String datastoreName() {
        return this.datastoreName;
    }

    /**
     * Set the datastoreName property: The target datastore name.
     *
     * @param datastoreName the datastoreName value to set.
     * @return the InMageRcmReprotectInput object itself.
     */
    public InMageRcmReprotectInput withDatastoreName(String datastoreName) {
        this.datastoreName = datastoreName;
        return this;
    }

    /**
     * Get the logStorageAccountId property: The log storage account ARM Id.
     *
     * @return the logStorageAccountId value.
     */
    public String logStorageAccountId() {
        return this.logStorageAccountId;
    }

    /**
     * Set the logStorageAccountId property: The log storage account ARM Id.
     *
     * @param logStorageAccountId the logStorageAccountId value to set.
     * @return the InMageRcmReprotectInput object itself.
     */
    public InMageRcmReprotectInput withLogStorageAccountId(String logStorageAccountId) {
        this.logStorageAccountId = logStorageAccountId;
        return this;
    }

    /**
     * Get the policyId property: The Policy Id.
     *
     * @return the policyId value.
     */
    public String policyId() {
        return this.policyId;
    }

    /**
     * Set the policyId property: The Policy Id.
     *
     * @param policyId the policyId value to set.
     * @return the InMageRcmReprotectInput object itself.
     */
    public InMageRcmReprotectInput withPolicyId(String policyId) {
        this.policyId = policyId;
        return this;
    }

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

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