// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.timeseriesinsights.models.DataStringComparisonBehavior;
import com.azure.resourcemanager.timeseriesinsights.models.ProvisioningState;
import com.azure.resourcemanager.timeseriesinsights.models.ReferenceDataSetKeyProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/**
 * A reference data set provides metadata about the events in an environment. Metadata in the reference data set will be
 * joined with events as they are read from event sources. The metadata that makes up the reference data set is uploaded
 * or modified through the Time Series Insights data plane APIs.
 */
@Fluent
public final class ReferenceDataSetResourceInner extends Resource {
    /*
     * Properties of the reference data set.
     */
    @JsonProperty(value = "properties")
    private ReferenceDataSetResourceProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties of the reference data set.
     *
     * @return the innerProperties value.
     */
    private ReferenceDataSetResourceProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ReferenceDataSetResourceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ReferenceDataSetResourceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the creationTime property: The time the resource was created.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Get the keyProperties property: The list of key properties for the reference data set.
     *
     * @return the keyProperties value.
     */
    public List<ReferenceDataSetKeyProperty> keyProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().keyProperties();
    }

    /**
     * Set the keyProperties property: The list of key properties for the reference data set.
     *
     * @param keyProperties the keyProperties value to set.
     * @return the ReferenceDataSetResourceInner object itself.
     */
    public ReferenceDataSetResourceInner withKeyProperties(List<ReferenceDataSetKeyProperty> keyProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ReferenceDataSetResourceProperties();
        }
        this.innerProperties().withKeyProperties(keyProperties);
        return this;
    }

    /**
     * Get the dataStringComparisonBehavior property: The reference data set key comparison behavior can be set using
     * this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed
     * while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set,
     * case insensitive comparison will be used.
     *
     * @return the dataStringComparisonBehavior value.
     */
    public DataStringComparisonBehavior dataStringComparisonBehavior() {
        return this.innerProperties() == null ? null : this.innerProperties().dataStringComparisonBehavior();
    }

    /**
     * Set the dataStringComparisonBehavior property: The reference data set key comparison behavior can be set using
     * this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed
     * while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set,
     * case insensitive comparison will be used.
     *
     * @param dataStringComparisonBehavior the dataStringComparisonBehavior value to set.
     * @return the ReferenceDataSetResourceInner object itself.
     */
    public ReferenceDataSetResourceInner withDataStringComparisonBehavior(
        DataStringComparisonBehavior dataStringComparisonBehavior) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ReferenceDataSetResourceProperties();
        }
        this.innerProperties().withDataStringComparisonBehavior(dataStringComparisonBehavior);
        return this;
    }

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