// 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 java.time.OffsetDateTime;

/** The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. */
@Fluent
public final class ListProvisioningTokenInput {
    /*
     * The desired expiration date of the registration token. The Azure Video
     * Analyzer IoT edge module must be initialized and connected to the
     * Internet prior to the token expiration date.
     */
    @JsonProperty(value = "expirationDate", required = true)
    private OffsetDateTime expirationDate;

    /**
     * Get the expirationDate property: The desired expiration date of the registration token. The Azure Video Analyzer
     * IoT edge module must be initialized and connected to the Internet prior to the token expiration date.
     *
     * @return the expirationDate value.
     */
    public OffsetDateTime expirationDate() {
        return this.expirationDate;
    }

    /**
     * Set the expirationDate property: The desired expiration date of the registration token. The Azure Video Analyzer
     * IoT edge module must be initialized and connected to the Internet prior to the token expiration date.
     *
     * @param expirationDate the expirationDate value to set.
     * @return the ListProvisioningTokenInput object itself.
     */
    public ListProvisioningTokenInput withExpirationDate(OffsetDateTime expirationDate) {
        this.expirationDate = expirationDate;
        return this;
    }

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

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