// 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.AddressDetails;
import com.azure.resourcemanager.billing.models.AzurePlan;
import com.azure.resourcemanager.billing.models.BillingProfileStatus;
import com.azure.resourcemanager.billing.models.BillingRelationshipType;
import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo;
import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand;
import com.azure.resourcemanager.billing.models.SpendingLimit;
import com.azure.resourcemanager.billing.models.StatusReasonCode;
import com.azure.resourcemanager.billing.models.TargetCloud;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** A billing profile. */
@Fluent
public final class BillingProfileInner extends ProxyResource {
    /*
     * The properties of the billing profile.
     */
    @JsonProperty(value = "properties")
    private BillingProfileProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of the billing profile.
     *
     * @return the innerProperties value.
     */
    private BillingProfileProperties innerProperties() {
        return this.innerProperties;
    }

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

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

    /**
     * Get the poNumber property: The purchase order name that will appear on the invoices generated for the billing
     * profile.
     *
     * @return the poNumber value.
     */
    public String poNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().poNumber();
    }

    /**
     * Set the poNumber property: The purchase order name that will appear on the invoices generated for the billing
     * profile.
     *
     * @param poNumber the poNumber value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withPoNumber(String poNumber) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withPoNumber(poNumber);
        return this;
    }

    /**
     * Get the billingRelationshipType property: Identifies which services and purchases are paid by a billing profile.
     *
     * @return the billingRelationshipType value.
     */
    public BillingRelationshipType billingRelationshipType() {
        return this.innerProperties() == null ? null : this.innerProperties().billingRelationshipType();
    }

    /**
     * Get the billTo property: Billing address.
     *
     * @return the billTo value.
     */
    public AddressDetails billTo() {
        return this.innerProperties() == null ? null : this.innerProperties().billTo();
    }

    /**
     * Set the billTo property: Billing address.
     *
     * @param billTo the billTo value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withBillTo(AddressDetails billTo) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withBillTo(billTo);
        return this;
    }

    /**
     * Get the indirectRelationshipInfo property: Identifies the billing profile that is linked to another billing
     * profile in indirect purchase motion.
     *
     * @return the indirectRelationshipInfo value.
     */
    public IndirectRelationshipInfo indirectRelationshipInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().indirectRelationshipInfo();
    }

    /**
     * Get the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent
     * through email.
     *
     * @return the invoiceEmailOptIn value.
     */
    public Boolean invoiceEmailOptIn() {
        return this.innerProperties() == null ? null : this.innerProperties().invoiceEmailOptIn();
    }

    /**
     * Set the invoiceEmailOptIn property: Flag controlling whether the invoices for the billing profile are sent
     * through email.
     *
     * @param invoiceEmailOptIn the invoiceEmailOptIn value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withInvoiceEmailOptIn(Boolean invoiceEmailOptIn) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withInvoiceEmailOptIn(invoiceEmailOptIn);
        return this;
    }

    /**
     * Get the invoiceDay property: The day of the month when the invoice for the billing profile is generated.
     *
     * @return the invoiceDay value.
     */
    public Integer invoiceDay() {
        return this.innerProperties() == null ? null : this.innerProperties().invoiceDay();
    }

    /**
     * Get the currency property: The currency in which the charges for the billing profile are billed.
     *
     * @return the currency value.
     */
    public String currency() {
        return this.innerProperties() == null ? null : this.innerProperties().currency();
    }

    /**
     * Get the enabledAzurePlans property: Information about the enabled azure plans.
     *
     * @return the enabledAzurePlans value.
     */
    public List<AzurePlan> enabledAzurePlans() {
        return this.innerProperties() == null ? null : this.innerProperties().enabledAzurePlans();
    }

    /**
     * Set the enabledAzurePlans property: Information about the enabled azure plans.
     *
     * @param enabledAzurePlans the enabledAzurePlans value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withEnabledAzurePlans(List<AzurePlan> enabledAzurePlans) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withEnabledAzurePlans(enabledAzurePlans);
        return this;
    }

    /**
     * Get the invoiceSections property: The invoice sections associated to the billing profile. By default this is not
     * populated, unless it's specified in $expand.
     *
     * @return the invoiceSections value.
     */
    public InvoiceSectionsOnExpand invoiceSections() {
        return this.innerProperties() == null ? null : this.innerProperties().invoiceSections();
    }

    /**
     * Set the invoiceSections property: The invoice sections associated to the billing profile. By default this is not
     * populated, unless it's specified in $expand.
     *
     * @param invoiceSections the invoiceSections value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withInvoiceSections(InvoiceSectionsOnExpand invoiceSections) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withInvoiceSections(invoiceSections);
        return this;
    }

    /**
     * Get the hasReadAccess property: Indicates whether user has read access to the billing profile.
     *
     * @return the hasReadAccess value.
     */
    public Boolean hasReadAccess() {
        return this.innerProperties() == null ? null : this.innerProperties().hasReadAccess();
    }

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

    /**
     * Get the status property: The status of the billing profile.
     *
     * @return the status value.
     */
    public BillingProfileStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the statusReasonCode property: Reason for the specified billing profile status.
     *
     * @return the statusReasonCode value.
     */
    public StatusReasonCode statusReasonCode() {
        return this.innerProperties() == null ? null : this.innerProperties().statusReasonCode();
    }

    /**
     * Get the spendingLimit property: The billing profile spending limit.
     *
     * @return the spendingLimit value.
     */
    public SpendingLimit spendingLimit() {
        return this.innerProperties() == null ? null : this.innerProperties().spendingLimit();
    }

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

    /**
     * Get the tags property: Tags of billing profiles.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.innerProperties() == null ? null : this.innerProperties().tags();
    }

    /**
     * Set the tags property: Tags of billing profiles.
     *
     * @param tags the tags value to set.
     * @return the BillingProfileInner object itself.
     */
    public BillingProfileInner withTags(Map<String, String> tags) {
        if (this.innerProperties() == null) {
            this.innerProperties = new BillingProfileProperties();
        }
        this.innerProperties().withTags(tags);
        return this;
    }

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