// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cloudwatchMetricAlarmMetricQueryMetricToTerraform(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 {
        dimensions: cdktf.hashMapper(cdktf.stringToTerraform)(struct.dimensions),
        metric_name: cdktf.stringToTerraform(struct.metricName),
        namespace: cdktf.stringToTerraform(struct.namespace),
        period: cdktf.numberToTerraform(struct.period),
        stat: cdktf.stringToTerraform(struct.stat),
        unit: cdktf.stringToTerraform(struct.unit),
    };
}
export class CloudwatchMetricAlarmMetricQueryMetricOutputReference 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._dimensions !== undefined) {
            hasAnyValues = true;
            internalValueResult.dimensions = this._dimensions;
        }
        if (this._metricName !== undefined) {
            hasAnyValues = true;
            internalValueResult.metricName = this._metricName;
        }
        if (this._namespace !== undefined) {
            hasAnyValues = true;
            internalValueResult.namespace = this._namespace;
        }
        if (this._period !== undefined) {
            hasAnyValues = true;
            internalValueResult.period = this._period;
        }
        if (this._stat !== undefined) {
            hasAnyValues = true;
            internalValueResult.stat = this._stat;
        }
        if (this._unit !== undefined) {
            hasAnyValues = true;
            internalValueResult.unit = this._unit;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._dimensions = undefined;
            this._metricName = undefined;
            this._namespace = undefined;
            this._period = undefined;
            this._stat = undefined;
            this._unit = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._dimensions = value.dimensions;
            this._metricName = value.metricName;
            this._namespace = value.namespace;
            this._period = value.period;
            this._stat = value.stat;
            this._unit = value.unit;
        }
    }
    // dimensions - computed: false, optional: true, required: false
    _dimensions;
    get dimensions() {
        return this.getStringMapAttribute('dimensions');
    }
    set dimensions(value) {
        this._dimensions = value;
    }
    resetDimensions() {
        this._dimensions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dimensionsInput() {
        return this._dimensions;
    }
    // metric_name - computed: false, optional: false, required: true
    _metricName;
    get metricName() {
        return this.getStringAttribute('metric_name');
    }
    set metricName(value) {
        this._metricName = value;
    }
    // Temporarily expose input value. Use with caution.
    get metricNameInput() {
        return this._metricName;
    }
    // namespace - computed: false, optional: true, required: false
    _namespace;
    get namespace() {
        return this.getStringAttribute('namespace');
    }
    set namespace(value) {
        this._namespace = value;
    }
    resetNamespace() {
        this._namespace = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get namespaceInput() {
        return this._namespace;
    }
    // period - computed: false, optional: false, required: true
    _period;
    get period() {
        return this.getNumberAttribute('period');
    }
    set period(value) {
        this._period = value;
    }
    // Temporarily expose input value. Use with caution.
    get periodInput() {
        return this._period;
    }
    // stat - computed: false, optional: false, required: true
    _stat;
    get stat() {
        return this.getStringAttribute('stat');
    }
    set stat(value) {
        this._stat = value;
    }
    // Temporarily expose input value. Use with caution.
    get statInput() {
        return this._stat;
    }
    // unit - computed: false, optional: true, required: false
    _unit;
    get unit() {
        return this.getStringAttribute('unit');
    }
    set unit(value) {
        this._unit = value;
    }
    resetUnit() {
        this._unit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get unitInput() {
        return this._unit;
    }
}
export function cloudwatchMetricAlarmMetricQueryToTerraform(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 {
        account_id: cdktf.stringToTerraform(struct.accountId),
        expression: cdktf.stringToTerraform(struct.expression),
        id: cdktf.stringToTerraform(struct.id),
        label: cdktf.stringToTerraform(struct.label),
        return_data: cdktf.booleanToTerraform(struct.returnData),
        metric: cloudwatchMetricAlarmMetricQueryMetricToTerraform(struct.metric),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudwatch_metric_alarm aws_cloudwatch_metric_alarm}
*/
export class CloudwatchMetricAlarm extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cloudwatch_metric_alarm";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudwatch_metric_alarm aws_cloudwatch_metric_alarm} 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 CloudwatchMetricAlarmConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cloudwatch_metric_alarm',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._actionsEnabled = config.actionsEnabled;
        this._alarmActions = config.alarmActions;
        this._alarmDescription = config.alarmDescription;
        this._alarmName = config.alarmName;
        this._comparisonOperator = config.comparisonOperator;
        this._datapointsToAlarm = config.datapointsToAlarm;
        this._dimensions = config.dimensions;
        this._evaluateLowSampleCountPercentiles = config.evaluateLowSampleCountPercentiles;
        this._evaluationPeriods = config.evaluationPeriods;
        this._extendedStatistic = config.extendedStatistic;
        this._insufficientDataActions = config.insufficientDataActions;
        this._metricName = config.metricName;
        this._namespace = config.namespace;
        this._okActions = config.okActions;
        this._period = config.period;
        this._statistic = config.statistic;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._threshold = config.threshold;
        this._thresholdMetricId = config.thresholdMetricId;
        this._treatMissingData = config.treatMissingData;
        this._unit = config.unit;
        this._metricQuery = config.metricQuery;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // actions_enabled - computed: false, optional: true, required: false
    _actionsEnabled;
    get actionsEnabled() {
        return this.getBooleanAttribute('actions_enabled');
    }
    set actionsEnabled(value) {
        this._actionsEnabled = value;
    }
    resetActionsEnabled() {
        this._actionsEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get actionsEnabledInput() {
        return this._actionsEnabled;
    }
    // alarm_actions - computed: false, optional: true, required: false
    _alarmActions;
    get alarmActions() {
        return cdktf.Fn.tolist(this.getListAttribute('alarm_actions'));
    }
    set alarmActions(value) {
        this._alarmActions = value;
    }
    resetAlarmActions() {
        this._alarmActions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get alarmActionsInput() {
        return this._alarmActions;
    }
    // alarm_description - computed: false, optional: true, required: false
    _alarmDescription;
    get alarmDescription() {
        return this.getStringAttribute('alarm_description');
    }
    set alarmDescription(value) {
        this._alarmDescription = value;
    }
    resetAlarmDescription() {
        this._alarmDescription = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get alarmDescriptionInput() {
        return this._alarmDescription;
    }
    // alarm_name - computed: false, optional: false, required: true
    _alarmName;
    get alarmName() {
        return this.getStringAttribute('alarm_name');
    }
    set alarmName(value) {
        this._alarmName = value;
    }
    // Temporarily expose input value. Use with caution.
    get alarmNameInput() {
        return this._alarmName;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // comparison_operator - computed: false, optional: false, required: true
    _comparisonOperator;
    get comparisonOperator() {
        return this.getStringAttribute('comparison_operator');
    }
    set comparisonOperator(value) {
        this._comparisonOperator = value;
    }
    // Temporarily expose input value. Use with caution.
    get comparisonOperatorInput() {
        return this._comparisonOperator;
    }
    // datapoints_to_alarm - computed: false, optional: true, required: false
    _datapointsToAlarm;
    get datapointsToAlarm() {
        return this.getNumberAttribute('datapoints_to_alarm');
    }
    set datapointsToAlarm(value) {
        this._datapointsToAlarm = value;
    }
    resetDatapointsToAlarm() {
        this._datapointsToAlarm = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get datapointsToAlarmInput() {
        return this._datapointsToAlarm;
    }
    // dimensions - computed: false, optional: true, required: false
    _dimensions;
    get dimensions() {
        return this.getStringMapAttribute('dimensions');
    }
    set dimensions(value) {
        this._dimensions = value;
    }
    resetDimensions() {
        this._dimensions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dimensionsInput() {
        return this._dimensions;
    }
    // evaluate_low_sample_count_percentiles - computed: true, optional: true, required: false
    _evaluateLowSampleCountPercentiles;
    get evaluateLowSampleCountPercentiles() {
        return this.getStringAttribute('evaluate_low_sample_count_percentiles');
    }
    set evaluateLowSampleCountPercentiles(value) {
        this._evaluateLowSampleCountPercentiles = value;
    }
    resetEvaluateLowSampleCountPercentiles() {
        this._evaluateLowSampleCountPercentiles = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get evaluateLowSampleCountPercentilesInput() {
        return this._evaluateLowSampleCountPercentiles;
    }
    // evaluation_periods - computed: false, optional: false, required: true
    _evaluationPeriods;
    get evaluationPeriods() {
        return this.getNumberAttribute('evaluation_periods');
    }
    set evaluationPeriods(value) {
        this._evaluationPeriods = value;
    }
    // Temporarily expose input value. Use with caution.
    get evaluationPeriodsInput() {
        return this._evaluationPeriods;
    }
    // extended_statistic - computed: false, optional: true, required: false
    _extendedStatistic;
    get extendedStatistic() {
        return this.getStringAttribute('extended_statistic');
    }
    set extendedStatistic(value) {
        this._extendedStatistic = value;
    }
    resetExtendedStatistic() {
        this._extendedStatistic = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get extendedStatisticInput() {
        return this._extendedStatistic;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // insufficient_data_actions - computed: false, optional: true, required: false
    _insufficientDataActions;
    get insufficientDataActions() {
        return cdktf.Fn.tolist(this.getListAttribute('insufficient_data_actions'));
    }
    set insufficientDataActions(value) {
        this._insufficientDataActions = value;
    }
    resetInsufficientDataActions() {
        this._insufficientDataActions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get insufficientDataActionsInput() {
        return this._insufficientDataActions;
    }
    // metric_name - computed: false, optional: true, required: false
    _metricName;
    get metricName() {
        return this.getStringAttribute('metric_name');
    }
    set metricName(value) {
        this._metricName = value;
    }
    resetMetricName() {
        this._metricName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get metricNameInput() {
        return this._metricName;
    }
    // namespace - computed: false, optional: true, required: false
    _namespace;
    get namespace() {
        return this.getStringAttribute('namespace');
    }
    set namespace(value) {
        this._namespace = value;
    }
    resetNamespace() {
        this._namespace = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get namespaceInput() {
        return this._namespace;
    }
    // ok_actions - computed: false, optional: true, required: false
    _okActions;
    get okActions() {
        return cdktf.Fn.tolist(this.getListAttribute('ok_actions'));
    }
    set okActions(value) {
        this._okActions = value;
    }
    resetOkActions() {
        this._okActions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get okActionsInput() {
        return this._okActions;
    }
    // period - computed: false, optional: true, required: false
    _period;
    get period() {
        return this.getNumberAttribute('period');
    }
    set period(value) {
        this._period = value;
    }
    resetPeriod() {
        this._period = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get periodInput() {
        return this._period;
    }
    // statistic - computed: false, optional: true, required: false
    _statistic;
    get statistic() {
        return this.getStringAttribute('statistic');
    }
    set statistic(value) {
        this._statistic = value;
    }
    resetStatistic() {
        this._statistic = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statisticInput() {
        return this._statistic;
    }
    // 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;
    }
    // threshold - computed: false, optional: true, required: false
    _threshold;
    get threshold() {
        return this.getNumberAttribute('threshold');
    }
    set threshold(value) {
        this._threshold = value;
    }
    resetThreshold() {
        this._threshold = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get thresholdInput() {
        return this._threshold;
    }
    // threshold_metric_id - computed: false, optional: true, required: false
    _thresholdMetricId;
    get thresholdMetricId() {
        return this.getStringAttribute('threshold_metric_id');
    }
    set thresholdMetricId(value) {
        this._thresholdMetricId = value;
    }
    resetThresholdMetricId() {
        this._thresholdMetricId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get thresholdMetricIdInput() {
        return this._thresholdMetricId;
    }
    // treat_missing_data - computed: false, optional: true, required: false
    _treatMissingData;
    get treatMissingData() {
        return this.getStringAttribute('treat_missing_data');
    }
    set treatMissingData(value) {
        this._treatMissingData = value;
    }
    resetTreatMissingData() {
        this._treatMissingData = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get treatMissingDataInput() {
        return this._treatMissingData;
    }
    // unit - computed: false, optional: true, required: false
    _unit;
    get unit() {
        return this.getStringAttribute('unit');
    }
    set unit(value) {
        this._unit = value;
    }
    resetUnit() {
        this._unit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get unitInput() {
        return this._unit;
    }
    // metric_query - computed: false, optional: true, required: false
    _metricQuery;
    get metricQuery() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('metric_query')));
    }
    set metricQuery(value) {
        this._metricQuery = value;
    }
    resetMetricQuery() {
        this._metricQuery = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get metricQueryInput() {
        return this._metricQuery;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            actions_enabled: cdktf.booleanToTerraform(this._actionsEnabled),
            alarm_actions: cdktf.listMapper(cdktf.stringToTerraform)(this._alarmActions),
            alarm_description: cdktf.stringToTerraform(this._alarmDescription),
            alarm_name: cdktf.stringToTerraform(this._alarmName),
            comparison_operator: cdktf.stringToTerraform(this._comparisonOperator),
            datapoints_to_alarm: cdktf.numberToTerraform(this._datapointsToAlarm),
            dimensions: cdktf.hashMapper(cdktf.stringToTerraform)(this._dimensions),
            evaluate_low_sample_count_percentiles: cdktf.stringToTerraform(this._evaluateLowSampleCountPercentiles),
            evaluation_periods: cdktf.numberToTerraform(this._evaluationPeriods),
            extended_statistic: cdktf.stringToTerraform(this._extendedStatistic),
            insufficient_data_actions: cdktf.listMapper(cdktf.stringToTerraform)(this._insufficientDataActions),
            metric_name: cdktf.stringToTerraform(this._metricName),
            namespace: cdktf.stringToTerraform(this._namespace),
            ok_actions: cdktf.listMapper(cdktf.stringToTerraform)(this._okActions),
            period: cdktf.numberToTerraform(this._period),
            statistic: cdktf.stringToTerraform(this._statistic),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            threshold: cdktf.numberToTerraform(this._threshold),
            threshold_metric_id: cdktf.stringToTerraform(this._thresholdMetricId),
            treat_missing_data: cdktf.stringToTerraform(this._treatMissingData),
            unit: cdktf.stringToTerraform(this._unit),
            metric_query: cdktf.listMapper(cloudwatchMetricAlarmMetricQueryToTerraform)(this._metricQuery),
        };
    }
}
//# sourceMappingURL=cloudwatch-metric-alarm.js.map