// 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;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * AzureBackupRecoveryTimeBasedRestoreRequest
 *
 * <p>AzureBackup RecoveryPointTime Based Restore Request.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType")
@JsonTypeName("AzureBackupRecoveryTimeBasedRestoreRequest")
@Fluent
public final class AzureBackupRecoveryTimeBasedRestoreRequest extends AzureBackupRestoreRequest {
    /*
     * The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z.
     */
    @JsonProperty(value = "recoveryPointTime", required = true)
    private String recoveryPointTime;

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

    /**
     * Get the recoveryPointTime property: The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z.
     *
     * @return the recoveryPointTime value.
     */
    public String recoveryPointTime() {
        return this.recoveryPointTime;
    }

    /**
     * Set the recoveryPointTime property: The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z.
     *
     * @param recoveryPointTime the recoveryPointTime value to set.
     * @return the AzureBackupRecoveryTimeBasedRestoreRequest object itself.
     */
    public AzureBackupRecoveryTimeBasedRestoreRequest withRecoveryPointTime(String recoveryPointTime) {
        this.recoveryPointTime = recoveryPointTime;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AzureBackupRecoveryTimeBasedRestoreRequest withRestoreTargetInfo(RestoreTargetInfoBase restoreTargetInfo) {
        super.withRestoreTargetInfo(restoreTargetInfo);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AzureBackupRecoveryTimeBasedRestoreRequest withSourceDataStoreType(SourceDataStoreType sourceDataStoreType) {
        super.withSourceDataStoreType(sourceDataStoreType);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AzureBackupRecoveryTimeBasedRestoreRequest withSourceResourceId(String sourceResourceId) {
        super.withSourceResourceId(sourceResourceId);
        return this;
    }

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

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