// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function configConfigurationAggregatorAccountAggregationSourceToTerraform(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 {
        account_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct.accountIds),
        all_regions: cdktf.booleanToTerraform(struct.allRegions),
        regions: cdktf.listMapper(cdktf.stringToTerraform)(struct.regions),
    };
}
export class ConfigConfigurationAggregatorAccountAggregationSourceOutputReference 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._accountIds !== undefined) {
            hasAnyValues = true;
            internalValueResult.accountIds = this._accountIds;
        }
        if (this._allRegions !== undefined) {
            hasAnyValues = true;
            internalValueResult.allRegions = this._allRegions;
        }
        if (this._regions !== undefined) {
            hasAnyValues = true;
            internalValueResult.regions = this._regions;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._accountIds = undefined;
            this._allRegions = undefined;
            this._regions = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._accountIds = value.accountIds;
            this._allRegions = value.allRegions;
            this._regions = value.regions;
        }
    }
    // account_ids - computed: false, optional: false, required: true
    _accountIds;
    get accountIds() {
        return this.getListAttribute('account_ids');
    }
    set accountIds(value) {
        this._accountIds = value;
    }
    // Temporarily expose input value. Use with caution.
    get accountIdsInput() {
        return this._accountIds;
    }
    // all_regions - computed: false, optional: true, required: false
    _allRegions;
    get allRegions() {
        return this.getBooleanAttribute('all_regions');
    }
    set allRegions(value) {
        this._allRegions = value;
    }
    resetAllRegions() {
        this._allRegions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allRegionsInput() {
        return this._allRegions;
    }
    // regions - computed: false, optional: true, required: false
    _regions;
    get regions() {
        return this.getListAttribute('regions');
    }
    set regions(value) {
        this._regions = value;
    }
    resetRegions() {
        this._regions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get regionsInput() {
        return this._regions;
    }
}
export function configConfigurationAggregatorOrganizationAggregationSourceToTerraform(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 {
        all_regions: cdktf.booleanToTerraform(struct.allRegions),
        regions: cdktf.listMapper(cdktf.stringToTerraform)(struct.regions),
        role_arn: cdktf.stringToTerraform(struct.roleArn),
    };
}
export class ConfigConfigurationAggregatorOrganizationAggregationSourceOutputReference 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._allRegions !== undefined) {
            hasAnyValues = true;
            internalValueResult.allRegions = this._allRegions;
        }
        if (this._regions !== undefined) {
            hasAnyValues = true;
            internalValueResult.regions = this._regions;
        }
        if (this._roleArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.roleArn = this._roleArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._allRegions = undefined;
            this._regions = undefined;
            this._roleArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._allRegions = value.allRegions;
            this._regions = value.regions;
            this._roleArn = value.roleArn;
        }
    }
    // all_regions - computed: false, optional: true, required: false
    _allRegions;
    get allRegions() {
        return this.getBooleanAttribute('all_regions');
    }
    set allRegions(value) {
        this._allRegions = value;
    }
    resetAllRegions() {
        this._allRegions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allRegionsInput() {
        return this._allRegions;
    }
    // regions - computed: false, optional: true, required: false
    _regions;
    get regions() {
        return this.getListAttribute('regions');
    }
    set regions(value) {
        this._regions = value;
    }
    resetRegions() {
        this._regions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get regionsInput() {
        return this._regions;
    }
    // role_arn - computed: false, optional: false, required: true
    _roleArn;
    get roleArn() {
        return this.getStringAttribute('role_arn');
    }
    set roleArn(value) {
        this._roleArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get roleArnInput() {
        return this._roleArn;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/config_configuration_aggregator aws_config_configuration_aggregator}
*/
export class ConfigConfigurationAggregator extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_config_configuration_aggregator";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/config_configuration_aggregator aws_config_configuration_aggregator} 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 ConfigConfigurationAggregatorConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_config_configuration_aggregator',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._accountAggregationSource.internalValue = config.accountAggregationSource;
        this._organizationAggregationSource.internalValue = config.organizationAggregationSource;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // 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;
    }
    // account_aggregation_source - computed: false, optional: true, required: false
    _accountAggregationSource = new ConfigConfigurationAggregatorAccountAggregationSourceOutputReference(this, "account_aggregation_source", true);
    get accountAggregationSource() {
        return this._accountAggregationSource;
    }
    putAccountAggregationSource(value) {
        this._accountAggregationSource.internalValue = value;
    }
    resetAccountAggregationSource() {
        this._accountAggregationSource.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accountAggregationSourceInput() {
        return this._accountAggregationSource.internalValue;
    }
    // organization_aggregation_source - computed: false, optional: true, required: false
    _organizationAggregationSource = new ConfigConfigurationAggregatorOrganizationAggregationSourceOutputReference(this, "organization_aggregation_source", true);
    get organizationAggregationSource() {
        return this._organizationAggregationSource;
    }
    putOrganizationAggregationSource(value) {
        this._organizationAggregationSource.internalValue = value;
    }
    resetOrganizationAggregationSource() {
        this._organizationAggregationSource.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get organizationAggregationSourceInput() {
        return this._organizationAggregationSource.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            account_aggregation_source: configConfigurationAggregatorAccountAggregationSourceToTerraform(this._accountAggregationSource.internalValue),
            organization_aggregation_source: configConfigurationAggregatorOrganizationAggregationSourceToTerraform(this._organizationAggregationSource.internalValue),
        };
    }
}
//# sourceMappingURL=config-configuration-aggregator.js.map