// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.billing;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.billing.inputs.BudgetAllUpdatesRuleArgs;
import com.pulumi.gcp.billing.inputs.BudgetAmountArgs;
import com.pulumi.gcp.billing.inputs.BudgetBudgetFilterArgs;
import com.pulumi.gcp.billing.inputs.BudgetThresholdRuleArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class BudgetArgs extends com.pulumi.resources.ResourceArgs {

    public static final BudgetArgs Empty = new BudgetArgs();

    /**
     * Defines notifications that are sent on every update to the
     * billing account&#39;s spend, regardless of the thresholds defined
     * using threshold rules.
     * Structure is documented below.
     * 
     */
    @Import(name="allUpdatesRule")
    private @Nullable Output<BudgetAllUpdatesRuleArgs> allUpdatesRule;

    /**
     * @return Defines notifications that are sent on every update to the
     * billing account&#39;s spend, regardless of the thresholds defined
     * using threshold rules.
     * Structure is documented below.
     * 
     */
    public Optional<Output<BudgetAllUpdatesRuleArgs>> allUpdatesRule() {
        return Optional.ofNullable(this.allUpdatesRule);
    }

    /**
     * The budgeted amount for each usage period.
     * Structure is documented below.
     * 
     */
    @Import(name="amount", required=true)
    private Output<BudgetAmountArgs> amount;

    /**
     * @return The budgeted amount for each usage period.
     * Structure is documented below.
     * 
     */
    public Output<BudgetAmountArgs> amount() {
        return this.amount;
    }

    /**
     * ID of the billing account to set a budget on.
     * 
     */
    @Import(name="billingAccount", required=true)
    private Output<String> billingAccount;

    /**
     * @return ID of the billing account to set a budget on.
     * 
     */
    public Output<String> billingAccount() {
        return this.billingAccount;
    }

    /**
     * Filters that define which resources are used to compute the actual
     * spend against the budget.
     * Structure is documented below.
     * 
     */
    @Import(name="budgetFilter")
    private @Nullable Output<BudgetBudgetFilterArgs> budgetFilter;

    /**
     * @return Filters that define which resources are used to compute the actual
     * spend against the budget.
     * Structure is documented below.
     * 
     */
    public Optional<Output<BudgetBudgetFilterArgs>> budgetFilter() {
        return Optional.ofNullable(this.budgetFilter);
    }

    /**
     * User data for display name in UI. Must be &lt;= 60 chars.
     * 
     */
    @Import(name="displayName")
    private @Nullable Output<String> displayName;

    /**
     * @return User data for display name in UI. Must be &lt;= 60 chars.
     * 
     */
    public Optional<Output<String>> displayName() {
        return Optional.ofNullable(this.displayName);
    }

    /**
     * Rules that trigger alerts (notifications of thresholds being
     * crossed) when spend exceeds the specified percentages of the
     * budget.
     * Structure is documented below.
     * 
     */
    @Import(name="thresholdRules")
    private @Nullable Output<List<BudgetThresholdRuleArgs>> thresholdRules;

    /**
     * @return Rules that trigger alerts (notifications of thresholds being
     * crossed) when spend exceeds the specified percentages of the
     * budget.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<BudgetThresholdRuleArgs>>> thresholdRules() {
        return Optional.ofNullable(this.thresholdRules);
    }

    private BudgetArgs() {}

    private BudgetArgs(BudgetArgs $) {
        this.allUpdatesRule = $.allUpdatesRule;
        this.amount = $.amount;
        this.billingAccount = $.billingAccount;
        this.budgetFilter = $.budgetFilter;
        this.displayName = $.displayName;
        this.thresholdRules = $.thresholdRules;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(BudgetArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private BudgetArgs $;

        public Builder() {
            $ = new BudgetArgs();
        }

        public Builder(BudgetArgs defaults) {
            $ = new BudgetArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param allUpdatesRule Defines notifications that are sent on every update to the
         * billing account&#39;s spend, regardless of the thresholds defined
         * using threshold rules.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder allUpdatesRule(@Nullable Output<BudgetAllUpdatesRuleArgs> allUpdatesRule) {
            $.allUpdatesRule = allUpdatesRule;
            return this;
        }

        /**
         * @param allUpdatesRule Defines notifications that are sent on every update to the
         * billing account&#39;s spend, regardless of the thresholds defined
         * using threshold rules.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder allUpdatesRule(BudgetAllUpdatesRuleArgs allUpdatesRule) {
            return allUpdatesRule(Output.of(allUpdatesRule));
        }

        /**
         * @param amount The budgeted amount for each usage period.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder amount(Output<BudgetAmountArgs> amount) {
            $.amount = amount;
            return this;
        }

        /**
         * @param amount The budgeted amount for each usage period.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder amount(BudgetAmountArgs amount) {
            return amount(Output.of(amount));
        }

        /**
         * @param billingAccount ID of the billing account to set a budget on.
         * 
         * @return builder
         * 
         */
        public Builder billingAccount(Output<String> billingAccount) {
            $.billingAccount = billingAccount;
            return this;
        }

        /**
         * @param billingAccount ID of the billing account to set a budget on.
         * 
         * @return builder
         * 
         */
        public Builder billingAccount(String billingAccount) {
            return billingAccount(Output.of(billingAccount));
        }

        /**
         * @param budgetFilter Filters that define which resources are used to compute the actual
         * spend against the budget.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder budgetFilter(@Nullable Output<BudgetBudgetFilterArgs> budgetFilter) {
            $.budgetFilter = budgetFilter;
            return this;
        }

        /**
         * @param budgetFilter Filters that define which resources are used to compute the actual
         * spend against the budget.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder budgetFilter(BudgetBudgetFilterArgs budgetFilter) {
            return budgetFilter(Output.of(budgetFilter));
        }

        /**
         * @param displayName User data for display name in UI. Must be &lt;= 60 chars.
         * 
         * @return builder
         * 
         */
        public Builder displayName(@Nullable Output<String> displayName) {
            $.displayName = displayName;
            return this;
        }

        /**
         * @param displayName User data for display name in UI. Must be &lt;= 60 chars.
         * 
         * @return builder
         * 
         */
        public Builder displayName(String displayName) {
            return displayName(Output.of(displayName));
        }

        /**
         * @param thresholdRules Rules that trigger alerts (notifications of thresholds being
         * crossed) when spend exceeds the specified percentages of the
         * budget.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder thresholdRules(@Nullable Output<List<BudgetThresholdRuleArgs>> thresholdRules) {
            $.thresholdRules = thresholdRules;
            return this;
        }

        /**
         * @param thresholdRules Rules that trigger alerts (notifications of thresholds being
         * crossed) when spend exceeds the specified percentages of the
         * budget.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder thresholdRules(List<BudgetThresholdRuleArgs> thresholdRules) {
            return thresholdRules(Output.of(thresholdRules));
        }

        /**
         * @param thresholdRules Rules that trigger alerts (notifications of thresholds being
         * crossed) when spend exceeds the specified percentages of the
         * budget.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder thresholdRules(BudgetThresholdRuleArgs... thresholdRules) {
            return thresholdRules(List.of(thresholdRules));
        }

        public BudgetArgs build() {
            $.amount = Objects.requireNonNull($.amount, "expected parameter 'amount' to be non-null");
            $.billingAccount = Objects.requireNonNull($.billingAccount, "expected parameter 'billingAccount' to be non-null");
            return $;
        }
    }

}
