// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function timestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationS3ConfigurationToTerraform(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 {
        bucket_name: cdktf.stringToTerraform(struct.bucketName),
        encryption_option: cdktf.stringToTerraform(struct.encryptionOption),
        kms_key_id: cdktf.stringToTerraform(struct.kmsKeyId),
        object_key_prefix: cdktf.stringToTerraform(struct.objectKeyPrefix),
    };
}
export class TimestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationS3ConfigurationOutputReference 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._bucketName !== undefined) {
            hasAnyValues = true;
            internalValueResult.bucketName = this._bucketName;
        }
        if (this._encryptionOption !== undefined) {
            hasAnyValues = true;
            internalValueResult.encryptionOption = this._encryptionOption;
        }
        if (this._kmsKeyId !== undefined) {
            hasAnyValues = true;
            internalValueResult.kmsKeyId = this._kmsKeyId;
        }
        if (this._objectKeyPrefix !== undefined) {
            hasAnyValues = true;
            internalValueResult.objectKeyPrefix = this._objectKeyPrefix;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._bucketName = undefined;
            this._encryptionOption = undefined;
            this._kmsKeyId = undefined;
            this._objectKeyPrefix = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._bucketName = value.bucketName;
            this._encryptionOption = value.encryptionOption;
            this._kmsKeyId = value.kmsKeyId;
            this._objectKeyPrefix = value.objectKeyPrefix;
        }
    }
    // bucket_name - computed: false, optional: true, required: false
    _bucketName;
    get bucketName() {
        return this.getStringAttribute('bucket_name');
    }
    set bucketName(value) {
        this._bucketName = value;
    }
    resetBucketName() {
        this._bucketName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get bucketNameInput() {
        return this._bucketName;
    }
    // encryption_option - computed: false, optional: true, required: false
    _encryptionOption;
    get encryptionOption() {
        return this.getStringAttribute('encryption_option');
    }
    set encryptionOption(value) {
        this._encryptionOption = value;
    }
    resetEncryptionOption() {
        this._encryptionOption = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get encryptionOptionInput() {
        return this._encryptionOption;
    }
    // kms_key_id - computed: false, optional: true, required: false
    _kmsKeyId;
    get kmsKeyId() {
        return this.getStringAttribute('kms_key_id');
    }
    set kmsKeyId(value) {
        this._kmsKeyId = value;
    }
    resetKmsKeyId() {
        this._kmsKeyId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get kmsKeyIdInput() {
        return this._kmsKeyId;
    }
    // object_key_prefix - computed: false, optional: true, required: false
    _objectKeyPrefix;
    get objectKeyPrefix() {
        return this.getStringAttribute('object_key_prefix');
    }
    set objectKeyPrefix(value) {
        this._objectKeyPrefix = value;
    }
    resetObjectKeyPrefix() {
        this._objectKeyPrefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get objectKeyPrefixInput() {
        return this._objectKeyPrefix;
    }
}
export function timestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationToTerraform(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 {
        s3_configuration: timestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationS3ConfigurationToTerraform(struct.s3Configuration),
    };
}
export class TimestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationOutputReference 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._s3Configuration?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.s3Configuration = this._s3Configuration?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._s3Configuration.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._s3Configuration.internalValue = value.s3Configuration;
        }
    }
    // s3_configuration - computed: false, optional: true, required: false
    _s3Configuration = new TimestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationS3ConfigurationOutputReference(this, "s3_configuration", true);
    get s3Configuration() {
        return this._s3Configuration;
    }
    putS3Configuration(value) {
        this._s3Configuration.internalValue = value;
    }
    resetS3Configuration() {
        this._s3Configuration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3ConfigurationInput() {
        return this._s3Configuration.internalValue;
    }
}
export function timestreamwriteTableMagneticStoreWritePropertiesToTerraform(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 {
        enable_magnetic_store_writes: cdktf.booleanToTerraform(struct.enableMagneticStoreWrites),
        magnetic_store_rejected_data_location: timestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationToTerraform(struct.magneticStoreRejectedDataLocation),
    };
}
export class TimestreamwriteTableMagneticStoreWritePropertiesOutputReference 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._enableMagneticStoreWrites !== undefined) {
            hasAnyValues = true;
            internalValueResult.enableMagneticStoreWrites = this._enableMagneticStoreWrites;
        }
        if (this._magneticStoreRejectedDataLocation?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.magneticStoreRejectedDataLocation = this._magneticStoreRejectedDataLocation?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._enableMagneticStoreWrites = undefined;
            this._magneticStoreRejectedDataLocation.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._enableMagneticStoreWrites = value.enableMagneticStoreWrites;
            this._magneticStoreRejectedDataLocation.internalValue = value.magneticStoreRejectedDataLocation;
        }
    }
    // enable_magnetic_store_writes - computed: false, optional: true, required: false
    _enableMagneticStoreWrites;
    get enableMagneticStoreWrites() {
        return this.getBooleanAttribute('enable_magnetic_store_writes');
    }
    set enableMagneticStoreWrites(value) {
        this._enableMagneticStoreWrites = value;
    }
    resetEnableMagneticStoreWrites() {
        this._enableMagneticStoreWrites = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableMagneticStoreWritesInput() {
        return this._enableMagneticStoreWrites;
    }
    // magnetic_store_rejected_data_location - computed: false, optional: true, required: false
    _magneticStoreRejectedDataLocation = new TimestreamwriteTableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocationOutputReference(this, "magnetic_store_rejected_data_location", true);
    get magneticStoreRejectedDataLocation() {
        return this._magneticStoreRejectedDataLocation;
    }
    putMagneticStoreRejectedDataLocation(value) {
        this._magneticStoreRejectedDataLocation.internalValue = value;
    }
    resetMagneticStoreRejectedDataLocation() {
        this._magneticStoreRejectedDataLocation.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get magneticStoreRejectedDataLocationInput() {
        return this._magneticStoreRejectedDataLocation.internalValue;
    }
}
export function timestreamwriteTableRetentionPropertiesToTerraform(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 {
        magnetic_store_retention_period_in_days: cdktf.numberToTerraform(struct.magneticStoreRetentionPeriodInDays),
        memory_store_retention_period_in_hours: cdktf.numberToTerraform(struct.memoryStoreRetentionPeriodInHours),
    };
}
export class TimestreamwriteTableRetentionPropertiesOutputReference 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._magneticStoreRetentionPeriodInDays !== undefined) {
            hasAnyValues = true;
            internalValueResult.magneticStoreRetentionPeriodInDays = this._magneticStoreRetentionPeriodInDays;
        }
        if (this._memoryStoreRetentionPeriodInHours !== undefined) {
            hasAnyValues = true;
            internalValueResult.memoryStoreRetentionPeriodInHours = this._memoryStoreRetentionPeriodInHours;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._magneticStoreRetentionPeriodInDays = undefined;
            this._memoryStoreRetentionPeriodInHours = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._magneticStoreRetentionPeriodInDays = value.magneticStoreRetentionPeriodInDays;
            this._memoryStoreRetentionPeriodInHours = value.memoryStoreRetentionPeriodInHours;
        }
    }
    // magnetic_store_retention_period_in_days - computed: false, optional: false, required: true
    _magneticStoreRetentionPeriodInDays;
    get magneticStoreRetentionPeriodInDays() {
        return this.getNumberAttribute('magnetic_store_retention_period_in_days');
    }
    set magneticStoreRetentionPeriodInDays(value) {
        this._magneticStoreRetentionPeriodInDays = value;
    }
    // Temporarily expose input value. Use with caution.
    get magneticStoreRetentionPeriodInDaysInput() {
        return this._magneticStoreRetentionPeriodInDays;
    }
    // memory_store_retention_period_in_hours - computed: false, optional: false, required: true
    _memoryStoreRetentionPeriodInHours;
    get memoryStoreRetentionPeriodInHours() {
        return this.getNumberAttribute('memory_store_retention_period_in_hours');
    }
    set memoryStoreRetentionPeriodInHours(value) {
        this._memoryStoreRetentionPeriodInHours = value;
    }
    // Temporarily expose input value. Use with caution.
    get memoryStoreRetentionPeriodInHoursInput() {
        return this._memoryStoreRetentionPeriodInHours;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/timestreamwrite_table aws_timestreamwrite_table}
*/
export class TimestreamwriteTable extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_timestreamwrite_table";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/timestreamwrite_table aws_timestreamwrite_table} 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 TimestreamwriteTableConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_timestreamwrite_table',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._databaseName = config.databaseName;
        this._tableName = config.tableName;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._magneticStoreWriteProperties.internalValue = config.magneticStoreWriteProperties;
        this._retentionProperties.internalValue = config.retentionProperties;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // table_name - computed: false, optional: false, required: true
    _tableName;
    get tableName() {
        return this.getStringAttribute('table_name');
    }
    set tableName(value) {
        this._tableName = value;
    }
    // Temporarily expose input value. Use with caution.
    get tableNameInput() {
        return this._tableName;
    }
    // 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;
    }
    // magnetic_store_write_properties - computed: false, optional: true, required: false
    _magneticStoreWriteProperties = new TimestreamwriteTableMagneticStoreWritePropertiesOutputReference(this, "magnetic_store_write_properties", true);
    get magneticStoreWriteProperties() {
        return this._magneticStoreWriteProperties;
    }
    putMagneticStoreWriteProperties(value) {
        this._magneticStoreWriteProperties.internalValue = value;
    }
    resetMagneticStoreWriteProperties() {
        this._magneticStoreWriteProperties.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get magneticStoreWritePropertiesInput() {
        return this._magneticStoreWriteProperties.internalValue;
    }
    // retention_properties - computed: false, optional: true, required: false
    _retentionProperties = new TimestreamwriteTableRetentionPropertiesOutputReference(this, "retention_properties", true);
    get retentionProperties() {
        return this._retentionProperties;
    }
    putRetentionProperties(value) {
        this._retentionProperties.internalValue = value;
    }
    resetRetentionProperties() {
        this._retentionProperties.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get retentionPropertiesInput() {
        return this._retentionProperties.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            database_name: cdktf.stringToTerraform(this._databaseName),
            table_name: cdktf.stringToTerraform(this._tableName),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            magnetic_store_write_properties: timestreamwriteTableMagneticStoreWritePropertiesToTerraform(this._magneticStoreWriteProperties.internalValue),
            retention_properties: timestreamwriteTableRetentionPropertiesToTerraform(this._retentionProperties.internalValue),
        };
    }
}
//# sourceMappingURL=timestreamwrite-table.js.map