// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function flowLogDestinationOptionsToTerraform(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 {
        file_format: cdktf.stringToTerraform(struct.fileFormat),
        hive_compatible_partitions: cdktf.booleanToTerraform(struct.hiveCompatiblePartitions),
        per_hour_partition: cdktf.booleanToTerraform(struct.perHourPartition),
    };
}
export class FlowLogDestinationOptionsOutputReference 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._fileFormat !== undefined) {
            hasAnyValues = true;
            internalValueResult.fileFormat = this._fileFormat;
        }
        if (this._hiveCompatiblePartitions !== undefined) {
            hasAnyValues = true;
            internalValueResult.hiveCompatiblePartitions = this._hiveCompatiblePartitions;
        }
        if (this._perHourPartition !== undefined) {
            hasAnyValues = true;
            internalValueResult.perHourPartition = this._perHourPartition;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._fileFormat = undefined;
            this._hiveCompatiblePartitions = undefined;
            this._perHourPartition = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._fileFormat = value.fileFormat;
            this._hiveCompatiblePartitions = value.hiveCompatiblePartitions;
            this._perHourPartition = value.perHourPartition;
        }
    }
    // file_format - computed: false, optional: true, required: false
    _fileFormat;
    get fileFormat() {
        return this.getStringAttribute('file_format');
    }
    set fileFormat(value) {
        this._fileFormat = value;
    }
    resetFileFormat() {
        this._fileFormat = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get fileFormatInput() {
        return this._fileFormat;
    }
    // hive_compatible_partitions - computed: false, optional: true, required: false
    _hiveCompatiblePartitions;
    get hiveCompatiblePartitions() {
        return this.getBooleanAttribute('hive_compatible_partitions');
    }
    set hiveCompatiblePartitions(value) {
        this._hiveCompatiblePartitions = value;
    }
    resetHiveCompatiblePartitions() {
        this._hiveCompatiblePartitions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get hiveCompatiblePartitionsInput() {
        return this._hiveCompatiblePartitions;
    }
    // per_hour_partition - computed: false, optional: true, required: false
    _perHourPartition;
    get perHourPartition() {
        return this.getBooleanAttribute('per_hour_partition');
    }
    set perHourPartition(value) {
        this._perHourPartition = value;
    }
    resetPerHourPartition() {
        this._perHourPartition = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get perHourPartitionInput() {
        return this._perHourPartition;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/flow_log aws_flow_log}
*/
export class FlowLog extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_flow_log";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/flow_log aws_flow_log} 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 FlowLogConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_flow_log',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._eniId = config.eniId;
        this._iamRoleArn = config.iamRoleArn;
        this._logDestination = config.logDestination;
        this._logDestinationType = config.logDestinationType;
        this._logFormat = config.logFormat;
        this._logGroupName = config.logGroupName;
        this._maxAggregationInterval = config.maxAggregationInterval;
        this._subnetId = config.subnetId;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._trafficType = config.trafficType;
        this._vpcId = config.vpcId;
        this._destinationOptions.internalValue = config.destinationOptions;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // eni_id - computed: false, optional: true, required: false
    _eniId;
    get eniId() {
        return this.getStringAttribute('eni_id');
    }
    set eniId(value) {
        this._eniId = value;
    }
    resetEniId() {
        this._eniId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get eniIdInput() {
        return this._eniId;
    }
    // iam_role_arn - computed: false, optional: true, required: false
    _iamRoleArn;
    get iamRoleArn() {
        return this.getStringAttribute('iam_role_arn');
    }
    set iamRoleArn(value) {
        this._iamRoleArn = value;
    }
    resetIamRoleArn() {
        this._iamRoleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get iamRoleArnInput() {
        return this._iamRoleArn;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // log_destination - computed: true, optional: true, required: false
    _logDestination;
    get logDestination() {
        return this.getStringAttribute('log_destination');
    }
    set logDestination(value) {
        this._logDestination = value;
    }
    resetLogDestination() {
        this._logDestination = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logDestinationInput() {
        return this._logDestination;
    }
    // log_destination_type - computed: false, optional: true, required: false
    _logDestinationType;
    get logDestinationType() {
        return this.getStringAttribute('log_destination_type');
    }
    set logDestinationType(value) {
        this._logDestinationType = value;
    }
    resetLogDestinationType() {
        this._logDestinationType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logDestinationTypeInput() {
        return this._logDestinationType;
    }
    // log_format - computed: true, optional: true, required: false
    _logFormat;
    get logFormat() {
        return this.getStringAttribute('log_format');
    }
    set logFormat(value) {
        this._logFormat = value;
    }
    resetLogFormat() {
        this._logFormat = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logFormatInput() {
        return this._logFormat;
    }
    // log_group_name - computed: true, optional: true, required: false
    _logGroupName;
    get logGroupName() {
        return this.getStringAttribute('log_group_name');
    }
    set logGroupName(value) {
        this._logGroupName = value;
    }
    resetLogGroupName() {
        this._logGroupName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logGroupNameInput() {
        return this._logGroupName;
    }
    // max_aggregation_interval - computed: false, optional: true, required: false
    _maxAggregationInterval;
    get maxAggregationInterval() {
        return this.getNumberAttribute('max_aggregation_interval');
    }
    set maxAggregationInterval(value) {
        this._maxAggregationInterval = value;
    }
    resetMaxAggregationInterval() {
        this._maxAggregationInterval = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maxAggregationIntervalInput() {
        return this._maxAggregationInterval;
    }
    // subnet_id - computed: false, optional: true, required: false
    _subnetId;
    get subnetId() {
        return this.getStringAttribute('subnet_id');
    }
    set subnetId(value) {
        this._subnetId = value;
    }
    resetSubnetId() {
        this._subnetId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get subnetIdInput() {
        return this._subnetId;
    }
    // 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;
    }
    // traffic_type - computed: false, optional: false, required: true
    _trafficType;
    get trafficType() {
        return this.getStringAttribute('traffic_type');
    }
    set trafficType(value) {
        this._trafficType = value;
    }
    // Temporarily expose input value. Use with caution.
    get trafficTypeInput() {
        return this._trafficType;
    }
    // vpc_id - computed: false, optional: true, required: false
    _vpcId;
    get vpcId() {
        return this.getStringAttribute('vpc_id');
    }
    set vpcId(value) {
        this._vpcId = value;
    }
    resetVpcId() {
        this._vpcId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get vpcIdInput() {
        return this._vpcId;
    }
    // destination_options - computed: false, optional: true, required: false
    _destinationOptions = new FlowLogDestinationOptionsOutputReference(this, "destination_options", true);
    get destinationOptions() {
        return this._destinationOptions;
    }
    putDestinationOptions(value) {
        this._destinationOptions.internalValue = value;
    }
    resetDestinationOptions() {
        this._destinationOptions.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get destinationOptionsInput() {
        return this._destinationOptions.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            eni_id: cdktf.stringToTerraform(this._eniId),
            iam_role_arn: cdktf.stringToTerraform(this._iamRoleArn),
            log_destination: cdktf.stringToTerraform(this._logDestination),
            log_destination_type: cdktf.stringToTerraform(this._logDestinationType),
            log_format: cdktf.stringToTerraform(this._logFormat),
            log_group_name: cdktf.stringToTerraform(this._logGroupName),
            max_aggregation_interval: cdktf.numberToTerraform(this._maxAggregationInterval),
            subnet_id: cdktf.stringToTerraform(this._subnetId),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            traffic_type: cdktf.stringToTerraform(this._trafficType),
            vpc_id: cdktf.stringToTerraform(this._vpcId),
            destination_options: flowLogDestinationOptionsToTerraform(this._destinationOptions.internalValue),
        };
    }
}
//# sourceMappingURL=flow-log.js.map