// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cloudfrontMonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigToTerraform(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 {
        realtime_metrics_subscription_status: cdktf.stringToTerraform(struct.realtimeMetricsSubscriptionStatus),
    };
}
export class CloudfrontMonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigOutputReference 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._realtimeMetricsSubscriptionStatus !== undefined) {
            hasAnyValues = true;
            internalValueResult.realtimeMetricsSubscriptionStatus = this._realtimeMetricsSubscriptionStatus;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._realtimeMetricsSubscriptionStatus = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._realtimeMetricsSubscriptionStatus = value.realtimeMetricsSubscriptionStatus;
        }
    }
    // realtime_metrics_subscription_status - computed: false, optional: false, required: true
    _realtimeMetricsSubscriptionStatus;
    get realtimeMetricsSubscriptionStatus() {
        return this.getStringAttribute('realtime_metrics_subscription_status');
    }
    set realtimeMetricsSubscriptionStatus(value) {
        this._realtimeMetricsSubscriptionStatus = value;
    }
    // Temporarily expose input value. Use with caution.
    get realtimeMetricsSubscriptionStatusInput() {
        return this._realtimeMetricsSubscriptionStatus;
    }
}
export function cloudfrontMonitoringSubscriptionMonitoringSubscriptionToTerraform(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 {
        realtime_metrics_subscription_config: cloudfrontMonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigToTerraform(struct.realtimeMetricsSubscriptionConfig),
    };
}
export class CloudfrontMonitoringSubscriptionMonitoringSubscriptionOutputReference 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._realtimeMetricsSubscriptionConfig?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.realtimeMetricsSubscriptionConfig = this._realtimeMetricsSubscriptionConfig?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._realtimeMetricsSubscriptionConfig.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._realtimeMetricsSubscriptionConfig.internalValue = value.realtimeMetricsSubscriptionConfig;
        }
    }
    // realtime_metrics_subscription_config - computed: false, optional: false, required: true
    _realtimeMetricsSubscriptionConfig = new CloudfrontMonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigOutputReference(this, "realtime_metrics_subscription_config", true);
    get realtimeMetricsSubscriptionConfig() {
        return this._realtimeMetricsSubscriptionConfig;
    }
    putRealtimeMetricsSubscriptionConfig(value) {
        this._realtimeMetricsSubscriptionConfig.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get realtimeMetricsSubscriptionConfigInput() {
        return this._realtimeMetricsSubscriptionConfig.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudfront_monitoring_subscription aws_cloudfront_monitoring_subscription}
*/
export class CloudfrontMonitoringSubscription extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cloudfront_monitoring_subscription";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudfront_monitoring_subscription aws_cloudfront_monitoring_subscription} 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 CloudfrontMonitoringSubscriptionConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cloudfront_monitoring_subscription',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._distributionId = config.distributionId;
        this._monitoringSubscription.internalValue = config.monitoringSubscription;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // distribution_id - computed: false, optional: false, required: true
    _distributionId;
    get distributionId() {
        return this.getStringAttribute('distribution_id');
    }
    set distributionId(value) {
        this._distributionId = value;
    }
    // Temporarily expose input value. Use with caution.
    get distributionIdInput() {
        return this._distributionId;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // monitoring_subscription - computed: false, optional: false, required: true
    _monitoringSubscription = new CloudfrontMonitoringSubscriptionMonitoringSubscriptionOutputReference(this, "monitoring_subscription", true);
    get monitoringSubscription() {
        return this._monitoringSubscription;
    }
    putMonitoringSubscription(value) {
        this._monitoringSubscription.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get monitoringSubscriptionInput() {
        return this._monitoringSubscription.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            distribution_id: cdktf.stringToTerraform(this._distributionId),
            monitoring_subscription: cloudfrontMonitoringSubscriptionMonitoringSubscriptionToTerraform(this._monitoringSubscription.internalValue),
        };
    }
}
//# sourceMappingURL=cloudfront-monitoring-subscription.js.map