// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.dataprotection.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * AzureBackupRehydrationRequest
 *
 * <p>Azure Backup Rehydrate Request.
 */
@Fluent
public final class AzureBackupRehydrationRequest {
    /*
     * Id of the recovery point to be recovered
     */
    @JsonProperty(value = "recoveryPointId", required = true)
    private String recoveryPointId;

    /*
     * Priority to be used for rehydration. Values High or Standard
     */
    @JsonProperty(value = "rehydrationPriority")
    private RehydrationPriority rehydrationPriority;

    /*
     * Retention duration in ISO 8601 format i.e P10D .
     */
    @JsonProperty(value = "rehydrationRetentionDuration", required = true)
    private String rehydrationRetentionDuration;

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

    /**
     * Get the recoveryPointId property: Id of the recovery point to be recovered.
     *
     * @return the recoveryPointId value.
     */
    public String recoveryPointId() {
        return this.recoveryPointId;
    }

    /**
     * Set the recoveryPointId property: Id of the recovery point to be recovered.
     *
     * @param recoveryPointId the recoveryPointId value to set.
     * @return the AzureBackupRehydrationRequest object itself.
     */
    public AzureBackupRehydrationRequest withRecoveryPointId(String recoveryPointId) {
        this.recoveryPointId = recoveryPointId;
        return this;
    }

    /**
     * Get the rehydrationPriority property: Priority to be used for rehydration. Values High or Standard.
     *
     * @return the rehydrationPriority value.
     */
    public RehydrationPriority rehydrationPriority() {
        return this.rehydrationPriority;
    }

    /**
     * Set the rehydrationPriority property: Priority to be used for rehydration. Values High or Standard.
     *
     * @param rehydrationPriority the rehydrationPriority value to set.
     * @return the AzureBackupRehydrationRequest object itself.
     */
    public AzureBackupRehydrationRequest withRehydrationPriority(RehydrationPriority rehydrationPriority) {
        this.rehydrationPriority = rehydrationPriority;
        return this;
    }

    /**
     * Get the rehydrationRetentionDuration property: Retention duration in ISO 8601 format i.e P10D .
     *
     * @return the rehydrationRetentionDuration value.
     */
    public String rehydrationRetentionDuration() {
        return this.rehydrationRetentionDuration;
    }

    /**
     * Set the rehydrationRetentionDuration property: Retention duration in ISO 8601 format i.e P10D .
     *
     * @param rehydrationRetentionDuration the rehydrationRetentionDuration value to set.
     * @return the AzureBackupRehydrationRequest object itself.
     */
    public AzureBackupRehydrationRequest withRehydrationRetentionDuration(String rehydrationRetentionDuration) {
        this.rehydrationRetentionDuration = rehydrationRetentionDuration;
        return this;
    }

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

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