// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function glueCatalogDatabaseCreateTableDefaultPermissionPrincipalToTerraform(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 {
        data_lake_principal_identifier: cdktf.stringToTerraform(struct.dataLakePrincipalIdentifier),
    };
}
export class GlueCatalogDatabaseCreateTableDefaultPermissionPrincipalOutputReference 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._dataLakePrincipalIdentifier !== undefined) {
            hasAnyValues = true;
            internalValueResult.dataLakePrincipalIdentifier = this._dataLakePrincipalIdentifier;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._dataLakePrincipalIdentifier = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._dataLakePrincipalIdentifier = value.dataLakePrincipalIdentifier;
        }
    }
    // data_lake_principal_identifier - computed: false, optional: true, required: false
    _dataLakePrincipalIdentifier;
    get dataLakePrincipalIdentifier() {
        return this.getStringAttribute('data_lake_principal_identifier');
    }
    set dataLakePrincipalIdentifier(value) {
        this._dataLakePrincipalIdentifier = value;
    }
    resetDataLakePrincipalIdentifier() {
        this._dataLakePrincipalIdentifier = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dataLakePrincipalIdentifierInput() {
        return this._dataLakePrincipalIdentifier;
    }
}
export function glueCatalogDatabaseCreateTableDefaultPermissionToTerraform(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 {
        permissions: cdktf.listMapper(cdktf.stringToTerraform)(struct.permissions),
        principal: glueCatalogDatabaseCreateTableDefaultPermissionPrincipalToTerraform(struct.principal),
    };
}
export function glueCatalogDatabaseTargetDatabaseToTerraform(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 {
        catalog_id: cdktf.stringToTerraform(struct.catalogId),
        database_name: cdktf.stringToTerraform(struct.databaseName),
    };
}
export class GlueCatalogDatabaseTargetDatabaseOutputReference 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._catalogId !== undefined) {
            hasAnyValues = true;
            internalValueResult.catalogId = this._catalogId;
        }
        if (this._databaseName !== undefined) {
            hasAnyValues = true;
            internalValueResult.databaseName = this._databaseName;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._catalogId = undefined;
            this._databaseName = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._catalogId = value.catalogId;
            this._databaseName = value.databaseName;
        }
    }
    // catalog_id - computed: false, optional: false, required: true
    _catalogId;
    get catalogId() {
        return this.getStringAttribute('catalog_id');
    }
    set catalogId(value) {
        this._catalogId = value;
    }
    // Temporarily expose input value. Use with caution.
    get catalogIdInput() {
        return this._catalogId;
    }
    // database_name - computed: false, optional: false, required: true
    _databaseName;
    get databaseName() {
        return this.getStringAttribute('database_name');
    }
    set databaseName(value) {
        this._databaseName = value;
    }
    // Temporarily expose input value. Use with caution.
    get databaseNameInput() {
        return this._databaseName;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/glue_catalog_database aws_glue_catalog_database}
*/
export class GlueCatalogDatabase extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_glue_catalog_database";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/glue_catalog_database aws_glue_catalog_database} 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 GlueCatalogDatabaseConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_glue_catalog_database',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._catalogId = config.catalogId;
        this._description = config.description;
        this._locationUri = config.locationUri;
        this._name = config.name;
        this._parameters = config.parameters;
        this._createTableDefaultPermission = config.createTableDefaultPermission;
        this._targetDatabase.internalValue = config.targetDatabase;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // catalog_id - computed: true, optional: true, required: false
    _catalogId;
    get catalogId() {
        return this.getStringAttribute('catalog_id');
    }
    set catalogId(value) {
        this._catalogId = value;
    }
    resetCatalogId() {
        this._catalogId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get catalogIdInput() {
        return this._catalogId;
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // location_uri - computed: true, optional: true, required: false
    _locationUri;
    get locationUri() {
        return this.getStringAttribute('location_uri');
    }
    set locationUri(value) {
        this._locationUri = value;
    }
    resetLocationUri() {
        this._locationUri = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get locationUriInput() {
        return this._locationUri;
    }
    // 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;
    }
    // parameters - computed: false, 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;
    }
    // create_table_default_permission - computed: false, optional: true, required: false
    _createTableDefaultPermission;
    get createTableDefaultPermission() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('create_table_default_permission');
    }
    set createTableDefaultPermission(value) {
        this._createTableDefaultPermission = value;
    }
    resetCreateTableDefaultPermission() {
        this._createTableDefaultPermission = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get createTableDefaultPermissionInput() {
        return this._createTableDefaultPermission;
    }
    // target_database - computed: false, optional: true, required: false
    _targetDatabase = new GlueCatalogDatabaseTargetDatabaseOutputReference(this, "target_database", true);
    get targetDatabase() {
        return this._targetDatabase;
    }
    putTargetDatabase(value) {
        this._targetDatabase.internalValue = value;
    }
    resetTargetDatabase() {
        this._targetDatabase.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get targetDatabaseInput() {
        return this._targetDatabase.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            catalog_id: cdktf.stringToTerraform(this._catalogId),
            description: cdktf.stringToTerraform(this._description),
            location_uri: cdktf.stringToTerraform(this._locationUri),
            name: cdktf.stringToTerraform(this._name),
            parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameters),
            create_table_default_permission: cdktf.listMapper(glueCatalogDatabaseCreateTableDefaultPermissionToTerraform)(this._createTableDefaultPermission),
            target_database: glueCatalogDatabaseTargetDatabaseToTerraform(this._targetDatabase.internalValue),
        };
    }
}
//# sourceMappingURL=glue-catalog-database.js.map