// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function dbProxyDefaultTargetGroupConnectionPoolConfigToTerraform(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 {
        connection_borrow_timeout: cdktf.numberToTerraform(struct.connectionBorrowTimeout),
        init_query: cdktf.stringToTerraform(struct.initQuery),
        max_connections_percent: cdktf.numberToTerraform(struct.maxConnectionsPercent),
        max_idle_connections_percent: cdktf.numberToTerraform(struct.maxIdleConnectionsPercent),
        session_pinning_filters: cdktf.listMapper(cdktf.stringToTerraform)(struct.sessionPinningFilters),
    };
}
export class DbProxyDefaultTargetGroupConnectionPoolConfigOutputReference 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._connectionBorrowTimeout !== undefined) {
            hasAnyValues = true;
            internalValueResult.connectionBorrowTimeout = this._connectionBorrowTimeout;
        }
        if (this._initQuery !== undefined) {
            hasAnyValues = true;
            internalValueResult.initQuery = this._initQuery;
        }
        if (this._maxConnectionsPercent !== undefined) {
            hasAnyValues = true;
            internalValueResult.maxConnectionsPercent = this._maxConnectionsPercent;
        }
        if (this._maxIdleConnectionsPercent !== undefined) {
            hasAnyValues = true;
            internalValueResult.maxIdleConnectionsPercent = this._maxIdleConnectionsPercent;
        }
        if (this._sessionPinningFilters !== undefined) {
            hasAnyValues = true;
            internalValueResult.sessionPinningFilters = this._sessionPinningFilters;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._connectionBorrowTimeout = undefined;
            this._initQuery = undefined;
            this._maxConnectionsPercent = undefined;
            this._maxIdleConnectionsPercent = undefined;
            this._sessionPinningFilters = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._connectionBorrowTimeout = value.connectionBorrowTimeout;
            this._initQuery = value.initQuery;
            this._maxConnectionsPercent = value.maxConnectionsPercent;
            this._maxIdleConnectionsPercent = value.maxIdleConnectionsPercent;
            this._sessionPinningFilters = value.sessionPinningFilters;
        }
    }
    // connection_borrow_timeout - computed: false, optional: true, required: false
    _connectionBorrowTimeout;
    get connectionBorrowTimeout() {
        return this.getNumberAttribute('connection_borrow_timeout');
    }
    set connectionBorrowTimeout(value) {
        this._connectionBorrowTimeout = value;
    }
    resetConnectionBorrowTimeout() {
        this._connectionBorrowTimeout = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get connectionBorrowTimeoutInput() {
        return this._connectionBorrowTimeout;
    }
    // init_query - computed: false, optional: true, required: false
    _initQuery;
    get initQuery() {
        return this.getStringAttribute('init_query');
    }
    set initQuery(value) {
        this._initQuery = value;
    }
    resetInitQuery() {
        this._initQuery = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get initQueryInput() {
        return this._initQuery;
    }
    // max_connections_percent - computed: false, optional: true, required: false
    _maxConnectionsPercent;
    get maxConnectionsPercent() {
        return this.getNumberAttribute('max_connections_percent');
    }
    set maxConnectionsPercent(value) {
        this._maxConnectionsPercent = value;
    }
    resetMaxConnectionsPercent() {
        this._maxConnectionsPercent = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maxConnectionsPercentInput() {
        return this._maxConnectionsPercent;
    }
    // max_idle_connections_percent - computed: false, optional: true, required: false
    _maxIdleConnectionsPercent;
    get maxIdleConnectionsPercent() {
        return this.getNumberAttribute('max_idle_connections_percent');
    }
    set maxIdleConnectionsPercent(value) {
        this._maxIdleConnectionsPercent = value;
    }
    resetMaxIdleConnectionsPercent() {
        this._maxIdleConnectionsPercent = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maxIdleConnectionsPercentInput() {
        return this._maxIdleConnectionsPercent;
    }
    // session_pinning_filters - computed: false, optional: true, required: false
    _sessionPinningFilters;
    get sessionPinningFilters() {
        return cdktf.Fn.tolist(this.getListAttribute('session_pinning_filters'));
    }
    set sessionPinningFilters(value) {
        this._sessionPinningFilters = value;
    }
    resetSessionPinningFilters() {
        this._sessionPinningFilters = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sessionPinningFiltersInput() {
        return this._sessionPinningFilters;
    }
}
export function dbProxyDefaultTargetGroupTimeoutsToTerraform(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),
        update: cdktf.stringToTerraform(struct.update),
    };
}
export class DbProxyDefaultTargetGroupTimeoutsOutputReference 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._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._update = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            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;
    }
    // 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/db_proxy_default_target_group aws_db_proxy_default_target_group}
*/
export class DbProxyDefaultTargetGroup extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_db_proxy_default_target_group";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/db_proxy_default_target_group aws_db_proxy_default_target_group} 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 DbProxyDefaultTargetGroupConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_db_proxy_default_target_group',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._dbProxyName = config.dbProxyName;
        this._connectionPoolConfig.internalValue = config.connectionPoolConfig;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // db_proxy_name - computed: false, optional: false, required: true
    _dbProxyName;
    get dbProxyName() {
        return this.getStringAttribute('db_proxy_name');
    }
    set dbProxyName(value) {
        this._dbProxyName = value;
    }
    // Temporarily expose input value. Use with caution.
    get dbProxyNameInput() {
        return this._dbProxyName;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // name - computed: true, optional: false, required: false
    get name() {
        return this.getStringAttribute('name');
    }
    // connection_pool_config - computed: false, optional: true, required: false
    _connectionPoolConfig = new DbProxyDefaultTargetGroupConnectionPoolConfigOutputReference(this, "connection_pool_config", true);
    get connectionPoolConfig() {
        return this._connectionPoolConfig;
    }
    putConnectionPoolConfig(value) {
        this._connectionPoolConfig.internalValue = value;
    }
    resetConnectionPoolConfig() {
        this._connectionPoolConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get connectionPoolConfigInput() {
        return this._connectionPoolConfig.internalValue;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new DbProxyDefaultTargetGroupTimeoutsOutputReference(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 {
            db_proxy_name: cdktf.stringToTerraform(this._dbProxyName),
            connection_pool_config: dbProxyDefaultTargetGroupConnectionPoolConfigToTerraform(this._connectionPoolConfig.internalValue),
            timeouts: dbProxyDefaultTargetGroupTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=db-proxy-default-target-group.js.map