// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cloudtrailAdvancedEventSelectorFieldSelectorToTerraform(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 {
        ends_with: cdktf.listMapper(cdktf.stringToTerraform)(struct.endsWith),
        equals: cdktf.listMapper(cdktf.stringToTerraform)(struct.equalTo),
        field: cdktf.stringToTerraform(struct.field),
        not_ends_with: cdktf.listMapper(cdktf.stringToTerraform)(struct.notEndsWith),
        not_equals: cdktf.listMapper(cdktf.stringToTerraform)(struct.notEquals),
        not_starts_with: cdktf.listMapper(cdktf.stringToTerraform)(struct.notStartsWith),
        starts_with: cdktf.listMapper(cdktf.stringToTerraform)(struct.startsWith),
    };
}
export function cloudtrailAdvancedEventSelectorToTerraform(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 {
        name: cdktf.stringToTerraform(struct.name),
        field_selector: cdktf.listMapper(cloudtrailAdvancedEventSelectorFieldSelectorToTerraform)(struct.fieldSelector),
    };
}
export function cloudtrailEventSelectorDataResourceToTerraform(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 {
        type: cdktf.stringToTerraform(struct.type),
        values: cdktf.listMapper(cdktf.stringToTerraform)(struct.values),
    };
}
export function cloudtrailEventSelectorToTerraform(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 {
        exclude_management_event_sources: cdktf.listMapper(cdktf.stringToTerraform)(struct.excludeManagementEventSources),
        include_management_events: cdktf.booleanToTerraform(struct.includeManagementEvents),
        read_write_type: cdktf.stringToTerraform(struct.readWriteType),
        data_resource: cdktf.listMapper(cloudtrailEventSelectorDataResourceToTerraform)(struct.dataResource),
    };
}
export function cloudtrailInsightSelectorToTerraform(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 {
        insight_type: cdktf.stringToTerraform(struct.insightType),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudtrail aws_cloudtrail}
*/
export class Cloudtrail extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cloudtrail";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudtrail aws_cloudtrail} 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 CloudtrailConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cloudtrail',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._cloudWatchLogsGroupArn = config.cloudWatchLogsGroupArn;
        this._cloudWatchLogsRoleArn = config.cloudWatchLogsRoleArn;
        this._enableLogFileValidation = config.enableLogFileValidation;
        this._enableLogging = config.enableLogging;
        this._includeGlobalServiceEvents = config.includeGlobalServiceEvents;
        this._isMultiRegionTrail = config.isMultiRegionTrail;
        this._isOrganizationTrail = config.isOrganizationTrail;
        this._kmsKeyId = config.kmsKeyId;
        this._name = config.name;
        this._s3BucketName = config.s3BucketName;
        this._s3KeyPrefix = config.s3KeyPrefix;
        this._snsTopicName = config.snsTopicName;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._advancedEventSelector = config.advancedEventSelector;
        this._eventSelector = config.eventSelector;
        this._insightSelector = config.insightSelector;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // cloud_watch_logs_group_arn - computed: false, optional: true, required: false
    _cloudWatchLogsGroupArn;
    get cloudWatchLogsGroupArn() {
        return this.getStringAttribute('cloud_watch_logs_group_arn');
    }
    set cloudWatchLogsGroupArn(value) {
        this._cloudWatchLogsGroupArn = value;
    }
    resetCloudWatchLogsGroupArn() {
        this._cloudWatchLogsGroupArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cloudWatchLogsGroupArnInput() {
        return this._cloudWatchLogsGroupArn;
    }
    // cloud_watch_logs_role_arn - computed: false, optional: true, required: false
    _cloudWatchLogsRoleArn;
    get cloudWatchLogsRoleArn() {
        return this.getStringAttribute('cloud_watch_logs_role_arn');
    }
    set cloudWatchLogsRoleArn(value) {
        this._cloudWatchLogsRoleArn = value;
    }
    resetCloudWatchLogsRoleArn() {
        this._cloudWatchLogsRoleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cloudWatchLogsRoleArnInput() {
        return this._cloudWatchLogsRoleArn;
    }
    // enable_log_file_validation - computed: false, optional: true, required: false
    _enableLogFileValidation;
    get enableLogFileValidation() {
        return this.getBooleanAttribute('enable_log_file_validation');
    }
    set enableLogFileValidation(value) {
        this._enableLogFileValidation = value;
    }
    resetEnableLogFileValidation() {
        this._enableLogFileValidation = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableLogFileValidationInput() {
        return this._enableLogFileValidation;
    }
    // enable_logging - computed: false, optional: true, required: false
    _enableLogging;
    get enableLogging() {
        return this.getBooleanAttribute('enable_logging');
    }
    set enableLogging(value) {
        this._enableLogging = value;
    }
    resetEnableLogging() {
        this._enableLogging = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableLoggingInput() {
        return this._enableLogging;
    }
    // home_region - computed: true, optional: false, required: false
    get homeRegion() {
        return this.getStringAttribute('home_region');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // include_global_service_events - computed: false, optional: true, required: false
    _includeGlobalServiceEvents;
    get includeGlobalServiceEvents() {
        return this.getBooleanAttribute('include_global_service_events');
    }
    set includeGlobalServiceEvents(value) {
        this._includeGlobalServiceEvents = value;
    }
    resetIncludeGlobalServiceEvents() {
        this._includeGlobalServiceEvents = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get includeGlobalServiceEventsInput() {
        return this._includeGlobalServiceEvents;
    }
    // is_multi_region_trail - computed: false, optional: true, required: false
    _isMultiRegionTrail;
    get isMultiRegionTrail() {
        return this.getBooleanAttribute('is_multi_region_trail');
    }
    set isMultiRegionTrail(value) {
        this._isMultiRegionTrail = value;
    }
    resetIsMultiRegionTrail() {
        this._isMultiRegionTrail = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get isMultiRegionTrailInput() {
        return this._isMultiRegionTrail;
    }
    // is_organization_trail - computed: false, optional: true, required: false
    _isOrganizationTrail;
    get isOrganizationTrail() {
        return this.getBooleanAttribute('is_organization_trail');
    }
    set isOrganizationTrail(value) {
        this._isOrganizationTrail = value;
    }
    resetIsOrganizationTrail() {
        this._isOrganizationTrail = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get isOrganizationTrailInput() {
        return this._isOrganizationTrail;
    }
    // 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;
    }
    // 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;
    }
    // s3_bucket_name - computed: false, optional: false, required: true
    _s3BucketName;
    get s3BucketName() {
        return this.getStringAttribute('s3_bucket_name');
    }
    set s3BucketName(value) {
        this._s3BucketName = value;
    }
    // Temporarily expose input value. Use with caution.
    get s3BucketNameInput() {
        return this._s3BucketName;
    }
    // s3_key_prefix - computed: false, optional: true, required: false
    _s3KeyPrefix;
    get s3KeyPrefix() {
        return this.getStringAttribute('s3_key_prefix');
    }
    set s3KeyPrefix(value) {
        this._s3KeyPrefix = value;
    }
    resetS3KeyPrefix() {
        this._s3KeyPrefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3KeyPrefixInput() {
        return this._s3KeyPrefix;
    }
    // sns_topic_name - computed: false, optional: true, required: false
    _snsTopicName;
    get snsTopicName() {
        return this.getStringAttribute('sns_topic_name');
    }
    set snsTopicName(value) {
        this._snsTopicName = value;
    }
    resetSnsTopicName() {
        this._snsTopicName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get snsTopicNameInput() {
        return this._snsTopicName;
    }
    // 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;
    }
    // advanced_event_selector - computed: false, optional: true, required: false
    _advancedEventSelector;
    get advancedEventSelector() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('advanced_event_selector');
    }
    set advancedEventSelector(value) {
        this._advancedEventSelector = value;
    }
    resetAdvancedEventSelector() {
        this._advancedEventSelector = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get advancedEventSelectorInput() {
        return this._advancedEventSelector;
    }
    // event_selector - computed: false, optional: true, required: false
    _eventSelector;
    get eventSelector() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('event_selector');
    }
    set eventSelector(value) {
        this._eventSelector = value;
    }
    resetEventSelector() {
        this._eventSelector = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get eventSelectorInput() {
        return this._eventSelector;
    }
    // insight_selector - computed: false, optional: true, required: false
    _insightSelector;
    get insightSelector() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('insight_selector');
    }
    set insightSelector(value) {
        this._insightSelector = value;
    }
    resetInsightSelector() {
        this._insightSelector = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get insightSelectorInput() {
        return this._insightSelector;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            cloud_watch_logs_group_arn: cdktf.stringToTerraform(this._cloudWatchLogsGroupArn),
            cloud_watch_logs_role_arn: cdktf.stringToTerraform(this._cloudWatchLogsRoleArn),
            enable_log_file_validation: cdktf.booleanToTerraform(this._enableLogFileValidation),
            enable_logging: cdktf.booleanToTerraform(this._enableLogging),
            include_global_service_events: cdktf.booleanToTerraform(this._includeGlobalServiceEvents),
            is_multi_region_trail: cdktf.booleanToTerraform(this._isMultiRegionTrail),
            is_organization_trail: cdktf.booleanToTerraform(this._isOrganizationTrail),
            kms_key_id: cdktf.stringToTerraform(this._kmsKeyId),
            name: cdktf.stringToTerraform(this._name),
            s3_bucket_name: cdktf.stringToTerraform(this._s3BucketName),
            s3_key_prefix: cdktf.stringToTerraform(this._s3KeyPrefix),
            sns_topic_name: cdktf.stringToTerraform(this._snsTopicName),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            advanced_event_selector: cdktf.listMapper(cloudtrailAdvancedEventSelectorToTerraform)(this._advancedEventSelector),
            event_selector: cdktf.listMapper(cloudtrailEventSelectorToTerraform)(this._eventSelector),
            insight_selector: cdktf.listMapper(cloudtrailInsightSelectorToTerraform)(this._insightSelector),
        };
    }
}
//# sourceMappingURL=cloudtrail.js.map