// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function budgetsBudgetCostFilterToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        name: cdktf.stringToTerraform(struct.name),
        values: cdktf.listMapper(cdktf.stringToTerraform)(struct.values),
    };
}
export function budgetsBudgetCostTypesToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        include_credit: cdktf.booleanToTerraform(struct.includeCredit),
        include_discount: cdktf.booleanToTerraform(struct.includeDiscount),
        include_other_subscription: cdktf.booleanToTerraform(struct.includeOtherSubscription),
        include_recurring: cdktf.booleanToTerraform(struct.includeRecurring),
        include_refund: cdktf.booleanToTerraform(struct.includeRefund),
        include_subscription: cdktf.booleanToTerraform(struct.includeSubscription),
        include_support: cdktf.booleanToTerraform(struct.includeSupport),
        include_tax: cdktf.booleanToTerraform(struct.includeTax),
        include_upfront: cdktf.booleanToTerraform(struct.includeUpfront),
        use_amortized: cdktf.booleanToTerraform(struct.useAmortized),
        use_blended: cdktf.booleanToTerraform(struct.useBlended),
    };
}
export class BudgetsBudgetCostTypesOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._includeCredit !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeCredit = this._includeCredit;
        }
        if (this._includeDiscount !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeDiscount = this._includeDiscount;
        }
        if (this._includeOtherSubscription !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeOtherSubscription = this._includeOtherSubscription;
        }
        if (this._includeRecurring !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeRecurring = this._includeRecurring;
        }
        if (this._includeRefund !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeRefund = this._includeRefund;
        }
        if (this._includeSubscription !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeSubscription = this._includeSubscription;
        }
        if (this._includeSupport !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeSupport = this._includeSupport;
        }
        if (this._includeTax !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeTax = this._includeTax;
        }
        if (this._includeUpfront !== undefined) {
            hasAnyValues = true;
            internalValueResult.includeUpfront = this._includeUpfront;
        }
        if (this._useAmortized !== undefined) {
            hasAnyValues = true;
            internalValueResult.useAmortized = this._useAmortized;
        }
        if (this._useBlended !== undefined) {
            hasAnyValues = true;
            internalValueResult.useBlended = this._useBlended;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._includeCredit = undefined;
            this._includeDiscount = undefined;
            this._includeOtherSubscription = undefined;
            this._includeRecurring = undefined;
            this._includeRefund = undefined;
            this._includeSubscription = undefined;
            this._includeSupport = undefined;
            this._includeTax = undefined;
            this._includeUpfront = undefined;
            this._useAmortized = undefined;
            this._useBlended = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._includeCredit = value.includeCredit;
            this._includeDiscount = value.includeDiscount;
            this._includeOtherSubscription = value.includeOtherSubscription;
            this._includeRecurring = value.includeRecurring;
            this._includeRefund = value.includeRefund;
            this._includeSubscription = value.includeSubscription;
            this._includeSupport = value.includeSupport;
            this._includeTax = value.includeTax;
            this._includeUpfront = value.includeUpfront;
            this._useAmortized = value.useAmortized;
            this._useBlended = value.useBlended;
        }
    }
    // include_credit - computed: false, optional: true, required: false
    _includeCredit;
    get includeCredit() {
        return this.getBooleanAttribute('include_credit');
    }
    set includeCredit(value) {
        this._includeCredit = value;
    }
    resetIncludeCredit() {
        this._includeCredit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeCreditInput() {
        return this._includeCredit;
    }
    // include_discount - computed: false, optional: true, required: false
    _includeDiscount;
    get includeDiscount() {
        return this.getBooleanAttribute('include_discount');
    }
    set includeDiscount(value) {
        this._includeDiscount = value;
    }
    resetIncludeDiscount() {
        this._includeDiscount = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeDiscountInput() {
        return this._includeDiscount;
    }
    // include_other_subscription - computed: false, optional: true, required: false
    _includeOtherSubscription;
    get includeOtherSubscription() {
        return this.getBooleanAttribute('include_other_subscription');
    }
    set includeOtherSubscription(value) {
        this._includeOtherSubscription = value;
    }
    resetIncludeOtherSubscription() {
        this._includeOtherSubscription = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeOtherSubscriptionInput() {
        return this._includeOtherSubscription;
    }
    // include_recurring - computed: false, optional: true, required: false
    _includeRecurring;
    get includeRecurring() {
        return this.getBooleanAttribute('include_recurring');
    }
    set includeRecurring(value) {
        this._includeRecurring = value;
    }
    resetIncludeRecurring() {
        this._includeRecurring = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeRecurringInput() {
        return this._includeRecurring;
    }
    // include_refund - computed: false, optional: true, required: false
    _includeRefund;
    get includeRefund() {
        return this.getBooleanAttribute('include_refund');
    }
    set includeRefund(value) {
        this._includeRefund = value;
    }
    resetIncludeRefund() {
        this._includeRefund = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeRefundInput() {
        return this._includeRefund;
    }
    // include_subscription - computed: false, optional: true, required: false
    _includeSubscription;
    get includeSubscription() {
        return this.getBooleanAttribute('include_subscription');
    }
    set includeSubscription(value) {
        this._includeSubscription = value;
    }
    resetIncludeSubscription() {
        this._includeSubscription = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeSubscriptionInput() {
        return this._includeSubscription;
    }
    // include_support - computed: false, optional: true, required: false
    _includeSupport;
    get includeSupport() {
        return this.getBooleanAttribute('include_support');
    }
    set includeSupport(value) {
        this._includeSupport = value;
    }
    resetIncludeSupport() {
        this._includeSupport = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeSupportInput() {
        return this._includeSupport;
    }
    // include_tax - computed: false, optional: true, required: false
    _includeTax;
    get includeTax() {
        return this.getBooleanAttribute('include_tax');
    }
    set includeTax(value) {
        this._includeTax = value;
    }
    resetIncludeTax() {
        this._includeTax = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeTaxInput() {
        return this._includeTax;
    }
    // include_upfront - computed: false, optional: true, required: false
    _includeUpfront;
    get includeUpfront() {
        return this.getBooleanAttribute('include_upfront');
    }
    set includeUpfront(value) {
        this._includeUpfront = value;
    }
    resetIncludeUpfront() {
        this._includeUpfront = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeUpfrontInput() {
        return this._includeUpfront;
    }
    // use_amortized - computed: false, optional: true, required: false
    _useAmortized;
    get useAmortized() {
        return this.getBooleanAttribute('use_amortized');
    }
    set useAmortized(value) {
        this._useAmortized = value;
    }
    resetUseAmortized() {
        this._useAmortized = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get useAmortizedInput() {
        return this._useAmortized;
    }
    // use_blended - computed: false, optional: true, required: false
    _useBlended;
    get useBlended() {
        return this.getBooleanAttribute('use_blended');
    }
    set useBlended(value) {
        this._useBlended = value;
    }
    resetUseBlended() {
        this._useBlended = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get useBlendedInput() {
        return this._useBlended;
    }
}
export function budgetsBudgetNotificationToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        comparison_operator: cdktf.stringToTerraform(struct.comparisonOperator),
        notification_type: cdktf.stringToTerraform(struct.notificationType),
        subscriber_email_addresses: cdktf.listMapper(cdktf.stringToTerraform)(struct.subscriberEmailAddresses),
        subscriber_sns_topic_arns: cdktf.listMapper(cdktf.stringToTerraform)(struct.subscriberSnsTopicArns),
        threshold: cdktf.numberToTerraform(struct.threshold),
        threshold_type: cdktf.stringToTerraform(struct.thresholdType),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/budgets_budget aws_budgets_budget}
*/
export class BudgetsBudget extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_budgets_budget";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/budgets_budget aws_budgets_budget} Resource
    *
    * @param scope The scope in which to define this construct
    * @param id The scoped construct ID. Must be unique amongst siblings in the same scope
    * @param options BudgetsBudgetConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_budgets_budget',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accountId = config.accountId;
        this._budgetType = config.budgetType;
        this._costFilters = config.costFilters;
        this._limitAmount = config.limitAmount;
        this._limitUnit = config.limitUnit;
        this._name = config.name;
        this._namePrefix = config.namePrefix;
        this._timePeriodEnd = config.timePeriodEnd;
        this._timePeriodStart = config.timePeriodStart;
        this._timeUnit = config.timeUnit;
        this._costFilter = config.costFilter;
        this._costTypes.internalValue = config.costTypes;
        this._notification = config.notification;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // account_id - computed: true, optional: true, required: false
    _accountId;
    get accountId() {
        return this.getStringAttribute('account_id');
    }
    set accountId(value) {
        this._accountId = value;
    }
    resetAccountId() {
        this._accountId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accountIdInput() {
        return this._accountId;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // budget_type - computed: false, optional: false, required: true
    _budgetType;
    get budgetType() {
        return this.getStringAttribute('budget_type');
    }
    set budgetType(value) {
        this._budgetType = value;
    }
    // Temporarily expose input value. Use with caution.
    get budgetTypeInput() {
        return this._budgetType;
    }
    // cost_filters - computed: true, optional: true, required: false
    _costFilters;
    get costFilters() {
        return this.getStringMapAttribute('cost_filters');
    }
    set costFilters(value) {
        this._costFilters = value;
    }
    resetCostFilters() {
        this._costFilters = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get costFiltersInput() {
        return this._costFilters;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // limit_amount - computed: false, optional: false, required: true
    _limitAmount;
    get limitAmount() {
        return this.getStringAttribute('limit_amount');
    }
    set limitAmount(value) {
        this._limitAmount = value;
    }
    // Temporarily expose input value. Use with caution.
    get limitAmountInput() {
        return this._limitAmount;
    }
    // limit_unit - computed: false, optional: false, required: true
    _limitUnit;
    get limitUnit() {
        return this.getStringAttribute('limit_unit');
    }
    set limitUnit(value) {
        this._limitUnit = value;
    }
    // Temporarily expose input value. Use with caution.
    get limitUnitInput() {
        return this._limitUnit;
    }
    // name - computed: true, optional: true, required: false
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    resetName() {
        this._name = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // name_prefix - computed: true, optional: true, required: false
    _namePrefix;
    get namePrefix() {
        return this.getStringAttribute('name_prefix');
    }
    set namePrefix(value) {
        this._namePrefix = value;
    }
    resetNamePrefix() {
        this._namePrefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get namePrefixInput() {
        return this._namePrefix;
    }
    // time_period_end - computed: false, optional: true, required: false
    _timePeriodEnd;
    get timePeriodEnd() {
        return this.getStringAttribute('time_period_end');
    }
    set timePeriodEnd(value) {
        this._timePeriodEnd = value;
    }
    resetTimePeriodEnd() {
        this._timePeriodEnd = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timePeriodEndInput() {
        return this._timePeriodEnd;
    }
    // time_period_start - computed: true, optional: true, required: false
    _timePeriodStart;
    get timePeriodStart() {
        return this.getStringAttribute('time_period_start');
    }
    set timePeriodStart(value) {
        this._timePeriodStart = value;
    }
    resetTimePeriodStart() {
        this._timePeriodStart = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timePeriodStartInput() {
        return this._timePeriodStart;
    }
    // time_unit - computed: false, optional: false, required: true
    _timeUnit;
    get timeUnit() {
        return this.getStringAttribute('time_unit');
    }
    set timeUnit(value) {
        this._timeUnit = value;
    }
    // Temporarily expose input value. Use with caution.
    get timeUnitInput() {
        return this._timeUnit;
    }
    // cost_filter - computed: false, optional: true, required: false
    _costFilter;
    get costFilter() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('cost_filter')));
    }
    set costFilter(value) {
        this._costFilter = value;
    }
    resetCostFilter() {
        this._costFilter = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get costFilterInput() {
        return this._costFilter;
    }
    // cost_types - computed: false, optional: true, required: false
    _costTypes = new BudgetsBudgetCostTypesOutputReference(this, "cost_types", true);
    get costTypes() {
        return this._costTypes;
    }
    putCostTypes(value) {
        this._costTypes.internalValue = value;
    }
    resetCostTypes() {
        this._costTypes.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get costTypesInput() {
        return this._costTypes.internalValue;
    }
    // notification - computed: false, optional: true, required: false
    _notification;
    get notification() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('notification')));
    }
    set notification(value) {
        this._notification = value;
    }
    resetNotification() {
        this._notification = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get notificationInput() {
        return this._notification;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            account_id: cdktf.stringToTerraform(this._accountId),
            budget_type: cdktf.stringToTerraform(this._budgetType),
            cost_filters: cdktf.hashMapper(cdktf.stringToTerraform)(this._costFilters),
            limit_amount: cdktf.stringToTerraform(this._limitAmount),
            limit_unit: cdktf.stringToTerraform(this._limitUnit),
            name: cdktf.stringToTerraform(this._name),
            name_prefix: cdktf.stringToTerraform(this._namePrefix),
            time_period_end: cdktf.stringToTerraform(this._timePeriodEnd),
            time_period_start: cdktf.stringToTerraform(this._timePeriodStart),
            time_unit: cdktf.stringToTerraform(this._timeUnit),
            cost_filter: cdktf.listMapper(budgetsBudgetCostFilterToTerraform)(this._costFilter),
            cost_types: budgetsBudgetCostTypesToTerraform(this._costTypes.internalValue),
            notification: cdktf.listMapper(budgetsBudgetNotificationToTerraform)(this._notification),
        };
    }
}
//# sourceMappingURL=budgets-budget.js.map