// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cloudformationStackTimeoutsToTerraform(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 {
        create: cdktf.stringToTerraform(struct.create),
        delete: cdktf.stringToTerraform(struct.delete),
        update: cdktf.stringToTerraform(struct.update),
    };
}
export class CloudformationStackTimeoutsOutputReference 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._create !== undefined) {
            hasAnyValues = true;
            internalValueResult.create = this._create;
        }
        if (this._delete !== undefined) {
            hasAnyValues = true;
            internalValueResult.delete = this._delete;
        }
        if (this._update !== undefined) {
            hasAnyValues = true;
            internalValueResult.update = this._update;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._create = undefined;
            this._delete = undefined;
            this._update = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            this._delete = value.delete;
            this._update = value.update;
        }
    }
    // create - computed: false, optional: true, required: false
    _create;
    get create() {
        return this.getStringAttribute('create');
    }
    set create(value) {
        this._create = value;
    }
    resetCreate() {
        this._create = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get createInput() {
        return this._create;
    }
    // delete - computed: false, optional: true, required: false
    _delete;
    get delete() {
        return this.getStringAttribute('delete');
    }
    set delete(value) {
        this._delete = value;
    }
    resetDelete() {
        this._delete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deleteInput() {
        return this._delete;
    }
    // update - computed: false, optional: true, required: false
    _update;
    get update() {
        return this.getStringAttribute('update');
    }
    set update(value) {
        this._update = value;
    }
    resetUpdate() {
        this._update = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get updateInput() {
        return this._update;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_stack aws_cloudformation_stack}
*/
export class CloudformationStack extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cloudformation_stack";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_stack aws_cloudformation_stack} 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 CloudformationStackConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cloudformation_stack',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._capabilities = config.capabilities;
        this._disableRollback = config.disableRollback;
        this._iamRoleArn = config.iamRoleArn;
        this._name = config.name;
        this._notificationArns = config.notificationArns;
        this._onFailure = config.onFailure;
        this._parameters = config.parameters;
        this._policyBody = config.policyBody;
        this._policyUrl = config.policyUrl;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._templateBody = config.templateBody;
        this._templateUrl = config.templateUrl;
        this._timeoutInMinutes = config.timeoutInMinutes;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // capabilities - computed: false, optional: true, required: false
    _capabilities;
    get capabilities() {
        return cdktf.Fn.tolist(this.getListAttribute('capabilities'));
    }
    set capabilities(value) {
        this._capabilities = value;
    }
    resetCapabilities() {
        this._capabilities = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get capabilitiesInput() {
        return this._capabilities;
    }
    // disable_rollback - computed: false, optional: true, required: false
    _disableRollback;
    get disableRollback() {
        return this.getBooleanAttribute('disable_rollback');
    }
    set disableRollback(value) {
        this._disableRollback = value;
    }
    resetDisableRollback() {
        this._disableRollback = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get disableRollbackInput() {
        return this._disableRollback;
    }
    // iam_role_arn - computed: false, optional: true, required: false
    _iamRoleArn;
    get iamRoleArn() {
        return this.getStringAttribute('iam_role_arn');
    }
    set iamRoleArn(value) {
        this._iamRoleArn = value;
    }
    resetIamRoleArn() {
        this._iamRoleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get iamRoleArnInput() {
        return this._iamRoleArn;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // name - computed: false, optional: false, required: true
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // notification_arns - computed: false, optional: true, required: false
    _notificationArns;
    get notificationArns() {
        return cdktf.Fn.tolist(this.getListAttribute('notification_arns'));
    }
    set notificationArns(value) {
        this._notificationArns = value;
    }
    resetNotificationArns() {
        this._notificationArns = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get notificationArnsInput() {
        return this._notificationArns;
    }
    // on_failure - computed: false, optional: true, required: false
    _onFailure;
    get onFailure() {
        return this.getStringAttribute('on_failure');
    }
    set onFailure(value) {
        this._onFailure = value;
    }
    resetOnFailure() {
        this._onFailure = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get onFailureInput() {
        return this._onFailure;
    }
    // outputs - computed: true, optional: false, required: false
    outputs(key) {
        return new cdktf.StringMap(this, 'outputs').lookup(key);
    }
    // parameters - computed: true, optional: true, required: false
    _parameters;
    get parameters() {
        return this.getStringMapAttribute('parameters');
    }
    set parameters(value) {
        this._parameters = value;
    }
    resetParameters() {
        this._parameters = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get parametersInput() {
        return this._parameters;
    }
    // policy_body - computed: true, optional: true, required: false
    _policyBody;
    get policyBody() {
        return this.getStringAttribute('policy_body');
    }
    set policyBody(value) {
        this._policyBody = value;
    }
    resetPolicyBody() {
        this._policyBody = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyBodyInput() {
        return this._policyBody;
    }
    // policy_url - computed: false, optional: true, required: false
    _policyUrl;
    get policyUrl() {
        return this.getStringAttribute('policy_url');
    }
    set policyUrl(value) {
        this._policyUrl = value;
    }
    resetPolicyUrl() {
        this._policyUrl = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyUrlInput() {
        return this._policyUrl;
    }
    // tags - computed: false, optional: true, required: false
    _tags;
    get tags() {
        return this.getStringMapAttribute('tags');
    }
    set tags(value) {
        this._tags = value;
    }
    resetTags() {
        this._tags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsInput() {
        return this._tags;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // template_body - computed: true, optional: true, required: false
    _templateBody;
    get templateBody() {
        return this.getStringAttribute('template_body');
    }
    set templateBody(value) {
        this._templateBody = value;
    }
    resetTemplateBody() {
        this._templateBody = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get templateBodyInput() {
        return this._templateBody;
    }
    // template_url - computed: false, optional: true, required: false
    _templateUrl;
    get templateUrl() {
        return this.getStringAttribute('template_url');
    }
    set templateUrl(value) {
        this._templateUrl = value;
    }
    resetTemplateUrl() {
        this._templateUrl = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get templateUrlInput() {
        return this._templateUrl;
    }
    // timeout_in_minutes - computed: false, optional: true, required: false
    _timeoutInMinutes;
    get timeoutInMinutes() {
        return this.getNumberAttribute('timeout_in_minutes');
    }
    set timeoutInMinutes(value) {
        this._timeoutInMinutes = value;
    }
    resetTimeoutInMinutes() {
        this._timeoutInMinutes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutInMinutesInput() {
        return this._timeoutInMinutes;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new CloudformationStackTimeoutsOutputReference(this, "timeouts", true);
    get timeouts() {
        return this._timeouts;
    }
    putTimeouts(value) {
        this._timeouts.internalValue = value;
    }
    resetTimeouts() {
        this._timeouts.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutsInput() {
        return this._timeouts.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            capabilities: cdktf.listMapper(cdktf.stringToTerraform)(this._capabilities),
            disable_rollback: cdktf.booleanToTerraform(this._disableRollback),
            iam_role_arn: cdktf.stringToTerraform(this._iamRoleArn),
            name: cdktf.stringToTerraform(this._name),
            notification_arns: cdktf.listMapper(cdktf.stringToTerraform)(this._notificationArns),
            on_failure: cdktf.stringToTerraform(this._onFailure),
            parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameters),
            policy_body: cdktf.stringToTerraform(this._policyBody),
            policy_url: cdktf.stringToTerraform(this._policyUrl),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            template_body: cdktf.stringToTerraform(this._templateBody),
            template_url: cdktf.stringToTerraform(this._templateUrl),
            timeout_in_minutes: cdktf.numberToTerraform(this._timeoutInMinutes),
            timeouts: cloudformationStackTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=cloudformation-stack.js.map