// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function budgetsBudgetActionActionThresholdToTerraform(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 {
        action_threshold_type: cdktf.stringToTerraform(struct.actionThresholdType),
        action_threshold_value: cdktf.numberToTerraform(struct.actionThresholdValue),
    };
}
export class BudgetsBudgetActionActionThresholdOutputReference 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._actionThresholdType !== undefined) {
            hasAnyValues = true;
            internalValueResult.actionThresholdType = this._actionThresholdType;
        }
        if (this._actionThresholdValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.actionThresholdValue = this._actionThresholdValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._actionThresholdType = undefined;
            this._actionThresholdValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._actionThresholdType = value.actionThresholdType;
            this._actionThresholdValue = value.actionThresholdValue;
        }
    }
    // action_threshold_type - computed: false, optional: false, required: true
    _actionThresholdType;
    get actionThresholdType() {
        return this.getStringAttribute('action_threshold_type');
    }
    set actionThresholdType(value) {
        this._actionThresholdType = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionThresholdTypeInput() {
        return this._actionThresholdType;
    }
    // action_threshold_value - computed: false, optional: false, required: true
    _actionThresholdValue;
    get actionThresholdValue() {
        return this.getNumberAttribute('action_threshold_value');
    }
    set actionThresholdValue(value) {
        this._actionThresholdValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionThresholdValueInput() {
        return this._actionThresholdValue;
    }
}
export function budgetsBudgetActionDefinitionIamActionDefinitionToTerraform(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 {
        groups: cdktf.listMapper(cdktf.stringToTerraform)(struct.groups),
        policy_arn: cdktf.stringToTerraform(struct.policyArn),
        roles: cdktf.listMapper(cdktf.stringToTerraform)(struct.roles),
        users: cdktf.listMapper(cdktf.stringToTerraform)(struct.users),
    };
}
export class BudgetsBudgetActionDefinitionIamActionDefinitionOutputReference 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._groups !== undefined) {
            hasAnyValues = true;
            internalValueResult.groups = this._groups;
        }
        if (this._policyArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.policyArn = this._policyArn;
        }
        if (this._roles !== undefined) {
            hasAnyValues = true;
            internalValueResult.roles = this._roles;
        }
        if (this._users !== undefined) {
            hasAnyValues = true;
            internalValueResult.users = this._users;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._groups = undefined;
            this._policyArn = undefined;
            this._roles = undefined;
            this._users = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._groups = value.groups;
            this._policyArn = value.policyArn;
            this._roles = value.roles;
            this._users = value.users;
        }
    }
    // groups - computed: false, optional: true, required: false
    _groups;
    get groups() {
        return cdktf.Fn.tolist(this.getListAttribute('groups'));
    }
    set groups(value) {
        this._groups = value;
    }
    resetGroups() {
        this._groups = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get groupsInput() {
        return this._groups;
    }
    // policy_arn - computed: false, optional: false, required: true
    _policyArn;
    get policyArn() {
        return this.getStringAttribute('policy_arn');
    }
    set policyArn(value) {
        this._policyArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get policyArnInput() {
        return this._policyArn;
    }
    // roles - computed: false, optional: true, required: false
    _roles;
    get roles() {
        return cdktf.Fn.tolist(this.getListAttribute('roles'));
    }
    set roles(value) {
        this._roles = value;
    }
    resetRoles() {
        this._roles = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rolesInput() {
        return this._roles;
    }
    // users - computed: false, optional: true, required: false
    _users;
    get users() {
        return cdktf.Fn.tolist(this.getListAttribute('users'));
    }
    set users(value) {
        this._users = value;
    }
    resetUsers() {
        this._users = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get usersInput() {
        return this._users;
    }
}
export function budgetsBudgetActionDefinitionScpActionDefinitionToTerraform(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 {
        policy_id: cdktf.stringToTerraform(struct.policyId),
        target_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct.targetIds),
    };
}
export class BudgetsBudgetActionDefinitionScpActionDefinitionOutputReference 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._policyId !== undefined) {
            hasAnyValues = true;
            internalValueResult.policyId = this._policyId;
        }
        if (this._targetIds !== undefined) {
            hasAnyValues = true;
            internalValueResult.targetIds = this._targetIds;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._policyId = undefined;
            this._targetIds = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._policyId = value.policyId;
            this._targetIds = value.targetIds;
        }
    }
    // policy_id - computed: false, optional: false, required: true
    _policyId;
    get policyId() {
        return this.getStringAttribute('policy_id');
    }
    set policyId(value) {
        this._policyId = value;
    }
    // Temporarily expose input value. Use with caution.
    get policyIdInput() {
        return this._policyId;
    }
    // target_ids - computed: false, optional: false, required: true
    _targetIds;
    get targetIds() {
        return cdktf.Fn.tolist(this.getListAttribute('target_ids'));
    }
    set targetIds(value) {
        this._targetIds = value;
    }
    // Temporarily expose input value. Use with caution.
    get targetIdsInput() {
        return this._targetIds;
    }
}
export function budgetsBudgetActionDefinitionSsmActionDefinitionToTerraform(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 {
        action_sub_type: cdktf.stringToTerraform(struct.actionSubType),
        instance_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct.instanceIds),
        region: cdktf.stringToTerraform(struct.region),
    };
}
export class BudgetsBudgetActionDefinitionSsmActionDefinitionOutputReference 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._actionSubType !== undefined) {
            hasAnyValues = true;
            internalValueResult.actionSubType = this._actionSubType;
        }
        if (this._instanceIds !== undefined) {
            hasAnyValues = true;
            internalValueResult.instanceIds = this._instanceIds;
        }
        if (this._region !== undefined) {
            hasAnyValues = true;
            internalValueResult.region = this._region;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._actionSubType = undefined;
            this._instanceIds = undefined;
            this._region = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._actionSubType = value.actionSubType;
            this._instanceIds = value.instanceIds;
            this._region = value.region;
        }
    }
    // action_sub_type - computed: false, optional: false, required: true
    _actionSubType;
    get actionSubType() {
        return this.getStringAttribute('action_sub_type');
    }
    set actionSubType(value) {
        this._actionSubType = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionSubTypeInput() {
        return this._actionSubType;
    }
    // instance_ids - computed: false, optional: false, required: true
    _instanceIds;
    get instanceIds() {
        return cdktf.Fn.tolist(this.getListAttribute('instance_ids'));
    }
    set instanceIds(value) {
        this._instanceIds = value;
    }
    // Temporarily expose input value. Use with caution.
    get instanceIdsInput() {
        return this._instanceIds;
    }
    // region - computed: false, optional: false, required: true
    _region;
    get region() {
        return this.getStringAttribute('region');
    }
    set region(value) {
        this._region = value;
    }
    // Temporarily expose input value. Use with caution.
    get regionInput() {
        return this._region;
    }
}
export function budgetsBudgetActionDefinitionToTerraform(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 {
        iam_action_definition: budgetsBudgetActionDefinitionIamActionDefinitionToTerraform(struct.iamActionDefinition),
        scp_action_definition: budgetsBudgetActionDefinitionScpActionDefinitionToTerraform(struct.scpActionDefinition),
        ssm_action_definition: budgetsBudgetActionDefinitionSsmActionDefinitionToTerraform(struct.ssmActionDefinition),
    };
}
export class BudgetsBudgetActionDefinitionOutputReference 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._iamActionDefinition?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.iamActionDefinition = this._iamActionDefinition?.internalValue;
        }
        if (this._scpActionDefinition?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.scpActionDefinition = this._scpActionDefinition?.internalValue;
        }
        if (this._ssmActionDefinition?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.ssmActionDefinition = this._ssmActionDefinition?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._iamActionDefinition.internalValue = undefined;
            this._scpActionDefinition.internalValue = undefined;
            this._ssmActionDefinition.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._iamActionDefinition.internalValue = value.iamActionDefinition;
            this._scpActionDefinition.internalValue = value.scpActionDefinition;
            this._ssmActionDefinition.internalValue = value.ssmActionDefinition;
        }
    }
    // iam_action_definition - computed: false, optional: true, required: false
    _iamActionDefinition = new BudgetsBudgetActionDefinitionIamActionDefinitionOutputReference(this, "iam_action_definition", true);
    get iamActionDefinition() {
        return this._iamActionDefinition;
    }
    putIamActionDefinition(value) {
        this._iamActionDefinition.internalValue = value;
    }
    resetIamActionDefinition() {
        this._iamActionDefinition.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get iamActionDefinitionInput() {
        return this._iamActionDefinition.internalValue;
    }
    // scp_action_definition - computed: false, optional: true, required: false
    _scpActionDefinition = new BudgetsBudgetActionDefinitionScpActionDefinitionOutputReference(this, "scp_action_definition", true);
    get scpActionDefinition() {
        return this._scpActionDefinition;
    }
    putScpActionDefinition(value) {
        this._scpActionDefinition.internalValue = value;
    }
    resetScpActionDefinition() {
        this._scpActionDefinition.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get scpActionDefinitionInput() {
        return this._scpActionDefinition.internalValue;
    }
    // ssm_action_definition - computed: false, optional: true, required: false
    _ssmActionDefinition = new BudgetsBudgetActionDefinitionSsmActionDefinitionOutputReference(this, "ssm_action_definition", true);
    get ssmActionDefinition() {
        return this._ssmActionDefinition;
    }
    putSsmActionDefinition(value) {
        this._ssmActionDefinition.internalValue = value;
    }
    resetSsmActionDefinition() {
        this._ssmActionDefinition.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ssmActionDefinitionInput() {
        return this._ssmActionDefinition.internalValue;
    }
}
export function budgetsBudgetActionSubscriberToTerraform(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 {
        address: cdktf.stringToTerraform(struct.address),
        subscription_type: cdktf.stringToTerraform(struct.subscriptionType),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/budgets_budget_action aws_budgets_budget_action}
*/
export class BudgetsBudgetAction extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_budgets_budget_action";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/budgets_budget_action aws_budgets_budget_action} 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 BudgetsBudgetActionConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_budgets_budget_action',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accountId = config.accountId;
        this._actionType = config.actionType;
        this._approvalModel = config.approvalModel;
        this._budgetName = config.budgetName;
        this._executionRoleArn = config.executionRoleArn;
        this._notificationType = config.notificationType;
        this._actionThreshold.internalValue = config.actionThreshold;
        this._definition.internalValue = config.definition;
        this._subscriber = config.subscriber;
    }
    // ==========
    // 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;
    }
    // action_id - computed: true, optional: false, required: false
    get actionId() {
        return this.getStringAttribute('action_id');
    }
    // action_type - computed: false, optional: false, required: true
    _actionType;
    get actionType() {
        return this.getStringAttribute('action_type');
    }
    set actionType(value) {
        this._actionType = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionTypeInput() {
        return this._actionType;
    }
    // approval_model - computed: false, optional: false, required: true
    _approvalModel;
    get approvalModel() {
        return this.getStringAttribute('approval_model');
    }
    set approvalModel(value) {
        this._approvalModel = value;
    }
    // Temporarily expose input value. Use with caution.
    get approvalModelInput() {
        return this._approvalModel;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // budget_name - computed: false, optional: false, required: true
    _budgetName;
    get budgetName() {
        return this.getStringAttribute('budget_name');
    }
    set budgetName(value) {
        this._budgetName = value;
    }
    // Temporarily expose input value. Use with caution.
    get budgetNameInput() {
        return this._budgetName;
    }
    // execution_role_arn - computed: false, optional: false, required: true
    _executionRoleArn;
    get executionRoleArn() {
        return this.getStringAttribute('execution_role_arn');
    }
    set executionRoleArn(value) {
        this._executionRoleArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get executionRoleArnInput() {
        return this._executionRoleArn;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // notification_type - computed: false, optional: false, required: true
    _notificationType;
    get notificationType() {
        return this.getStringAttribute('notification_type');
    }
    set notificationType(value) {
        this._notificationType = value;
    }
    // Temporarily expose input value. Use with caution.
    get notificationTypeInput() {
        return this._notificationType;
    }
    // status - computed: true, optional: false, required: false
    get status() {
        return this.getStringAttribute('status');
    }
    // action_threshold - computed: false, optional: false, required: true
    _actionThreshold = new BudgetsBudgetActionActionThresholdOutputReference(this, "action_threshold", true);
    get actionThreshold() {
        return this._actionThreshold;
    }
    putActionThreshold(value) {
        this._actionThreshold.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionThresholdInput() {
        return this._actionThreshold.internalValue;
    }
    // definition - computed: false, optional: false, required: true
    _definition = new BudgetsBudgetActionDefinitionOutputReference(this, "definition", true);
    get definition() {
        return this._definition;
    }
    putDefinition(value) {
        this._definition.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get definitionInput() {
        return this._definition.internalValue;
    }
    // subscriber - computed: false, optional: false, required: true
    _subscriber;
    get subscriber() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('subscriber')));
    }
    set subscriber(value) {
        this._subscriber = value;
    }
    // Temporarily expose input value. Use with caution.
    get subscriberInput() {
        return this._subscriber;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            account_id: cdktf.stringToTerraform(this._accountId),
            action_type: cdktf.stringToTerraform(this._actionType),
            approval_model: cdktf.stringToTerraform(this._approvalModel),
            budget_name: cdktf.stringToTerraform(this._budgetName),
            execution_role_arn: cdktf.stringToTerraform(this._executionRoleArn),
            notification_type: cdktf.stringToTerraform(this._notificationType),
            action_threshold: budgetsBudgetActionActionThresholdToTerraform(this._actionThreshold.internalValue),
            definition: budgetsBudgetActionDefinitionToTerraform(this._definition.internalValue),
            subscriber: cdktf.listMapper(budgetsBudgetActionSubscriberToTerraform)(this._subscriber),
        };
    }
}
//# sourceMappingURL=budgets-budget-action.js.map