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

package com.azure.resourcemanager.timeseriesinsights.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * An object that represents the local timestamp property. It contains the format of local timestamp that needs to be
 * used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null,
 * then the local timestamp will not be ingressed with the events.
 */
@Fluent
public final class LocalTimestamp {
    /*
     * An enum that represents the format of the local timestamp property that needs to be set.
     */
    @JsonProperty(value = "format")
    private LocalTimestampFormat format;

    /*
     * An object that represents the offset information for the local timestamp format specified. Should not be
     * specified for LocalTimestampFormat - Embedded.
     */
    @JsonProperty(value = "timeZoneOffset")
    private LocalTimestampTimeZoneOffset timeZoneOffset;

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

    /**
     * Get the format property: An enum that represents the format of the local timestamp property that needs to be set.
     *
     * @return the format value.
     */
    public LocalTimestampFormat format() {
        return this.format;
    }

    /**
     * Set the format property: An enum that represents the format of the local timestamp property that needs to be set.
     *
     * @param format the format value to set.
     * @return the LocalTimestamp object itself.
     */
    public LocalTimestamp withFormat(LocalTimestampFormat format) {
        this.format = format;
        return this;
    }

    /**
     * Get the timeZoneOffset property: An object that represents the offset information for the local timestamp format
     * specified. Should not be specified for LocalTimestampFormat - Embedded.
     *
     * @return the timeZoneOffset value.
     */
    public LocalTimestampTimeZoneOffset timeZoneOffset() {
        return this.timeZoneOffset;
    }

    /**
     * Set the timeZoneOffset property: An object that represents the offset information for the local timestamp format
     * specified. Should not be specified for LocalTimestampFormat - Embedded.
     *
     * @param timeZoneOffset the timeZoneOffset value to set.
     * @return the LocalTimestamp object itself.
     */
    public LocalTimestamp withTimeZoneOffset(LocalTimestampTimeZoneOffset timeZoneOffset) {
        this.timeZoneOffset = timeZoneOffset;
        return this;
    }

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