// 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.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** List Restore Ranges Response. */
@Fluent
public final class AzureBackupFindRestorableTimeRangesResponse {
    /*
     * Returns the Restore Ranges available on the Backup Instance.
     */
    @JsonProperty(value = "restorableTimeRanges")
    private List<RestorableTimeRange> restorableTimeRanges;

    /*
     * The objectType property.
     */
    @JsonProperty(value = "objectType")
    private String objectType;

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

    /**
     * Get the restorableTimeRanges property: Returns the Restore Ranges available on the Backup Instance.
     *
     * @return the restorableTimeRanges value.
     */
    public List<RestorableTimeRange> restorableTimeRanges() {
        return this.restorableTimeRanges;
    }

    /**
     * Set the restorableTimeRanges property: Returns the Restore Ranges available on the Backup Instance.
     *
     * @param restorableTimeRanges the restorableTimeRanges value to set.
     * @return the AzureBackupFindRestorableTimeRangesResponse object itself.
     */
    public AzureBackupFindRestorableTimeRangesResponse withRestorableTimeRanges(
        List<RestorableTimeRange> restorableTimeRanges) {
        this.restorableTimeRanges = restorableTimeRanges;
        return this;
    }

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

    /**
     * Set the objectType property: The objectType property.
     *
     * @param objectType the objectType value to set.
     * @return the AzureBackupFindRestorableTimeRangesResponse object itself.
     */
    public AzureBackupFindRestorableTimeRangesResponse withObjectType(String objectType) {
        this.objectType = objectType;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (restorableTimeRanges() != null) {
            restorableTimeRanges().forEach(e -> e.validate());
        }
    }
}
