// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function apigatewayv2StageAccessLogSettingsToTerraform(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 {
        destination_arn: cdktf.stringToTerraform(struct.destinationArn),
        format: cdktf.stringToTerraform(struct.format),
    };
}
export class Apigatewayv2StageAccessLogSettingsOutputReference 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._destinationArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.destinationArn = this._destinationArn;
        }
        if (this._format !== undefined) {
            hasAnyValues = true;
            internalValueResult.format = this._format;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._destinationArn = undefined;
            this._format = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._destinationArn = value.destinationArn;
            this._format = value.format;
        }
    }
    // destination_arn - computed: false, optional: false, required: true
    _destinationArn;
    get destinationArn() {
        return this.getStringAttribute('destination_arn');
    }
    set destinationArn(value) {
        this._destinationArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get destinationArnInput() {
        return this._destinationArn;
    }
    // format - computed: false, optional: false, required: true
    _format;
    get format() {
        return this.getStringAttribute('format');
    }
    set format(value) {
        this._format = value;
    }
    // Temporarily expose input value. Use with caution.
    get formatInput() {
        return this._format;
    }
}
export function apigatewayv2StageDefaultRouteSettingsToTerraform(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 {
        data_trace_enabled: cdktf.booleanToTerraform(struct.dataTraceEnabled),
        detailed_metrics_enabled: cdktf.booleanToTerraform(struct.detailedMetricsEnabled),
        logging_level: cdktf.stringToTerraform(struct.loggingLevel),
        throttling_burst_limit: cdktf.numberToTerraform(struct.throttlingBurstLimit),
        throttling_rate_limit: cdktf.numberToTerraform(struct.throttlingRateLimit),
    };
}
export class Apigatewayv2StageDefaultRouteSettingsOutputReference 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._dataTraceEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.dataTraceEnabled = this._dataTraceEnabled;
        }
        if (this._detailedMetricsEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.detailedMetricsEnabled = this._detailedMetricsEnabled;
        }
        if (this._loggingLevel !== undefined) {
            hasAnyValues = true;
            internalValueResult.loggingLevel = this._loggingLevel;
        }
        if (this._throttlingBurstLimit !== undefined) {
            hasAnyValues = true;
            internalValueResult.throttlingBurstLimit = this._throttlingBurstLimit;
        }
        if (this._throttlingRateLimit !== undefined) {
            hasAnyValues = true;
            internalValueResult.throttlingRateLimit = this._throttlingRateLimit;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._dataTraceEnabled = undefined;
            this._detailedMetricsEnabled = undefined;
            this._loggingLevel = undefined;
            this._throttlingBurstLimit = undefined;
            this._throttlingRateLimit = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._dataTraceEnabled = value.dataTraceEnabled;
            this._detailedMetricsEnabled = value.detailedMetricsEnabled;
            this._loggingLevel = value.loggingLevel;
            this._throttlingBurstLimit = value.throttlingBurstLimit;
            this._throttlingRateLimit = value.throttlingRateLimit;
        }
    }
    // data_trace_enabled - computed: false, optional: true, required: false
    _dataTraceEnabled;
    get dataTraceEnabled() {
        return this.getBooleanAttribute('data_trace_enabled');
    }
    set dataTraceEnabled(value) {
        this._dataTraceEnabled = value;
    }
    resetDataTraceEnabled() {
        this._dataTraceEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dataTraceEnabledInput() {
        return this._dataTraceEnabled;
    }
    // detailed_metrics_enabled - computed: false, optional: true, required: false
    _detailedMetricsEnabled;
    get detailedMetricsEnabled() {
        return this.getBooleanAttribute('detailed_metrics_enabled');
    }
    set detailedMetricsEnabled(value) {
        this._detailedMetricsEnabled = value;
    }
    resetDetailedMetricsEnabled() {
        this._detailedMetricsEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get detailedMetricsEnabledInput() {
        return this._detailedMetricsEnabled;
    }
    // logging_level - computed: true, optional: true, required: false
    _loggingLevel;
    get loggingLevel() {
        return this.getStringAttribute('logging_level');
    }
    set loggingLevel(value) {
        this._loggingLevel = value;
    }
    resetLoggingLevel() {
        this._loggingLevel = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loggingLevelInput() {
        return this._loggingLevel;
    }
    // throttling_burst_limit - computed: false, optional: true, required: false
    _throttlingBurstLimit;
    get throttlingBurstLimit() {
        return this.getNumberAttribute('throttling_burst_limit');
    }
    set throttlingBurstLimit(value) {
        this._throttlingBurstLimit = value;
    }
    resetThrottlingBurstLimit() {
        this._throttlingBurstLimit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get throttlingBurstLimitInput() {
        return this._throttlingBurstLimit;
    }
    // throttling_rate_limit - computed: false, optional: true, required: false
    _throttlingRateLimit;
    get throttlingRateLimit() {
        return this.getNumberAttribute('throttling_rate_limit');
    }
    set throttlingRateLimit(value) {
        this._throttlingRateLimit = value;
    }
    resetThrottlingRateLimit() {
        this._throttlingRateLimit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get throttlingRateLimitInput() {
        return this._throttlingRateLimit;
    }
}
export function apigatewayv2StageRouteSettingsToTerraform(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 {
        data_trace_enabled: cdktf.booleanToTerraform(struct.dataTraceEnabled),
        detailed_metrics_enabled: cdktf.booleanToTerraform(struct.detailedMetricsEnabled),
        logging_level: cdktf.stringToTerraform(struct.loggingLevel),
        route_key: cdktf.stringToTerraform(struct.routeKey),
        throttling_burst_limit: cdktf.numberToTerraform(struct.throttlingBurstLimit),
        throttling_rate_limit: cdktf.numberToTerraform(struct.throttlingRateLimit),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_stage aws_apigatewayv2_stage}
*/
export class Apigatewayv2Stage extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_apigatewayv2_stage";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_stage aws_apigatewayv2_stage} 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 Apigatewayv2StageConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_apigatewayv2_stage',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._apiId = config.apiId;
        this._autoDeploy = config.autoDeploy;
        this._clientCertificateId = config.clientCertificateId;
        this._deploymentId = config.deploymentId;
        this._description = config.description;
        this._name = config.name;
        this._stageVariables = config.stageVariables;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._accessLogSettings.internalValue = config.accessLogSettings;
        this._defaultRouteSettings.internalValue = config.defaultRouteSettings;
        this._routeSettings = config.routeSettings;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // api_id - computed: false, optional: false, required: true
    _apiId;
    get apiId() {
        return this.getStringAttribute('api_id');
    }
    set apiId(value) {
        this._apiId = value;
    }
    // Temporarily expose input value. Use with caution.
    get apiIdInput() {
        return this._apiId;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // auto_deploy - computed: false, optional: true, required: false
    _autoDeploy;
    get autoDeploy() {
        return this.getBooleanAttribute('auto_deploy');
    }
    set autoDeploy(value) {
        this._autoDeploy = value;
    }
    resetAutoDeploy() {
        this._autoDeploy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get autoDeployInput() {
        return this._autoDeploy;
    }
    // client_certificate_id - computed: false, optional: true, required: false
    _clientCertificateId;
    get clientCertificateId() {
        return this.getStringAttribute('client_certificate_id');
    }
    set clientCertificateId(value) {
        this._clientCertificateId = value;
    }
    resetClientCertificateId() {
        this._clientCertificateId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get clientCertificateIdInput() {
        return this._clientCertificateId;
    }
    // deployment_id - computed: true, optional: true, required: false
    _deploymentId;
    get deploymentId() {
        return this.getStringAttribute('deployment_id');
    }
    set deploymentId(value) {
        this._deploymentId = value;
    }
    resetDeploymentId() {
        this._deploymentId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deploymentIdInput() {
        return this._deploymentId;
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // execution_arn - computed: true, optional: false, required: false
    get executionArn() {
        return this.getStringAttribute('execution_arn');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // invoke_url - computed: true, optional: false, required: false
    get invokeUrl() {
        return this.getStringAttribute('invoke_url');
    }
    // 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;
    }
    // stage_variables - computed: false, optional: true, required: false
    _stageVariables;
    get stageVariables() {
        return this.getStringMapAttribute('stage_variables');
    }
    set stageVariables(value) {
        this._stageVariables = value;
    }
    resetStageVariables() {
        this._stageVariables = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get stageVariablesInput() {
        return this._stageVariables;
    }
    // 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;
    }
    // access_log_settings - computed: false, optional: true, required: false
    _accessLogSettings = new Apigatewayv2StageAccessLogSettingsOutputReference(this, "access_log_settings", true);
    get accessLogSettings() {
        return this._accessLogSettings;
    }
    putAccessLogSettings(value) {
        this._accessLogSettings.internalValue = value;
    }
    resetAccessLogSettings() {
        this._accessLogSettings.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accessLogSettingsInput() {
        return this._accessLogSettings.internalValue;
    }
    // default_route_settings - computed: false, optional: true, required: false
    _defaultRouteSettings = new Apigatewayv2StageDefaultRouteSettingsOutputReference(this, "default_route_settings", true);
    get defaultRouteSettings() {
        return this._defaultRouteSettings;
    }
    putDefaultRouteSettings(value) {
        this._defaultRouteSettings.internalValue = value;
    }
    resetDefaultRouteSettings() {
        this._defaultRouteSettings.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get defaultRouteSettingsInput() {
        return this._defaultRouteSettings.internalValue;
    }
    // route_settings - computed: false, optional: true, required: false
    _routeSettings;
    get routeSettings() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('route_settings')));
    }
    set routeSettings(value) {
        this._routeSettings = value;
    }
    resetRouteSettings() {
        this._routeSettings = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get routeSettingsInput() {
        return this._routeSettings;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            api_id: cdktf.stringToTerraform(this._apiId),
            auto_deploy: cdktf.booleanToTerraform(this._autoDeploy),
            client_certificate_id: cdktf.stringToTerraform(this._clientCertificateId),
            deployment_id: cdktf.stringToTerraform(this._deploymentId),
            description: cdktf.stringToTerraform(this._description),
            name: cdktf.stringToTerraform(this._name),
            stage_variables: cdktf.hashMapper(cdktf.stringToTerraform)(this._stageVariables),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            access_log_settings: apigatewayv2StageAccessLogSettingsToTerraform(this._accessLogSettings.internalValue),
            default_route_settings: apigatewayv2StageDefaultRouteSettingsToTerraform(this._defaultRouteSettings.internalValue),
            route_settings: cdktf.listMapper(apigatewayv2StageRouteSettingsToTerraform)(this._routeSettings),
        };
    }
}
//# sourceMappingURL=apigatewayv2-stage.js.map