// 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.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.timeseriesinsights.fluent.models.ReferenceDataSetCreationProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The ReferenceDataSetCreateOrUpdateParameters model. */
@Fluent
public final class ReferenceDataSetCreateOrUpdateParameters extends CreateOrUpdateTrackedResourceProperties {
    /*
     * Properties used to create a reference data set.
     */
    @JsonProperty(value = "properties", required = true)
    private ReferenceDataSetCreationProperties innerProperties = new ReferenceDataSetCreationProperties();

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

    /**
     * Get the innerProperties property: Properties used to create a reference data set.
     *
     * @return the innerProperties value.
     */
    private ReferenceDataSetCreationProperties innerProperties() {
        return this.innerProperties;
    }

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

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

    /**
     * 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 ReferenceDataSetCreateOrUpdateParameters object itself.
     */
    public ReferenceDataSetCreateOrUpdateParameters withKeyProperties(List<ReferenceDataSetKeyProperty> keyProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ReferenceDataSetCreationProperties();
        }
        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 ReferenceDataSetCreateOrUpdateParameters object itself.
     */
    public ReferenceDataSetCreateOrUpdateParameters withDataStringComparisonBehavior(
        DataStringComparisonBehavior dataStringComparisonBehavior) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ReferenceDataSetCreationProperties();
        }
        this.innerProperties().withDataStringComparisonBehavior(dataStringComparisonBehavior);
        return this;
    }

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

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