// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cognitoIdentityPoolRolesAttachmentRoleMappingMappingRuleToTerraform(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 {
        claim: cdktf.stringToTerraform(struct.claim),
        match_type: cdktf.stringToTerraform(struct.matchType),
        role_arn: cdktf.stringToTerraform(struct.roleArn),
        value: cdktf.stringToTerraform(struct.value),
    };
}
export function cognitoIdentityPoolRolesAttachmentRoleMappingToTerraform(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 {
        ambiguous_role_resolution: cdktf.stringToTerraform(struct.ambiguousRoleResolution),
        identity_provider: cdktf.stringToTerraform(struct.identityProvider),
        type: cdktf.stringToTerraform(struct.type),
        mapping_rule: cdktf.listMapper(cognitoIdentityPoolRolesAttachmentRoleMappingMappingRuleToTerraform)(struct.mappingRule),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cognito_identity_pool_roles_attachment aws_cognito_identity_pool_roles_attachment}
*/
export class CognitoIdentityPoolRolesAttachment extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cognito_identity_pool_roles_attachment";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cognito_identity_pool_roles_attachment aws_cognito_identity_pool_roles_attachment} 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 CognitoIdentityPoolRolesAttachmentConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cognito_identity_pool_roles_attachment',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._identityPoolId = config.identityPoolId;
        this._roles = config.roles;
        this._roleMapping = config.roleMapping;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // identity_pool_id - computed: false, optional: false, required: true
    _identityPoolId;
    get identityPoolId() {
        return this.getStringAttribute('identity_pool_id');
    }
    set identityPoolId(value) {
        this._identityPoolId = value;
    }
    // Temporarily expose input value. Use with caution.
    get identityPoolIdInput() {
        return this._identityPoolId;
    }
    // roles - computed: false, optional: false, required: true
    _roles;
    get roles() {
        return this.getStringMapAttribute('roles');
    }
    set roles(value) {
        this._roles = value;
    }
    // Temporarily expose input value. Use with caution.
    get rolesInput() {
        return this._roles;
    }
    // role_mapping - computed: false, optional: true, required: false
    _roleMapping;
    get roleMapping() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('role_mapping')));
    }
    set roleMapping(value) {
        this._roleMapping = value;
    }
    resetRoleMapping() {
        this._roleMapping = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get roleMappingInput() {
        return this._roleMapping;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            identity_pool_id: cdktf.stringToTerraform(this._identityPoolId),
            roles: cdktf.hashMapper(cdktf.stringToTerraform)(this._roles),
            role_mapping: cdktf.listMapper(cognitoIdentityPoolRolesAttachmentRoleMappingToTerraform)(this._roleMapping),
        };
    }
}
//# sourceMappingURL=cognito-identity-pool-roles-attachment.js.map