// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cognitoUserPoolClientAnalyticsConfigurationToTerraform(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 {
        application_arn: cdktf.stringToTerraform(struct.applicationArn),
        application_id: cdktf.stringToTerraform(struct.applicationId),
        external_id: cdktf.stringToTerraform(struct.externalId),
        role_arn: cdktf.stringToTerraform(struct.roleArn),
        user_data_shared: cdktf.booleanToTerraform(struct.userDataShared),
    };
}
export class CognitoUserPoolClientAnalyticsConfigurationOutputReference 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._applicationArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.applicationArn = this._applicationArn;
        }
        if (this._applicationId !== undefined) {
            hasAnyValues = true;
            internalValueResult.applicationId = this._applicationId;
        }
        if (this._externalId !== undefined) {
            hasAnyValues = true;
            internalValueResult.externalId = this._externalId;
        }
        if (this._roleArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.roleArn = this._roleArn;
        }
        if (this._userDataShared !== undefined) {
            hasAnyValues = true;
            internalValueResult.userDataShared = this._userDataShared;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._applicationArn = undefined;
            this._applicationId = undefined;
            this._externalId = undefined;
            this._roleArn = undefined;
            this._userDataShared = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._applicationArn = value.applicationArn;
            this._applicationId = value.applicationId;
            this._externalId = value.externalId;
            this._roleArn = value.roleArn;
            this._userDataShared = value.userDataShared;
        }
    }
    // application_arn - computed: false, optional: true, required: false
    _applicationArn;
    get applicationArn() {
        return this.getStringAttribute('application_arn');
    }
    set applicationArn(value) {
        this._applicationArn = value;
    }
    resetApplicationArn() {
        this._applicationArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get applicationArnInput() {
        return this._applicationArn;
    }
    // application_id - computed: false, optional: true, required: false
    _applicationId;
    get applicationId() {
        return this.getStringAttribute('application_id');
    }
    set applicationId(value) {
        this._applicationId = value;
    }
    resetApplicationId() {
        this._applicationId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get applicationIdInput() {
        return this._applicationId;
    }
    // external_id - computed: false, optional: true, required: false
    _externalId;
    get externalId() {
        return this.getStringAttribute('external_id');
    }
    set externalId(value) {
        this._externalId = value;
    }
    resetExternalId() {
        this._externalId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get externalIdInput() {
        return this._externalId;
    }
    // role_arn - computed: true, optional: true, required: false
    _roleArn;
    get roleArn() {
        return this.getStringAttribute('role_arn');
    }
    set roleArn(value) {
        this._roleArn = value;
    }
    resetRoleArn() {
        this._roleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get roleArnInput() {
        return this._roleArn;
    }
    // user_data_shared - computed: false, optional: true, required: false
    _userDataShared;
    get userDataShared() {
        return this.getBooleanAttribute('user_data_shared');
    }
    set userDataShared(value) {
        this._userDataShared = value;
    }
    resetUserDataShared() {
        this._userDataShared = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get userDataSharedInput() {
        return this._userDataShared;
    }
}
export function cognitoUserPoolClientTokenValidityUnitsToTerraform(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 {
        access_token: cdktf.stringToTerraform(struct.accessToken),
        id_token: cdktf.stringToTerraform(struct.idToken),
        refresh_token: cdktf.stringToTerraform(struct.refreshToken),
    };
}
export class CognitoUserPoolClientTokenValidityUnitsOutputReference 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._accessToken !== undefined) {
            hasAnyValues = true;
            internalValueResult.accessToken = this._accessToken;
        }
        if (this._idToken !== undefined) {
            hasAnyValues = true;
            internalValueResult.idToken = this._idToken;
        }
        if (this._refreshToken !== undefined) {
            hasAnyValues = true;
            internalValueResult.refreshToken = this._refreshToken;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._accessToken = undefined;
            this._idToken = undefined;
            this._refreshToken = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._accessToken = value.accessToken;
            this._idToken = value.idToken;
            this._refreshToken = value.refreshToken;
        }
    }
    // access_token - computed: false, optional: true, required: false
    _accessToken;
    get accessToken() {
        return this.getStringAttribute('access_token');
    }
    set accessToken(value) {
        this._accessToken = value;
    }
    resetAccessToken() {
        this._accessToken = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accessTokenInput() {
        return this._accessToken;
    }
    // id_token - computed: false, optional: true, required: false
    _idToken;
    get idToken() {
        return this.getStringAttribute('id_token');
    }
    set idToken(value) {
        this._idToken = value;
    }
    resetIdToken() {
        this._idToken = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get idTokenInput() {
        return this._idToken;
    }
    // refresh_token - computed: false, optional: true, required: false
    _refreshToken;
    get refreshToken() {
        return this.getStringAttribute('refresh_token');
    }
    set refreshToken(value) {
        this._refreshToken = value;
    }
    resetRefreshToken() {
        this._refreshToken = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get refreshTokenInput() {
        return this._refreshToken;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cognito_user_pool_client aws_cognito_user_pool_client}
*/
export class CognitoUserPoolClient extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cognito_user_pool_client";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cognito_user_pool_client aws_cognito_user_pool_client} 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 CognitoUserPoolClientConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cognito_user_pool_client',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accessTokenValidity = config.accessTokenValidity;
        this._allowedOauthFlows = config.allowedOauthFlows;
        this._allowedOauthFlowsUserPoolClient = config.allowedOauthFlowsUserPoolClient;
        this._allowedOauthScopes = config.allowedOauthScopes;
        this._callbackUrls = config.callbackUrls;
        this._defaultRedirectUri = config.defaultRedirectUri;
        this._enableTokenRevocation = config.enableTokenRevocation;
        this._explicitAuthFlows = config.explicitAuthFlows;
        this._generateSecret = config.generateSecret;
        this._idTokenValidity = config.idTokenValidity;
        this._logoutUrls = config.logoutUrls;
        this._name = config.name;
        this._preventUserExistenceErrors = config.preventUserExistenceErrors;
        this._readAttributes = config.readAttributes;
        this._refreshTokenValidity = config.refreshTokenValidity;
        this._supportedIdentityProviders = config.supportedIdentityProviders;
        this._userPoolId = config.userPoolId;
        this._writeAttributes = config.writeAttributes;
        this._analyticsConfiguration.internalValue = config.analyticsConfiguration;
        this._tokenValidityUnits.internalValue = config.tokenValidityUnits;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // access_token_validity - computed: false, optional: true, required: false
    _accessTokenValidity;
    get accessTokenValidity() {
        return this.getNumberAttribute('access_token_validity');
    }
    set accessTokenValidity(value) {
        this._accessTokenValidity = value;
    }
    resetAccessTokenValidity() {
        this._accessTokenValidity = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accessTokenValidityInput() {
        return this._accessTokenValidity;
    }
    // allowed_oauth_flows - computed: false, optional: true, required: false
    _allowedOauthFlows;
    get allowedOauthFlows() {
        return cdktf.Fn.tolist(this.getListAttribute('allowed_oauth_flows'));
    }
    set allowedOauthFlows(value) {
        this._allowedOauthFlows = value;
    }
    resetAllowedOauthFlows() {
        this._allowedOauthFlows = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allowedOauthFlowsInput() {
        return this._allowedOauthFlows;
    }
    // allowed_oauth_flows_user_pool_client - computed: false, optional: true, required: false
    _allowedOauthFlowsUserPoolClient;
    get allowedOauthFlowsUserPoolClient() {
        return this.getBooleanAttribute('allowed_oauth_flows_user_pool_client');
    }
    set allowedOauthFlowsUserPoolClient(value) {
        this._allowedOauthFlowsUserPoolClient = value;
    }
    resetAllowedOauthFlowsUserPoolClient() {
        this._allowedOauthFlowsUserPoolClient = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allowedOauthFlowsUserPoolClientInput() {
        return this._allowedOauthFlowsUserPoolClient;
    }
    // allowed_oauth_scopes - computed: false, optional: true, required: false
    _allowedOauthScopes;
    get allowedOauthScopes() {
        return cdktf.Fn.tolist(this.getListAttribute('allowed_oauth_scopes'));
    }
    set allowedOauthScopes(value) {
        this._allowedOauthScopes = value;
    }
    resetAllowedOauthScopes() {
        this._allowedOauthScopes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allowedOauthScopesInput() {
        return this._allowedOauthScopes;
    }
    // callback_urls - computed: true, optional: true, required: false
    _callbackUrls;
    get callbackUrls() {
        return cdktf.Fn.tolist(this.getListAttribute('callback_urls'));
    }
    set callbackUrls(value) {
        this._callbackUrls = value;
    }
    resetCallbackUrls() {
        this._callbackUrls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get callbackUrlsInput() {
        return this._callbackUrls;
    }
    // client_secret - computed: true, optional: false, required: false
    get clientSecret() {
        return this.getStringAttribute('client_secret');
    }
    // default_redirect_uri - computed: false, optional: true, required: false
    _defaultRedirectUri;
    get defaultRedirectUri() {
        return this.getStringAttribute('default_redirect_uri');
    }
    set defaultRedirectUri(value) {
        this._defaultRedirectUri = value;
    }
    resetDefaultRedirectUri() {
        this._defaultRedirectUri = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get defaultRedirectUriInput() {
        return this._defaultRedirectUri;
    }
    // enable_token_revocation - computed: true, optional: true, required: false
    _enableTokenRevocation;
    get enableTokenRevocation() {
        return this.getBooleanAttribute('enable_token_revocation');
    }
    set enableTokenRevocation(value) {
        this._enableTokenRevocation = value;
    }
    resetEnableTokenRevocation() {
        this._enableTokenRevocation = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableTokenRevocationInput() {
        return this._enableTokenRevocation;
    }
    // explicit_auth_flows - computed: false, optional: true, required: false
    _explicitAuthFlows;
    get explicitAuthFlows() {
        return cdktf.Fn.tolist(this.getListAttribute('explicit_auth_flows'));
    }
    set explicitAuthFlows(value) {
        this._explicitAuthFlows = value;
    }
    resetExplicitAuthFlows() {
        this._explicitAuthFlows = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get explicitAuthFlowsInput() {
        return this._explicitAuthFlows;
    }
    // generate_secret - computed: false, optional: true, required: false
    _generateSecret;
    get generateSecret() {
        return this.getBooleanAttribute('generate_secret');
    }
    set generateSecret(value) {
        this._generateSecret = value;
    }
    resetGenerateSecret() {
        this._generateSecret = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get generateSecretInput() {
        return this._generateSecret;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // id_token_validity - computed: false, optional: true, required: false
    _idTokenValidity;
    get idTokenValidity() {
        return this.getNumberAttribute('id_token_validity');
    }
    set idTokenValidity(value) {
        this._idTokenValidity = value;
    }
    resetIdTokenValidity() {
        this._idTokenValidity = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get idTokenValidityInput() {
        return this._idTokenValidity;
    }
    // logout_urls - computed: true, optional: true, required: false
    _logoutUrls;
    get logoutUrls() {
        return cdktf.Fn.tolist(this.getListAttribute('logout_urls'));
    }
    set logoutUrls(value) {
        this._logoutUrls = value;
    }
    resetLogoutUrls() {
        this._logoutUrls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logoutUrlsInput() {
        return this._logoutUrls;
    }
    // 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;
    }
    // prevent_user_existence_errors - computed: true, optional: true, required: false
    _preventUserExistenceErrors;
    get preventUserExistenceErrors() {
        return this.getStringAttribute('prevent_user_existence_errors');
    }
    set preventUserExistenceErrors(value) {
        this._preventUserExistenceErrors = value;
    }
    resetPreventUserExistenceErrors() {
        this._preventUserExistenceErrors = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get preventUserExistenceErrorsInput() {
        return this._preventUserExistenceErrors;
    }
    // read_attributes - computed: false, optional: true, required: false
    _readAttributes;
    get readAttributes() {
        return cdktf.Fn.tolist(this.getListAttribute('read_attributes'));
    }
    set readAttributes(value) {
        this._readAttributes = value;
    }
    resetReadAttributes() {
        this._readAttributes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get readAttributesInput() {
        return this._readAttributes;
    }
    // refresh_token_validity - computed: false, optional: true, required: false
    _refreshTokenValidity;
    get refreshTokenValidity() {
        return this.getNumberAttribute('refresh_token_validity');
    }
    set refreshTokenValidity(value) {
        this._refreshTokenValidity = value;
    }
    resetRefreshTokenValidity() {
        this._refreshTokenValidity = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get refreshTokenValidityInput() {
        return this._refreshTokenValidity;
    }
    // supported_identity_providers - computed: false, optional: true, required: false
    _supportedIdentityProviders;
    get supportedIdentityProviders() {
        return cdktf.Fn.tolist(this.getListAttribute('supported_identity_providers'));
    }
    set supportedIdentityProviders(value) {
        this._supportedIdentityProviders = value;
    }
    resetSupportedIdentityProviders() {
        this._supportedIdentityProviders = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get supportedIdentityProvidersInput() {
        return this._supportedIdentityProviders;
    }
    // user_pool_id - computed: false, optional: false, required: true
    _userPoolId;
    get userPoolId() {
        return this.getStringAttribute('user_pool_id');
    }
    set userPoolId(value) {
        this._userPoolId = value;
    }
    // Temporarily expose input value. Use with caution.
    get userPoolIdInput() {
        return this._userPoolId;
    }
    // write_attributes - computed: false, optional: true, required: false
    _writeAttributes;
    get writeAttributes() {
        return cdktf.Fn.tolist(this.getListAttribute('write_attributes'));
    }
    set writeAttributes(value) {
        this._writeAttributes = value;
    }
    resetWriteAttributes() {
        this._writeAttributes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get writeAttributesInput() {
        return this._writeAttributes;
    }
    // analytics_configuration - computed: false, optional: true, required: false
    _analyticsConfiguration = new CognitoUserPoolClientAnalyticsConfigurationOutputReference(this, "analytics_configuration", true);
    get analyticsConfiguration() {
        return this._analyticsConfiguration;
    }
    putAnalyticsConfiguration(value) {
        this._analyticsConfiguration.internalValue = value;
    }
    resetAnalyticsConfiguration() {
        this._analyticsConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get analyticsConfigurationInput() {
        return this._analyticsConfiguration.internalValue;
    }
    // token_validity_units - computed: false, optional: true, required: false
    _tokenValidityUnits = new CognitoUserPoolClientTokenValidityUnitsOutputReference(this, "token_validity_units", true);
    get tokenValidityUnits() {
        return this._tokenValidityUnits;
    }
    putTokenValidityUnits(value) {
        this._tokenValidityUnits.internalValue = value;
    }
    resetTokenValidityUnits() {
        this._tokenValidityUnits.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tokenValidityUnitsInput() {
        return this._tokenValidityUnits.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            access_token_validity: cdktf.numberToTerraform(this._accessTokenValidity),
            allowed_oauth_flows: cdktf.listMapper(cdktf.stringToTerraform)(this._allowedOauthFlows),
            allowed_oauth_flows_user_pool_client: cdktf.booleanToTerraform(this._allowedOauthFlowsUserPoolClient),
            allowed_oauth_scopes: cdktf.listMapper(cdktf.stringToTerraform)(this._allowedOauthScopes),
            callback_urls: cdktf.listMapper(cdktf.stringToTerraform)(this._callbackUrls),
            default_redirect_uri: cdktf.stringToTerraform(this._defaultRedirectUri),
            enable_token_revocation: cdktf.booleanToTerraform(this._enableTokenRevocation),
            explicit_auth_flows: cdktf.listMapper(cdktf.stringToTerraform)(this._explicitAuthFlows),
            generate_secret: cdktf.booleanToTerraform(this._generateSecret),
            id_token_validity: cdktf.numberToTerraform(this._idTokenValidity),
            logout_urls: cdktf.listMapper(cdktf.stringToTerraform)(this._logoutUrls),
            name: cdktf.stringToTerraform(this._name),
            prevent_user_existence_errors: cdktf.stringToTerraform(this._preventUserExistenceErrors),
            read_attributes: cdktf.listMapper(cdktf.stringToTerraform)(this._readAttributes),
            refresh_token_validity: cdktf.numberToTerraform(this._refreshTokenValidity),
            supported_identity_providers: cdktf.listMapper(cdktf.stringToTerraform)(this._supportedIdentityProviders),
            user_pool_id: cdktf.stringToTerraform(this._userPoolId),
            write_attributes: cdktf.listMapper(cdktf.stringToTerraform)(this._writeAttributes),
            analytics_configuration: cognitoUserPoolClientAnalyticsConfigurationToTerraform(this._analyticsConfiguration.internalValue),
            token_validity_units: cognitoUserPoolClientTokenValidityUnitsToTerraform(this._tokenValidityUnits.internalValue),
        };
    }
}
//# sourceMappingURL=cognito-user-pool-client.js.map