import * as HttpClient from "effect/unstable/http/HttpClient";
import * as redacted from "effect/Redacted";
import * as S from "effect/Schema";
import * as stream from "effect/Stream";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
import { SensitiveString } from "../sensitive.js";
const ns = T.XmlNamespace("http://cognito-identity.amazonaws.com/doc/2014-06-30/");
const svc = T.AwsApiService({
    sdkId: "Cognito Identity",
    serviceShapeName: "AWSCognitoIdentityService",
});
const auth = T.AwsAuthSigv4({ name: "cognito-identity" });
const ver = T.ServiceVersion("2014-06-30");
const proto = T.AwsProtocolsAwsJson1_1();
const rules = T.EndpointResolver((p, _) => {
    const { Region, UseDualStack = false, UseFIPS = false, Endpoint } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        if (Region === "us-east-1") {
                            return e("https://cognito-identity-fips.us-east-1.amazonaws.com");
                        }
                        if (Region === "us-east-2") {
                            return e("https://cognito-identity-fips.us-east-2.amazonaws.com");
                        }
                        if (Region === "us-west-1") {
                            return e("https://cognito-identity-fips.us-west-1.amazonaws.com");
                        }
                        if (Region === "us-west-2") {
                            return e("https://cognito-identity-fips.us-west-2.amazonaws.com");
                        }
                        return e(`https://cognito-identity-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        return e(`https://cognito-identity-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                    }
                    return err("FIPS is enabled but this partition does not support FIPS");
                }
                if (UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        if ("aws" === _.getAttr(PartitionResult, "name")) {
                            return e(`https://cognito-identity.${Region}.amazonaws.com`);
                        }
                        return e(`https://cognito-identity.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://cognito-identity.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const IdentityProviders = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const OIDCProviderList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const CognitoIdentityProvider = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ProviderName: S.optional(S.String),
    ClientId: S.optional(S.String),
    ServerSideTokenCheck: S.optional(S.Boolean),
})).annotate({
    identifier: "CognitoIdentityProvider",
});
export const CognitoIdentityProviderList = /*@__PURE__*/ /*#__PURE__*/ S.Array(CognitoIdentityProvider);
export const SAMLProviderList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const IdentityPoolTagsType = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const CreateIdentityPoolInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolName: S.String,
    AllowUnauthenticatedIdentities: S.Boolean,
    AllowClassicFlow: S.optional(S.Boolean),
    SupportedLoginProviders: S.optional(IdentityProviders),
    DeveloperProviderName: S.optional(S.String),
    OpenIdConnectProviderARNs: S.optional(OIDCProviderList),
    CognitoIdentityProviders: S.optional(CognitoIdentityProviderList),
    SamlProviderARNs: S.optional(SAMLProviderList),
    IdentityPoolTags: S.optional(IdentityPoolTagsType),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateIdentityPoolInput",
});
export const IdentityPool = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    IdentityPoolName: S.String,
    AllowUnauthenticatedIdentities: S.Boolean,
    AllowClassicFlow: S.optional(S.Boolean),
    SupportedLoginProviders: S.optional(IdentityProviders),
    DeveloperProviderName: S.optional(S.String),
    OpenIdConnectProviderARNs: S.optional(OIDCProviderList),
    CognitoIdentityProviders: S.optional(CognitoIdentityProviderList),
    SamlProviderARNs: S.optional(SAMLProviderList),
    IdentityPoolTags: S.optional(IdentityPoolTagsType),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({ identifier: "IdentityPool" });
export const IdentityIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const DeleteIdentitiesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityIdsToDelete: IdentityIdList }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteIdentitiesInput",
});
export const ErrorCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const UnprocessedIdentityId = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    ErrorCode: S.optional(ErrorCode),
})).annotate({
    identifier: "UnprocessedIdentityId",
});
export const UnprocessedIdentityIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(UnprocessedIdentityId);
export const DeleteIdentitiesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    UnprocessedIdentityIds: S.optional(UnprocessedIdentityIdList),
}).pipe(ns)).annotate({
    identifier: "DeleteIdentitiesResponse",
});
export const DeleteIdentityPoolInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityPoolId: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteIdentityPoolInput",
});
export const DeleteIdentityPoolResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "DeleteIdentityPoolResponse",
});
export const DescribeIdentityInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityId: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeIdentityInput",
});
export const LoginsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const IdentityDescription = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    Logins: S.optional(LoginsList),
    CreationDate: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    LastModifiedDate: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
}).pipe(ns)).annotate({
    identifier: "IdentityDescription",
});
export const DescribeIdentityPoolInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityPoolId: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeIdentityPoolInput",
});
export const LoginsMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, SensitiveString.pipe(S.optional));
export const GetCredentialsForIdentityInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.String,
    Logins: S.optional(LoginsMap),
    CustomRoleArn: S.optional(S.String),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetCredentialsForIdentityInput",
});
export const Credentials = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    AccessKeyId: S.optional(S.String),
    SecretKey: S.optional(SensitiveString),
    SessionToken: S.optional(S.String),
    Expiration: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "Credentials" });
export const GetCredentialsForIdentityResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    Credentials: S.optional(Credentials),
}).pipe(ns)).annotate({
    identifier: "GetCredentialsForIdentityResponse",
});
export const GetIdInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    AccountId: S.optional(S.String),
    IdentityPoolId: S.String,
    Logins: S.optional(LoginsMap),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({ identifier: "GetIdInput" });
export const GetIdResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityId: S.optional(S.String) }).pipe(ns)).annotate({ identifier: "GetIdResponse" });
export const GetIdentityPoolRolesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityPoolId: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetIdentityPoolRolesInput",
});
export const RolesMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const RoleMappingType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AmbiguousRoleResolutionType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MappingRuleMatchType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MappingRule = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Claim: S.String,
    MatchType: MappingRuleMatchType,
    Value: S.String,
    RoleARN: S.String,
})).annotate({ identifier: "MappingRule" });
export const MappingRulesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(MappingRule);
export const RulesConfigurationType = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Rules: MappingRulesList })).annotate({
    identifier: "RulesConfigurationType",
});
export const RoleMapping = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Type: RoleMappingType,
    AmbiguousRoleResolution: S.optional(AmbiguousRoleResolutionType),
    RulesConfiguration: S.optional(RulesConfigurationType),
})).annotate({ identifier: "RoleMapping" });
export const RoleMappingMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, RoleMapping.pipe(S.optional));
export const GetIdentityPoolRolesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.optional(S.String),
    Roles: S.optional(RolesMap),
    RoleMappings: S.optional(RoleMappingMap),
}).pipe(ns)).annotate({
    identifier: "GetIdentityPoolRolesResponse",
});
export const GetOpenIdTokenInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityId: S.String, Logins: S.optional(LoginsMap) }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetOpenIdTokenInput",
});
export const GetOpenIdTokenResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    Token: S.optional(SensitiveString),
}).pipe(ns)).annotate({
    identifier: "GetOpenIdTokenResponse",
});
export const PrincipalTags = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const GetOpenIdTokenForDeveloperIdentityInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    IdentityId: S.optional(S.String),
    Logins: LoginsMap,
    PrincipalTags: S.optional(PrincipalTags),
    TokenDuration: S.optional(S.Number),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetOpenIdTokenForDeveloperIdentityInput",
});
export const GetOpenIdTokenForDeveloperIdentityResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    Token: S.optional(SensitiveString),
}).pipe(ns)).annotate({
    identifier: "GetOpenIdTokenForDeveloperIdentityResponse",
});
export const GetPrincipalTagAttributeMapInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityPoolId: S.String, IdentityProviderName: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetPrincipalTagAttributeMapInput",
});
export const GetPrincipalTagAttributeMapResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.optional(S.String),
    IdentityProviderName: S.optional(S.String),
    UseDefaults: S.optional(S.Boolean),
    PrincipalTags: S.optional(PrincipalTags),
}).pipe(ns)).annotate({
    identifier: "GetPrincipalTagAttributeMapResponse",
});
export const ListIdentitiesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    MaxResults: S.Number,
    NextToken: S.optional(S.String),
    HideDisabled: S.optional(S.Boolean),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListIdentitiesInput",
});
export const IdentitiesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(IdentityDescription);
export const ListIdentitiesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.optional(S.String),
    Identities: S.optional(IdentitiesList),
    NextToken: S.optional(S.String),
}).pipe(ns)).annotate({
    identifier: "ListIdentitiesResponse",
});
export const ListIdentityPoolsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MaxResults: S.Number, NextToken: S.optional(S.String) }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListIdentityPoolsInput",
});
export const IdentityPoolShortDescription = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.optional(S.String),
    IdentityPoolName: S.optional(S.String),
})).annotate({
    identifier: "IdentityPoolShortDescription",
});
export const IdentityPoolsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(IdentityPoolShortDescription);
export const ListIdentityPoolsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPools: S.optional(IdentityPoolsList),
    NextToken: S.optional(S.String),
}).pipe(ns)).annotate({
    identifier: "ListIdentityPoolsResponse",
});
export const ListTagsForResourceInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ResourceArn: S.String }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagsForResourceInput",
});
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Tags: S.optional(IdentityPoolTagsType) }).pipe(ns)).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const LookupDeveloperIdentityInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    IdentityId: S.optional(S.String),
    DeveloperUserIdentifier: S.optional(S.String),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "LookupDeveloperIdentityInput",
});
export const DeveloperUserIdentifierList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const LookupDeveloperIdentityResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.optional(S.String),
    DeveloperUserIdentifierList: S.optional(DeveloperUserIdentifierList),
    NextToken: S.optional(S.String),
}).pipe(ns)).annotate({
    identifier: "LookupDeveloperIdentityResponse",
});
export const MergeDeveloperIdentitiesInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    SourceUserIdentifier: S.String,
    DestinationUserIdentifier: S.String,
    DeveloperProviderName: S.String,
    IdentityPoolId: S.String,
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "MergeDeveloperIdentitiesInput",
});
export const MergeDeveloperIdentitiesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityId: S.optional(S.String) }).pipe(ns)).annotate({
    identifier: "MergeDeveloperIdentitiesResponse",
});
export const SetIdentityPoolRolesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    Roles: RolesMap,
    RoleMappings: S.optional(RoleMappingMap),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SetIdentityPoolRolesInput",
});
export const SetIdentityPoolRolesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "SetIdentityPoolRolesResponse",
});
export const SetPrincipalTagAttributeMapInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.String,
    IdentityProviderName: S.String,
    UseDefaults: S.optional(S.Boolean),
    PrincipalTags: S.optional(PrincipalTags),
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SetPrincipalTagAttributeMapInput",
});
export const SetPrincipalTagAttributeMapResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityPoolId: S.optional(S.String),
    IdentityProviderName: S.optional(S.String),
    UseDefaults: S.optional(S.Boolean),
    PrincipalTags: S.optional(PrincipalTags),
}).pipe(ns)).annotate({
    identifier: "SetPrincipalTagAttributeMapResponse",
});
export const TagResourceInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ResourceArn: S.String, Tags: IdentityPoolTagsType }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceInput",
});
export const TagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "TagResourceResponse",
});
export const UnlinkDeveloperIdentityInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.String,
    IdentityPoolId: S.String,
    DeveloperProviderName: S.String,
    DeveloperUserIdentifier: S.String,
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UnlinkDeveloperIdentityInput",
});
export const UnlinkDeveloperIdentityResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "UnlinkDeveloperIdentityResponse",
});
export const UnlinkIdentityInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityId: S.String,
    Logins: LoginsMap,
    LoginsToRemove: LoginsList,
}).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UnlinkIdentityInput",
});
export const UnlinkIdentityResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "UnlinkIdentityResponse",
});
export const IdentityPoolTagsListType = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ResourceArn: S.String, TagKeys: IdentityPoolTagsListType }).pipe(T.all(ns, T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceInput",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(ns)).annotate({
    identifier: "UntagResourceResponse",
});
//# Errors
export class InternalErrorException extends S.TaggedErrorClass()("InternalErrorException", { message: S.optional(S.String) }).pipe(C.withServerError) {
}
export class InvalidParameterException extends S.TaggedErrorClass()("InvalidParameterException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class LimitExceededException extends S.TaggedErrorClass()("LimitExceededException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class NotAuthorizedException extends S.TaggedErrorClass()("NotAuthorizedException", { message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class ResourceConflictException extends S.TaggedErrorClass()("ResourceConflictException", { message: S.optional(S.String) }).pipe(C.withConflictError) {
}
export class TooManyRequestsException extends S.TaggedErrorClass()("TooManyRequestsException", { message: S.optional(S.String) }).pipe(C.withThrottlingError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ExternalServiceException extends S.TaggedErrorClass()("ExternalServiceException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class InvalidIdentityPoolConfigurationException extends S.TaggedErrorClass()("InvalidIdentityPoolConfigurationException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class DeveloperUserAlreadyRegisteredException extends S.TaggedErrorClass()("DeveloperUserAlreadyRegisteredException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ConcurrentModificationException extends S.TaggedErrorClass()("ConcurrentModificationException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
/**
 * Creates a new identity pool. The identity pool is a store of user identity
 * information that is specific to your Amazon Web Services account. The keys for
 * `SupportedLoginProviders` are as follows:
 *
 * - Facebook: `graph.facebook.com`
 *
 * - Google: `accounts.google.com`
 *
 * - Sign in With Apple: `appleid.apple.com`
 *
 * - Amazon: `www.amazon.com`
 *
 * - Twitter: `api.twitter.com`
 *
 * - Digits: `www.digits.com`
 *
 * If you don't provide a value for a parameter, Amazon Cognito sets it to its default value.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const createIdentityPool = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateIdentityPoolInput,
    output: IdentityPool,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        LimitExceededException,
        NotAuthorizedException,
        ResourceConflictException,
        TooManyRequestsException,
    ],
}));
/**
 * Deletes identities from an identity pool. You can specify a list of 1-60 identities
 * that you want to delete.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const deleteIdentities = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteIdentitiesInput,
    output: DeleteIdentitiesResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        TooManyRequestsException,
    ],
}));
/**
 * Deletes an identity pool. Once a pool is deleted, users will not be able to
 * authenticate with the pool.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const deleteIdentityPool = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteIdentityPoolInput,
    output: DeleteIdentityPoolResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns metadata related to the given identity, including when the identity was
 * created and any associated linked logins.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const describeIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeIdentityInput,
    output: IdentityDescription,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Gets details about a particular identity pool, including the pool name, ID
 * description, creation date, and current number of users.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const describeIdentityPool = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeIdentityPoolInput,
    output: IdentityPool,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns credentials for the provided identity ID. Any provided logins will be
 * validated against supported login providers. If the token is for
 * `cognito-identity.amazonaws.com`, it will be passed through to Security Token Service with the appropriate role for the token.
 *
 * This is a public API. You do not need any credentials to call this API.
 */
export const getCredentialsForIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCredentialsForIdentityInput,
    output: GetCredentialsForIdentityResponse,
    errors: [
        ExternalServiceException,
        InternalErrorException,
        InvalidIdentityPoolConfigurationException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Generates (or retrieves) IdentityID. Supplying multiple logins will create an
 * implicit linked account.
 *
 * This is a public API. You do not need any credentials to call this API.
 */
export const getId = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetIdInput,
    output: GetIdResponse,
    errors: [
        ExternalServiceException,
        InternalErrorException,
        InvalidParameterException,
        LimitExceededException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Gets the roles for an identity pool.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const getIdentityPoolRoles = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetIdentityPoolRolesInput,
    output: GetIdentityPoolRolesResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Gets an OpenID token, using a known Cognito ID. This known Cognito ID is returned by
 * GetId. You can optionally add additional logins for the identity.
 * Supplying multiple logins creates an implicit link.
 *
 * The OpenID token is valid for 10 minutes.
 *
 * This is a public API. You do not need any credentials to call this API.
 */
export const getOpenIdToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOpenIdTokenInput,
    output: GetOpenIdTokenResponse,
    errors: [
        ExternalServiceException,
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Registers (or retrieves) a Cognito `IdentityId` and an OpenID Connect
 * token for a user authenticated by your backend authentication process. Supplying multiple
 * logins will create an implicit linked account. You can only specify one developer provider
 * as part of the `Logins` map, which is linked to the identity pool. The developer
 * provider is the "domain" by which Cognito will refer to your users.
 *
 * You can use `GetOpenIdTokenForDeveloperIdentity` to create a new identity
 * and to link new logins (that is, user credentials issued by a public provider or developer
 * provider) to an existing identity. When you want to create a new identity, the
 * `IdentityId` should be null. When you want to associate a new login with an
 * existing authenticated/unauthenticated identity, you can do so by providing the existing
 * `IdentityId`. This API will create the identity in the specified
 * `IdentityPoolId`.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const getOpenIdTokenForDeveloperIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOpenIdTokenForDeveloperIdentityInput,
    output: GetOpenIdTokenForDeveloperIdentityResponse,
    errors: [
        DeveloperUserAlreadyRegisteredException,
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Use `GetPrincipalTagAttributeMap` to list all mappings between
 * `PrincipalTags` and user attributes.
 */
export const getPrincipalTagAttributeMap = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPrincipalTagAttributeMapInput,
    output: GetPrincipalTagAttributeMapResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Lists the identities in an identity pool.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const listIdentities = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListIdentitiesInput,
    output: ListIdentitiesResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Lists all of the Cognito identity pools registered for your account.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const listIdentityPools = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListIdentityPoolsInput,
    output: ListIdentityPoolsResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "IdentityPools",
        pageSize: "MaxResults",
    },
}));
/**
 * Lists the tags that are assigned to an Amazon Cognito identity pool.
 *
 * A tag is a label that you can apply to identity pools to categorize and manage them in
 * different ways, such as by purpose, owner, environment, or other criteria.
 *
 * You can use this action up to 10 times per second, per account.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceInput,
    output: ListTagsForResourceResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Retrieves the `IdentityID` associated with a
 * `DeveloperUserIdentifier` or the list of `DeveloperUserIdentifier`
 * values associated with an `IdentityId` for an existing identity. Either
 * `IdentityID` or `DeveloperUserIdentifier` must not be null. If you
 * supply only one of these values, the other value will be searched in the database and
 * returned as a part of the response. If you supply both,
 * `DeveloperUserIdentifier` will be matched against `IdentityID`. If
 * the values are verified against the database, the response returns both values and is the
 * same as the request. Otherwise, a `ResourceConflictException` is
 * thrown.
 *
 * `LookupDeveloperIdentity` is intended for low-throughput control plane
 * operations: for example, to enable customer service to locate an identity ID by username.
 * If you are using it for higher-volume operations such as user authentication, your requests
 * are likely to be throttled. GetOpenIdTokenForDeveloperIdentity is a
 * better option for higher-volume operations for user authentication.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const lookupDeveloperIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: LookupDeveloperIdentityInput,
    output: LookupDeveloperIdentityResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Merges two users having different `IdentityId`s, existing in the same
 * identity pool, and identified by the same developer provider. You can use this action to
 * request that discrete users be merged and identified as a single user in the Cognito
 * environment. Cognito associates the given source user (`SourceUserIdentifier`)
 * with the `IdentityId` of the `DestinationUserIdentifier`. Only
 * developer-authenticated users can be merged. If the users to be merged are associated with
 * the same public provider, but as two different users, an exception will be
 * thrown.
 *
 * The number of linked logins is limited to 20. So, the number of linked logins for the
 * source user, `SourceUserIdentifier`, and the destination user,
 * `DestinationUserIdentifier`, together should not be larger than 20.
 * Otherwise, an exception will be thrown.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const mergeDeveloperIdentities = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: MergeDeveloperIdentitiesInput,
    output: MergeDeveloperIdentitiesResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Sets the roles for an identity pool. These roles are used when making calls to GetCredentialsForIdentity action.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const setIdentityPoolRoles = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SetIdentityPoolRolesInput,
    output: SetIdentityPoolRolesResponse,
    errors: [
        ConcurrentModificationException,
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * You can use this operation to use default (username and clientID) attribute or custom
 * attribute mappings.
 */
export const setPrincipalTagAttributeMap = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SetPrincipalTagAttributeMapInput,
    output: SetPrincipalTagAttributeMapResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Assigns a set of tags to the specified Amazon Cognito identity pool. A tag is a label
 * that you can use to categorize and manage identity pools in different ways, such as by
 * purpose, owner, environment, or other criteria.
 *
 * Each tag consists of a key and value, both of which you define. A key is a general
 * category for more specific values. For example, if you have two versions of an identity
 * pool, one for testing and another for production, you might assign an
 * `Environment` tag key to both identity pools. The value of this key might be
 * `Test` for one identity pool and `Production` for the
 * other.
 *
 * Tags are useful for cost tracking and access control. You can activate your tags so that
 * they appear on the Billing and Cost Management console, where you can track the costs
 * associated with your identity pools. In an IAM policy, you can constrain
 * permissions for identity pools based on specific tags or tag values.
 *
 * You can use this action up to 5 times per second, per account. An identity pool can have
 * as many as 50 tags.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceInput,
    output: TagResourceResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Unlinks a `DeveloperUserIdentifier` from an existing identity. Unlinked
 * developer users will be considered new identities next time they are seen. If, for a given
 * Cognito identity, you remove all federated identities as well as the developer user
 * identifier, the Cognito identity becomes inaccessible.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const unlinkDeveloperIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UnlinkDeveloperIdentityInput,
    output: UnlinkDeveloperIdentityResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Unlinks a federated identity from an existing account. Unlinked logins will be
 * considered new identities next time they are seen. Removing the last linked login will make
 * this identity inaccessible.
 *
 * This is a public API. You do not need any credentials to call this API.
 */
export const unlinkIdentity = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UnlinkIdentityInput,
    output: UnlinkIdentityResponse,
    errors: [
        ExternalServiceException,
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Removes the specified tags from the specified Amazon Cognito identity pool. You can use
 * this action up to 5 times per second, per account
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceInput,
    output: UntagResourceResponse,
    errors: [
        InternalErrorException,
        InvalidParameterException,
        NotAuthorizedException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Updates the configuration of an identity pool.
 *
 * If you don't provide a value for a parameter, Amazon Cognito sets it to its default value.
 *
 * You must use Amazon Web Services developer credentials to call this
 * operation.
 */
export const updateIdentityPool = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: IdentityPool,
    output: IdentityPool,
    errors: [
        ConcurrentModificationException,
        InternalErrorException,
        InvalidParameterException,
        LimitExceededException,
        NotAuthorizedException,
        ResourceConflictException,
        ResourceNotFoundException,
        TooManyRequestsException,
    ],
}));
//# sourceMappingURL=cognito-identity.js.map