// *** 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.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.billing.outputs.BudgetBudgetFilterCustomPeriod;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class BudgetBudgetFilter {
    /**
     * @return A CalendarPeriod represents the abstract concept of a recurring time period that has a
     * canonical start. Grammatically, &#34;the start of the current CalendarPeriod&#34;.
     * All calendar times begin at 12 AM US and Canadian Pacific Time (UTC-8).
     * Exactly one of `calendar_period`, `custom_period` must be provided.
     * Possible values are: `MONTH`, `QUARTER`, `YEAR`, `CALENDAR_PERIOD_UNSPECIFIED`.
     * 
     */
    private @Nullable String calendarPeriod;
    /**
     * @return Optional. If creditTypesTreatment is INCLUDE_SPECIFIED_CREDITS,
     * this is a list of credit types to be subtracted from gross cost to determine the spend for threshold calculations. See a list of acceptable credit type values.
     * If creditTypesTreatment is not INCLUDE_SPECIFIED_CREDITS, this field must be empty.
     * **Note:** If the field has a value in the config and needs to be removed, the field has to be an emtpy array in the config.
     * 
     */
    private @Nullable List<String> creditTypes;
    /**
     * @return Specifies how credits should be treated when determining spend
     * for threshold calculations.
     * Default value is `INCLUDE_ALL_CREDITS`.
     * Possible values are: `INCLUDE_ALL_CREDITS`, `EXCLUDE_ALL_CREDITS`, `INCLUDE_SPECIFIED_CREDITS`.
     * 
     */
    private @Nullable String creditTypesTreatment;
    /**
     * @return Specifies to track usage from any start date (required) to any end date (optional).
     * This time period is static, it does not recur.
     * Exactly one of `calendar_period`, `custom_period` must be provided.
     * Structure is documented below.
     * 
     */
    private @Nullable BudgetBudgetFilterCustomPeriod customPeriod;
    /**
     * @return A single label and value pair specifying that usage from only
     * this set of labeled resources should be included in the budget.
     * 
     */
    private @Nullable Map<String,String> labels;
    /**
     * @return A set of projects of the form projects/{project_number},
     * specifying that usage from only this set of projects should be
     * included in the budget. If omitted, the report will include
     * all usage for the billing account, regardless of which project
     * the usage occurred on.
     * 
     */
    private @Nullable List<String> projects;
    /**
     * @return A set of folder and organization names of the form folders/{folderId} or organizations/{organizationId},
     * specifying that usage from only this set of folders and organizations should be included in the budget.
     * If omitted, the budget includes all usage that the billing account pays for. If the folder or organization
     * contains projects that are paid for by a different Cloud Billing account, the budget doesn&#39;t apply to those projects.
     * 
     */
    private @Nullable List<String> resourceAncestors;
    /**
     * @return A set of services of the form services/{service_id},
     * specifying that usage from only this set of services should be
     * included in the budget. If omitted, the report will include
     * usage for all the services. The service names are available
     * through the Catalog API:
     * https://cloud.google.com/billing/v1/how-tos/catalog-api.
     * 
     */
    private @Nullable List<String> services;
    /**
     * @return A set of subaccounts of the form billingAccounts/{account_id},
     * specifying that usage from only this set of subaccounts should
     * be included in the budget. If a subaccount is set to the name of
     * the parent account, usage from the parent account will be included.
     * If the field is omitted, the report will include usage from the parent
     * account and all subaccounts, if they exist.
     * **Note:** If the field has a value in the config and needs to be removed, the field has to be an emtpy array in the config.
     * 
     */
    private @Nullable List<String> subaccounts;

    private BudgetBudgetFilter() {}
    /**
     * @return A CalendarPeriod represents the abstract concept of a recurring time period that has a
     * canonical start. Grammatically, &#34;the start of the current CalendarPeriod&#34;.
     * All calendar times begin at 12 AM US and Canadian Pacific Time (UTC-8).
     * Exactly one of `calendar_period`, `custom_period` must be provided.
     * Possible values are: `MONTH`, `QUARTER`, `YEAR`, `CALENDAR_PERIOD_UNSPECIFIED`.
     * 
     */
    public Optional<String> calendarPeriod() {
        return Optional.ofNullable(this.calendarPeriod);
    }
    /**
     * @return Optional. If creditTypesTreatment is INCLUDE_SPECIFIED_CREDITS,
     * this is a list of credit types to be subtracted from gross cost to determine the spend for threshold calculations. See a list of acceptable credit type values.
     * If creditTypesTreatment is not INCLUDE_SPECIFIED_CREDITS, this field must be empty.
     * **Note:** If the field has a value in the config and needs to be removed, the field has to be an emtpy array in the config.
     * 
     */
    public List<String> creditTypes() {
        return this.creditTypes == null ? List.of() : this.creditTypes;
    }
    /**
     * @return Specifies how credits should be treated when determining spend
     * for threshold calculations.
     * Default value is `INCLUDE_ALL_CREDITS`.
     * Possible values are: `INCLUDE_ALL_CREDITS`, `EXCLUDE_ALL_CREDITS`, `INCLUDE_SPECIFIED_CREDITS`.
     * 
     */
    public Optional<String> creditTypesTreatment() {
        return Optional.ofNullable(this.creditTypesTreatment);
    }
    /**
     * @return Specifies to track usage from any start date (required) to any end date (optional).
     * This time period is static, it does not recur.
     * Exactly one of `calendar_period`, `custom_period` must be provided.
     * Structure is documented below.
     * 
     */
    public Optional<BudgetBudgetFilterCustomPeriod> customPeriod() {
        return Optional.ofNullable(this.customPeriod);
    }
    /**
     * @return A single label and value pair specifying that usage from only
     * this set of labeled resources should be included in the budget.
     * 
     */
    public Map<String,String> labels() {
        return this.labels == null ? Map.of() : this.labels;
    }
    /**
     * @return A set of projects of the form projects/{project_number},
     * specifying that usage from only this set of projects should be
     * included in the budget. If omitted, the report will include
     * all usage for the billing account, regardless of which project
     * the usage occurred on.
     * 
     */
    public List<String> projects() {
        return this.projects == null ? List.of() : this.projects;
    }
    /**
     * @return A set of folder and organization names of the form folders/{folderId} or organizations/{organizationId},
     * specifying that usage from only this set of folders and organizations should be included in the budget.
     * If omitted, the budget includes all usage that the billing account pays for. If the folder or organization
     * contains projects that are paid for by a different Cloud Billing account, the budget doesn&#39;t apply to those projects.
     * 
     */
    public List<String> resourceAncestors() {
        return this.resourceAncestors == null ? List.of() : this.resourceAncestors;
    }
    /**
     * @return A set of services of the form services/{service_id},
     * specifying that usage from only this set of services should be
     * included in the budget. If omitted, the report will include
     * usage for all the services. The service names are available
     * through the Catalog API:
     * https://cloud.google.com/billing/v1/how-tos/catalog-api.
     * 
     */
    public List<String> services() {
        return this.services == null ? List.of() : this.services;
    }
    /**
     * @return A set of subaccounts of the form billingAccounts/{account_id},
     * specifying that usage from only this set of subaccounts should
     * be included in the budget. If a subaccount is set to the name of
     * the parent account, usage from the parent account will be included.
     * If the field is omitted, the report will include usage from the parent
     * account and all subaccounts, if they exist.
     * **Note:** If the field has a value in the config and needs to be removed, the field has to be an emtpy array in the config.
     * 
     */
    public List<String> subaccounts() {
        return this.subaccounts == null ? List.of() : this.subaccounts;
    }

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

    public static Builder builder(BudgetBudgetFilter defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String calendarPeriod;
        private @Nullable List<String> creditTypes;
        private @Nullable String creditTypesTreatment;
        private @Nullable BudgetBudgetFilterCustomPeriod customPeriod;
        private @Nullable Map<String,String> labels;
        private @Nullable List<String> projects;
        private @Nullable List<String> resourceAncestors;
        private @Nullable List<String> services;
        private @Nullable List<String> subaccounts;
        public Builder() {}
        public Builder(BudgetBudgetFilter defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.calendarPeriod = defaults.calendarPeriod;
    	      this.creditTypes = defaults.creditTypes;
    	      this.creditTypesTreatment = defaults.creditTypesTreatment;
    	      this.customPeriod = defaults.customPeriod;
    	      this.labels = defaults.labels;
    	      this.projects = defaults.projects;
    	      this.resourceAncestors = defaults.resourceAncestors;
    	      this.services = defaults.services;
    	      this.subaccounts = defaults.subaccounts;
        }

        @CustomType.Setter
        public Builder calendarPeriod(@Nullable String calendarPeriod) {
            this.calendarPeriod = calendarPeriod;
            return this;
        }
        @CustomType.Setter
        public Builder creditTypes(@Nullable List<String> creditTypes) {
            this.creditTypes = creditTypes;
            return this;
        }
        public Builder creditTypes(String... creditTypes) {
            return creditTypes(List.of(creditTypes));
        }
        @CustomType.Setter
        public Builder creditTypesTreatment(@Nullable String creditTypesTreatment) {
            this.creditTypesTreatment = creditTypesTreatment;
            return this;
        }
        @CustomType.Setter
        public Builder customPeriod(@Nullable BudgetBudgetFilterCustomPeriod customPeriod) {
            this.customPeriod = customPeriod;
            return this;
        }
        @CustomType.Setter
        public Builder labels(@Nullable Map<String,String> labels) {
            this.labels = labels;
            return this;
        }
        @CustomType.Setter
        public Builder projects(@Nullable List<String> projects) {
            this.projects = projects;
            return this;
        }
        public Builder projects(String... projects) {
            return projects(List.of(projects));
        }
        @CustomType.Setter
        public Builder resourceAncestors(@Nullable List<String> resourceAncestors) {
            this.resourceAncestors = resourceAncestors;
            return this;
        }
        public Builder resourceAncestors(String... resourceAncestors) {
            return resourceAncestors(List.of(resourceAncestors));
        }
        @CustomType.Setter
        public Builder services(@Nullable List<String> services) {
            this.services = services;
            return this;
        }
        public Builder services(String... services) {
            return services(List.of(services));
        }
        @CustomType.Setter
        public Builder subaccounts(@Nullable List<String> subaccounts) {
            this.subaccounts = subaccounts;
            return this;
        }
        public Builder subaccounts(String... subaccounts) {
            return subaccounts(List.of(subaccounts));
        }
        public BudgetBudgetFilter build() {
            final var o = new BudgetBudgetFilter();
            o.calendarPeriod = calendarPeriod;
            o.creditTypes = creditTypes;
            o.creditTypesTreatment = creditTypesTreatment;
            o.customPeriod = customPeriod;
            o.labels = labels;
            o.projects = projects;
            o.resourceAncestors = resourceAncestors;
            o.services = services;
            o.subaccounts = subaccounts;
            return o;
        }
    }
}
