// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function apigatewayv2AuthorizerJwtConfigurationToTerraform(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 {
        audience: cdktf.listMapper(cdktf.stringToTerraform)(struct.audience),
        issuer: cdktf.stringToTerraform(struct.issuer),
    };
}
export class Apigatewayv2AuthorizerJwtConfigurationOutputReference 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._audience !== undefined) {
            hasAnyValues = true;
            internalValueResult.audience = this._audience;
        }
        if (this._issuer !== undefined) {
            hasAnyValues = true;
            internalValueResult.issuer = this._issuer;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._audience = undefined;
            this._issuer = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._audience = value.audience;
            this._issuer = value.issuer;
        }
    }
    // audience - computed: false, optional: true, required: false
    _audience;
    get audience() {
        return cdktf.Fn.tolist(this.getListAttribute('audience'));
    }
    set audience(value) {
        this._audience = value;
    }
    resetAudience() {
        this._audience = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get audienceInput() {
        return this._audience;
    }
    // issuer - computed: false, optional: true, required: false
    _issuer;
    get issuer() {
        return this.getStringAttribute('issuer');
    }
    set issuer(value) {
        this._issuer = value;
    }
    resetIssuer() {
        this._issuer = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get issuerInput() {
        return this._issuer;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer aws_apigatewayv2_authorizer}
*/
export class Apigatewayv2Authorizer extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_apigatewayv2_authorizer";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_authorizer aws_apigatewayv2_authorizer} 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 Apigatewayv2AuthorizerConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_apigatewayv2_authorizer',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._apiId = config.apiId;
        this._authorizerCredentialsArn = config.authorizerCredentialsArn;
        this._authorizerPayloadFormatVersion = config.authorizerPayloadFormatVersion;
        this._authorizerResultTtlInSeconds = config.authorizerResultTtlInSeconds;
        this._authorizerType = config.authorizerType;
        this._authorizerUri = config.authorizerUri;
        this._enableSimpleResponses = config.enableSimpleResponses;
        this._identitySources = config.identitySources;
        this._name = config.name;
        this._jwtConfiguration.internalValue = config.jwtConfiguration;
    }
    // ==========
    // 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;
    }
    // authorizer_credentials_arn - computed: false, optional: true, required: false
    _authorizerCredentialsArn;
    get authorizerCredentialsArn() {
        return this.getStringAttribute('authorizer_credentials_arn');
    }
    set authorizerCredentialsArn(value) {
        this._authorizerCredentialsArn = value;
    }
    resetAuthorizerCredentialsArn() {
        this._authorizerCredentialsArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizerCredentialsArnInput() {
        return this._authorizerCredentialsArn;
    }
    // authorizer_payload_format_version - computed: false, optional: true, required: false
    _authorizerPayloadFormatVersion;
    get authorizerPayloadFormatVersion() {
        return this.getStringAttribute('authorizer_payload_format_version');
    }
    set authorizerPayloadFormatVersion(value) {
        this._authorizerPayloadFormatVersion = value;
    }
    resetAuthorizerPayloadFormatVersion() {
        this._authorizerPayloadFormatVersion = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizerPayloadFormatVersionInput() {
        return this._authorizerPayloadFormatVersion;
    }
    // authorizer_result_ttl_in_seconds - computed: true, optional: true, required: false
    _authorizerResultTtlInSeconds;
    get authorizerResultTtlInSeconds() {
        return this.getNumberAttribute('authorizer_result_ttl_in_seconds');
    }
    set authorizerResultTtlInSeconds(value) {
        this._authorizerResultTtlInSeconds = value;
    }
    resetAuthorizerResultTtlInSeconds() {
        this._authorizerResultTtlInSeconds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizerResultTtlInSecondsInput() {
        return this._authorizerResultTtlInSeconds;
    }
    // authorizer_type - computed: false, optional: false, required: true
    _authorizerType;
    get authorizerType() {
        return this.getStringAttribute('authorizer_type');
    }
    set authorizerType(value) {
        this._authorizerType = value;
    }
    // Temporarily expose input value. Use with caution.
    get authorizerTypeInput() {
        return this._authorizerType;
    }
    // authorizer_uri - computed: false, optional: true, required: false
    _authorizerUri;
    get authorizerUri() {
        return this.getStringAttribute('authorizer_uri');
    }
    set authorizerUri(value) {
        this._authorizerUri = value;
    }
    resetAuthorizerUri() {
        this._authorizerUri = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizerUriInput() {
        return this._authorizerUri;
    }
    // enable_simple_responses - computed: false, optional: true, required: false
    _enableSimpleResponses;
    get enableSimpleResponses() {
        return this.getBooleanAttribute('enable_simple_responses');
    }
    set enableSimpleResponses(value) {
        this._enableSimpleResponses = value;
    }
    resetEnableSimpleResponses() {
        this._enableSimpleResponses = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableSimpleResponsesInput() {
        return this._enableSimpleResponses;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // identity_sources - computed: false, optional: true, required: false
    _identitySources;
    get identitySources() {
        return cdktf.Fn.tolist(this.getListAttribute('identity_sources'));
    }
    set identitySources(value) {
        this._identitySources = value;
    }
    resetIdentitySources() {
        this._identitySources = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get identitySourcesInput() {
        return this._identitySources;
    }
    // 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;
    }
    // jwt_configuration - computed: false, optional: true, required: false
    _jwtConfiguration = new Apigatewayv2AuthorizerJwtConfigurationOutputReference(this, "jwt_configuration", true);
    get jwtConfiguration() {
        return this._jwtConfiguration;
    }
    putJwtConfiguration(value) {
        this._jwtConfiguration.internalValue = value;
    }
    resetJwtConfiguration() {
        this._jwtConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get jwtConfigurationInput() {
        return this._jwtConfiguration.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            api_id: cdktf.stringToTerraform(this._apiId),
            authorizer_credentials_arn: cdktf.stringToTerraform(this._authorizerCredentialsArn),
            authorizer_payload_format_version: cdktf.stringToTerraform(this._authorizerPayloadFormatVersion),
            authorizer_result_ttl_in_seconds: cdktf.numberToTerraform(this._authorizerResultTtlInSeconds),
            authorizer_type: cdktf.stringToTerraform(this._authorizerType),
            authorizer_uri: cdktf.stringToTerraform(this._authorizerUri),
            enable_simple_responses: cdktf.booleanToTerraform(this._enableSimpleResponses),
            identity_sources: cdktf.listMapper(cdktf.stringToTerraform)(this._identitySources),
            name: cdktf.stringToTerraform(this._name),
            jwt_configuration: apigatewayv2AuthorizerJwtConfigurationToTerraform(this._jwtConfiguration.internalValue),
        };
    }
}
//# sourceMappingURL=apigatewayv2-authorizer.js.map