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

/** The RestorableTimeRange model. */
@Fluent
public final class RestorableTimeRange {
    /*
     * Start time for the available restore range
     */
    @JsonProperty(value = "startTime", required = true)
    private String startTime;

    /*
     * End time for the available restore range
     */
    @JsonProperty(value = "endTime", required = true)
    private String endTime;

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

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

    /**
     * Get the startTime property: Start time for the available restore range.
     *
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Start time for the available restore range.
     *
     * @param startTime the startTime value to set.
     * @return the RestorableTimeRange object itself.
     */
    public RestorableTimeRange withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: End time for the available restore range.
     *
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: End time for the available restore range.
     *
     * @param endTime the endTime value to set.
     * @return the RestorableTimeRange object itself.
     */
    public RestorableTimeRange withEndTime(String endTime) {
        this.endTime = endTime;
        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 RestorableTimeRange object itself.
     */
    public RestorableTimeRange withObjectType(String objectType) {
        this.objectType = objectType;
        return this;
    }

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

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