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

package com.azure.resourcemanager.videoanalyzer.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;

/**
 * A sequence of absolute datetime ranges as a string. The datetime values should follow IS08601, and the sum of the
 * ranges should add up to 24 hours or less. Currently, there can be only one range specified in the sequence.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers")
@Fluent
public final class VideoSequenceAbsoluteTimeMarkers extends TimeSequenceBase {
    /*
     * The sequence of datetime ranges. Example: '[["2021-10-05T03:30:00Z",
     * "2021-10-05T03:40:00Z"]]'.
     */
    @JsonProperty(value = "ranges", required = true)
    private String ranges;

    /**
     * Get the ranges property: The sequence of datetime ranges. Example: '[["2021-10-05T03:30:00Z",
     * "2021-10-05T03:40:00Z"]]'.
     *
     * @return the ranges value.
     */
    public String ranges() {
        return this.ranges;
    }

    /**
     * Set the ranges property: The sequence of datetime ranges. Example: '[["2021-10-05T03:30:00Z",
     * "2021-10-05T03:40:00Z"]]'.
     *
     * @param ranges the ranges value to set.
     * @return the VideoSequenceAbsoluteTimeMarkers object itself.
     */
    public VideoSequenceAbsoluteTimeMarkers withRanges(String ranges) {
        this.ranges = ranges;
        return this;
    }

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

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