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

package com.azure.resourcemanager.billing.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.billing.models.InvoiceSectionState;
import com.azure.resourcemanager.billing.models.TargetCloud;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** An invoice section. */
@Fluent
public final class InvoiceSectionInner extends ProxyResource {
    /*
     * The properties of an invoice section.
     */
    @JsonProperty(value = "properties")
    private InvoiceSectionProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of an invoice section.
     *
     * @return the innerProperties value.
     */
    private InvoiceSectionProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the displayName property: The name of the invoice section.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: The name of the invoice section.
     *
     * @param displayName the displayName value to set.
     * @return the InvoiceSectionInner object itself.
     */
    public InvoiceSectionInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InvoiceSectionProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the labels property: Dictionary of metadata associated with the invoice section.
     *
     * @return the labels value.
     */
    public Map<String, String> labels() {
        return this.innerProperties() == null ? null : this.innerProperties().labels();
    }

    /**
     * Set the labels property: Dictionary of metadata associated with the invoice section.
     *
     * @param labels the labels value to set.
     * @return the InvoiceSectionInner object itself.
     */
    public InvoiceSectionInner withLabels(Map<String, String> labels) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InvoiceSectionProperties();
        }
        this.innerProperties().withLabels(labels);
        return this;
    }

    /**
     * Get the state property: Identifies the state of an invoice section.
     *
     * @return the state value.
     */
    public InvoiceSectionState state() {
        return this.innerProperties() == null ? null : this.innerProperties().state();
    }

    /**
     * Get the systemId property: The system generated unique identifier for an invoice section.
     *
     * @return the systemId value.
     */
    public String systemId() {
        return this.innerProperties() == null ? null : this.innerProperties().systemId();
    }

    /**
     * Get the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length
     * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain &lt; &gt; % &amp; \
     * ? /.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.innerProperties() == null ? null : this.innerProperties().tags();
    }

    /**
     * Set the tags property: Dictionary of metadata associated with the invoice section. Maximum key/value length
     * supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain &lt; &gt; % &amp; \
     * ? /.
     *
     * @param tags the tags value to set.
     * @return the InvoiceSectionInner object itself.
     */
    public InvoiceSectionInner withTags(Map<String, String> tags) {
        if (this.innerProperties() == null) {
            this.innerProperties = new InvoiceSectionProperties();
        }
        this.innerProperties().withTags(tags);
        return this;
    }

    /**
     * Get the targetCloud property: Identifies the cloud environments that are associated with an invoice section. This
     * is a system managed optional field and gets updated as the invoice section gets associated with accounts in
     * various clouds.
     *
     * @return the targetCloud value.
     */
    public TargetCloud targetCloud() {
        return this.innerProperties() == null ? null : this.innerProperties().targetCloud();
    }

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