// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function sesEventDestinationCloudwatchDestinationToTerraform(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 {
        default_value: cdktf.stringToTerraform(struct.defaultValue),
        dimension_name: cdktf.stringToTerraform(struct.dimensionName),
        value_source: cdktf.stringToTerraform(struct.valueSource),
    };
}
export function sesEventDestinationKinesisDestinationToTerraform(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 {
        role_arn: cdktf.stringToTerraform(struct.roleArn),
        stream_arn: cdktf.stringToTerraform(struct.streamArn),
    };
}
export class SesEventDestinationKinesisDestinationOutputReference 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._roleArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.roleArn = this._roleArn;
        }
        if (this._streamArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.streamArn = this._streamArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._roleArn = undefined;
            this._streamArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._roleArn = value.roleArn;
            this._streamArn = value.streamArn;
        }
    }
    // role_arn - computed: false, optional: false, required: true
    _roleArn;
    get roleArn() {
        return this.getStringAttribute('role_arn');
    }
    set roleArn(value) {
        this._roleArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get roleArnInput() {
        return this._roleArn;
    }
    // stream_arn - computed: false, optional: false, required: true
    _streamArn;
    get streamArn() {
        return this.getStringAttribute('stream_arn');
    }
    set streamArn(value) {
        this._streamArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get streamArnInput() {
        return this._streamArn;
    }
}
export function sesEventDestinationSnsDestinationToTerraform(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 {
        topic_arn: cdktf.stringToTerraform(struct.topicArn),
    };
}
export class SesEventDestinationSnsDestinationOutputReference 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._topicArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.topicArn = this._topicArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._topicArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._topicArn = value.topicArn;
        }
    }
    // topic_arn - computed: false, optional: false, required: true
    _topicArn;
    get topicArn() {
        return this.getStringAttribute('topic_arn');
    }
    set topicArn(value) {
        this._topicArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get topicArnInput() {
        return this._topicArn;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/ses_event_destination aws_ses_event_destination}
*/
export class SesEventDestination extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_ses_event_destination";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ses_event_destination aws_ses_event_destination} 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 SesEventDestinationConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_ses_event_destination',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._configurationSetName = config.configurationSetName;
        this._enabled = config.enabled;
        this._matchingTypes = config.matchingTypes;
        this._name = config.name;
        this._cloudwatchDestination = config.cloudwatchDestination;
        this._kinesisDestination.internalValue = config.kinesisDestination;
        this._snsDestination.internalValue = config.snsDestination;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // configuration_set_name - computed: false, optional: false, required: true
    _configurationSetName;
    get configurationSetName() {
        return this.getStringAttribute('configuration_set_name');
    }
    set configurationSetName(value) {
        this._configurationSetName = value;
    }
    // Temporarily expose input value. Use with caution.
    get configurationSetNameInput() {
        return this._configurationSetName;
    }
    // enabled - computed: false, optional: true, required: false
    _enabled;
    get enabled() {
        return this.getBooleanAttribute('enabled');
    }
    set enabled(value) {
        this._enabled = value;
    }
    resetEnabled() {
        this._enabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enabledInput() {
        return this._enabled;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // matching_types - computed: false, optional: false, required: true
    _matchingTypes;
    get matchingTypes() {
        return cdktf.Fn.tolist(this.getListAttribute('matching_types'));
    }
    set matchingTypes(value) {
        this._matchingTypes = value;
    }
    // Temporarily expose input value. Use with caution.
    get matchingTypesInput() {
        return this._matchingTypes;
    }
    // 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;
    }
    // cloudwatch_destination - computed: false, optional: true, required: false
    _cloudwatchDestination;
    get cloudwatchDestination() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('cloudwatch_destination')));
    }
    set cloudwatchDestination(value) {
        this._cloudwatchDestination = value;
    }
    resetCloudwatchDestination() {
        this._cloudwatchDestination = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cloudwatchDestinationInput() {
        return this._cloudwatchDestination;
    }
    // kinesis_destination - computed: false, optional: true, required: false
    _kinesisDestination = new SesEventDestinationKinesisDestinationOutputReference(this, "kinesis_destination", true);
    get kinesisDestination() {
        return this._kinesisDestination;
    }
    putKinesisDestination(value) {
        this._kinesisDestination.internalValue = value;
    }
    resetKinesisDestination() {
        this._kinesisDestination.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get kinesisDestinationInput() {
        return this._kinesisDestination.internalValue;
    }
    // sns_destination - computed: false, optional: true, required: false
    _snsDestination = new SesEventDestinationSnsDestinationOutputReference(this, "sns_destination", true);
    get snsDestination() {
        return this._snsDestination;
    }
    putSnsDestination(value) {
        this._snsDestination.internalValue = value;
    }
    resetSnsDestination() {
        this._snsDestination.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get snsDestinationInput() {
        return this._snsDestination.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            configuration_set_name: cdktf.stringToTerraform(this._configurationSetName),
            enabled: cdktf.booleanToTerraform(this._enabled),
            matching_types: cdktf.listMapper(cdktf.stringToTerraform)(this._matchingTypes),
            name: cdktf.stringToTerraform(this._name),
            cloudwatch_destination: cdktf.listMapper(sesEventDestinationCloudwatchDestinationToTerraform)(this._cloudwatchDestination),
            kinesis_destination: sesEventDestinationKinesisDestinationToTerraform(this._kinesisDestination.internalValue),
            sns_destination: sesEventDestinationSnsDestinationToTerraform(this._snsDestination.internalValue),
        };
    }
}
//# sourceMappingURL=ses-event-destination.js.map