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

/** InMageRcmFailback specific provider input. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("InMageRcmFailback")
@Fluent
public final class InMageRcmFailbackReprotectInput extends ReverseReplicationProviderSpecificInput {
    /*
     * The process server Id.
     */
    @JsonProperty(value = "processServerId", required = true)
    private String processServerId;

    /*
     * The run as account Id.
     */
    @JsonProperty(value = "runAsAccountId")
    private String runAsAccountId;

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

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

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

    /**
     * Set the processServerId property: The process server Id.
     *
     * @param processServerId the processServerId value to set.
     * @return the InMageRcmFailbackReprotectInput object itself.
     */
    public InMageRcmFailbackReprotectInput withProcessServerId(String processServerId) {
        this.processServerId = processServerId;
        return this;
    }

    /**
     * Get the runAsAccountId property: The run as account Id.
     *
     * @return the runAsAccountId value.
     */
    public String runAsAccountId() {
        return this.runAsAccountId;
    }

    /**
     * Set the runAsAccountId property: The run as account Id.
     *
     * @param runAsAccountId the runAsAccountId value to set.
     * @return the InMageRcmFailbackReprotectInput object itself.
     */
    public InMageRcmFailbackReprotectInput withRunAsAccountId(String runAsAccountId) {
        this.runAsAccountId = runAsAccountId;
        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 InMageRcmFailbackReprotectInput object itself.
     */
    public InMageRcmFailbackReprotectInput 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 (processServerId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property processServerId in model InMageRcmFailbackReprotectInput"));
        }
        if (policyId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property policyId in model InMageRcmFailbackReprotectInput"));
        }
    }

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