// 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.resourcemanager.timeseriesinsights.fluent.models.Gen2EnvironmentMutableProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.Map;

/** Parameters supplied to the Update Environment operation to update a Gen2 environment. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("Gen2")
@Fluent
public final class Gen2EnvironmentUpdateParameters extends EnvironmentUpdateParameters {
    /*
     * Properties of the Gen2 environment.
     */
    @JsonProperty(value = "properties")
    private Gen2EnvironmentMutableProperties innerProperties;

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

    /**
     * Get the innerProperties property: Properties of the Gen2 environment.
     *
     * @return the innerProperties value.
     */
    private Gen2EnvironmentMutableProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Get the storageConfiguration property: The storage configuration provides the connection details that allows the
     * Time Series Insights service to connect to the customer storage account that is used to store the environment's
     * data.
     *
     * @return the storageConfiguration value.
     */
    public Gen2StorageConfigurationMutableProperties storageConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().storageConfiguration();
    }

    /**
     * Set the storageConfiguration property: The storage configuration provides the connection details that allows the
     * Time Series Insights service to connect to the customer storage account that is used to store the environment's
     * data.
     *
     * @param storageConfiguration the storageConfiguration value to set.
     * @return the Gen2EnvironmentUpdateParameters object itself.
     */
    public Gen2EnvironmentUpdateParameters withStorageConfiguration(
        Gen2StorageConfigurationMutableProperties storageConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Gen2EnvironmentMutableProperties();
        }
        this.innerProperties().withStorageConfiguration(storageConfiguration);
        return this;
    }

    /**
     * Get the warmStoreConfiguration property: The warm store configuration provides the details to create a warm store
     * cache that will retain a copy of the environment's data available for faster query.
     *
     * @return the warmStoreConfiguration value.
     */
    public WarmStoreConfigurationProperties warmStoreConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().warmStoreConfiguration();
    }

    /**
     * Set the warmStoreConfiguration property: The warm store configuration provides the details to create a warm store
     * cache that will retain a copy of the environment's data available for faster query.
     *
     * @param warmStoreConfiguration the warmStoreConfiguration value to set.
     * @return the Gen2EnvironmentUpdateParameters object itself.
     */
    public Gen2EnvironmentUpdateParameters withWarmStoreConfiguration(
        WarmStoreConfigurationProperties warmStoreConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new Gen2EnvironmentMutableProperties();
        }
        this.innerProperties().withWarmStoreConfiguration(warmStoreConfiguration);
        return this;
    }

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