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

package com.azure.resourcemanager.consumption.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The Dimensions or Tags to filter a budget by. */
@Fluent
public final class BudgetFilterProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetFilterProperties.class);

    /*
     * Has comparison expression for a dimension
     */
    @JsonProperty(value = "dimensions")
    private BudgetComparisonExpression dimensions;

    /*
     * Has comparison expression for a tag
     */
    @JsonProperty(value = "tags")
    private BudgetComparisonExpression tags;

    /**
     * Get the dimensions property: Has comparison expression for a dimension.
     *
     * @return the dimensions value.
     */
    public BudgetComparisonExpression dimensions() {
        return this.dimensions;
    }

    /**
     * Set the dimensions property: Has comparison expression for a dimension.
     *
     * @param dimensions the dimensions value to set.
     * @return the BudgetFilterProperties object itself.
     */
    public BudgetFilterProperties withDimensions(BudgetComparisonExpression dimensions) {
        this.dimensions = dimensions;
        return this;
    }

    /**
     * Get the tags property: Has comparison expression for a tag.
     *
     * @return the tags value.
     */
    public BudgetComparisonExpression tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Has comparison expression for a tag.
     *
     * @param tags the tags value to set.
     * @return the BudgetFilterProperties object itself.
     */
    public BudgetFilterProperties withTags(BudgetComparisonExpression tags) {
        this.tags = tags;
        return this;
    }

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