Skip to content

CognitoIdentityClient#

Index > CognitoIdentity > CognitoIdentityClient

Auto-generated documentation for CognitoIdentity type annotations stubs module mypy-boto3-cognito-identity.

CognitoIdentityClient#

Type annotations and code completion for boto3.client("cognito-identity"). boto3 documentation

# CognitoIdentityClient usage example

from boto3.session import Session
from mypy_boto3_cognito_identity.client import CognitoIdentityClient

def get_cognito-identity_client() -> CognitoIdentityClient:
    return Session().client("cognito-identity")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("cognito-identity").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("cognito-identity")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.ConcurrentModificationException,
    client.exceptions.DeveloperUserAlreadyRegisteredException,
    client.exceptions.ExternalServiceException,
    client.exceptions.InternalErrorException,
    client.exceptions.InvalidIdentityPoolConfigurationException,
    client.exceptions.InvalidParameterException,
    client.exceptions.LimitExceededException,
    client.exceptions.NotAuthorizedException,
    client.exceptions.ResourceConflictException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.TooManyRequestsException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_cognito_identity.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("cognito-identity").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("cognito-identity").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_identity_pool#

Creates a new identity pool.

Type annotations and code completion for boto3.client("cognito-identity").create_identity_pool method. boto3 documentation

# create_identity_pool method definition

def create_identity_pool(
    self,
    *,
    IdentityPoolName: str,
    AllowUnauthenticatedIdentities: bool,
    AllowClassicFlow: bool = ...,
    SupportedLoginProviders: Mapping[str, str] = ...,
    DeveloperProviderName: str = ...,
    OpenIdConnectProviderARNs: Sequence[str] = ...,
    CognitoIdentityProviders: Sequence[CognitoIdentityProviderTypeDef] = ...,  # (1)
    SamlProviderARNs: Sequence[str] = ...,
    IdentityPoolTags: Mapping[str, str] = ...,
) -> IdentityPoolTypeDef:  # (2)
    ...
  1. See CognitoIdentityProviderTypeDef
  2. See IdentityPoolTypeDef
# create_identity_pool method usage example with argument unpacking

kwargs: CreateIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolName": ...,
    "AllowUnauthenticatedIdentities": ...,
}

parent.create_identity_pool(**kwargs)
  1. See CreateIdentityPoolInputRequestTypeDef

delete_identities#

Deletes identities from an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").delete_identities method. boto3 documentation

# delete_identities method definition

def delete_identities(
    self,
    *,
    IdentityIdsToDelete: Sequence[str],
) -> DeleteIdentitiesResponseTypeDef:  # (1)
    ...
  1. See DeleteIdentitiesResponseTypeDef
# delete_identities method usage example with argument unpacking

kwargs: DeleteIdentitiesInputRequestTypeDef = {  # (1)
    "IdentityIdsToDelete": ...,
}

parent.delete_identities(**kwargs)
  1. See DeleteIdentitiesInputRequestTypeDef

delete_identity_pool#

Deletes an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").delete_identity_pool method. boto3 documentation

# delete_identity_pool method definition

def delete_identity_pool(
    self,
    *,
    IdentityPoolId: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_identity_pool method usage example with argument unpacking

kwargs: DeleteIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.delete_identity_pool(**kwargs)
  1. See DeleteIdentityPoolInputRequestTypeDef

describe_identity#

Returns metadata related to the given identity, including when the identity was created and any associated linked logins.

Type annotations and code completion for boto3.client("cognito-identity").describe_identity method. boto3 documentation

# describe_identity method definition

def describe_identity(
    self,
    *,
    IdentityId: str,
) -> IdentityDescriptionResponseTypeDef:  # (1)
    ...
  1. See IdentityDescriptionResponseTypeDef
# describe_identity method usage example with argument unpacking

kwargs: DescribeIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.describe_identity(**kwargs)
  1. See DescribeIdentityInputRequestTypeDef

describe_identity_pool#

Gets details about a particular identity pool, including the pool name, ID description, creation date, and current number of users.

Type annotations and code completion for boto3.client("cognito-identity").describe_identity_pool method. boto3 documentation

# describe_identity_pool method definition

def describe_identity_pool(
    self,
    *,
    IdentityPoolId: str,
) -> IdentityPoolTypeDef:  # (1)
    ...
  1. See IdentityPoolTypeDef
# describe_identity_pool method usage example with argument unpacking

kwargs: DescribeIdentityPoolInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.describe_identity_pool(**kwargs)
  1. See DescribeIdentityPoolInputRequestTypeDef

generate_presigned_url#

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("cognito-identity").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_credentials_for_identity#

Returns credentials for the provided identity ID.

Type annotations and code completion for boto3.client("cognito-identity").get_credentials_for_identity method. boto3 documentation

# get_credentials_for_identity method definition

def get_credentials_for_identity(
    self,
    *,
    IdentityId: str,
    Logins: Mapping[str, str] = ...,
    CustomRoleArn: str = ...,
) -> GetCredentialsForIdentityResponseTypeDef:  # (1)
    ...
  1. See GetCredentialsForIdentityResponseTypeDef
# get_credentials_for_identity method usage example with argument unpacking

kwargs: GetCredentialsForIdentityInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.get_credentials_for_identity(**kwargs)
  1. See GetCredentialsForIdentityInputRequestTypeDef

get_id#

Generates (or retrieves) a Cognito ID.

Type annotations and code completion for boto3.client("cognito-identity").get_id method. boto3 documentation

# get_id method definition

def get_id(
    self,
    *,
    IdentityPoolId: str,
    AccountId: str = ...,
    Logins: Mapping[str, str] = ...,
) -> GetIdResponseTypeDef:  # (1)
    ...
  1. See GetIdResponseTypeDef
# get_id method usage example with argument unpacking

kwargs: GetIdInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.get_id(**kwargs)
  1. See GetIdInputRequestTypeDef

get_identity_pool_roles#

Gets the roles for an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").get_identity_pool_roles method. boto3 documentation

# get_identity_pool_roles method definition

def get_identity_pool_roles(
    self,
    *,
    IdentityPoolId: str,
) -> GetIdentityPoolRolesResponseTypeDef:  # (1)
    ...
  1. See GetIdentityPoolRolesResponseTypeDef
# get_identity_pool_roles method usage example with argument unpacking

kwargs: GetIdentityPoolRolesInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
}

parent.get_identity_pool_roles(**kwargs)
  1. See GetIdentityPoolRolesInputRequestTypeDef

get_open_id_token#

Gets an OpenID token, using a known Cognito ID.

Type annotations and code completion for boto3.client("cognito-identity").get_open_id_token method. boto3 documentation

# get_open_id_token method definition

def get_open_id_token(
    self,
    *,
    IdentityId: str,
    Logins: Mapping[str, str] = ...,
) -> GetOpenIdTokenResponseTypeDef:  # (1)
    ...
  1. See GetOpenIdTokenResponseTypeDef
# get_open_id_token method usage example with argument unpacking

kwargs: GetOpenIdTokenInputRequestTypeDef = {  # (1)
    "IdentityId": ...,
}

parent.get_open_id_token(**kwargs)
  1. See GetOpenIdTokenInputRequestTypeDef

get_open_id_token_for_developer_identity#

Registers (or retrieves) a Cognito IdentityId and an OpenID Connect token for a user authenticated by your backend authentication process.

Type annotations and code completion for boto3.client("cognito-identity").get_open_id_token_for_developer_identity method. boto3 documentation

# get_open_id_token_for_developer_identity method definition

def get_open_id_token_for_developer_identity(
    self,
    *,
    IdentityPoolId: str,
    Logins: Mapping[str, str],
    IdentityId: str = ...,
    PrincipalTags: Mapping[str, str] = ...,
    TokenDuration: int = ...,
) -> GetOpenIdTokenForDeveloperIdentityResponseTypeDef:  # (1)
    ...
  1. See GetOpenIdTokenForDeveloperIdentityResponseTypeDef
# get_open_id_token_for_developer_identity method usage example with argument unpacking

kwargs: GetOpenIdTokenForDeveloperIdentityInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "Logins": ...,
}

parent.get_open_id_token_for_developer_identity(**kwargs)
  1. See GetOpenIdTokenForDeveloperIdentityInputRequestTypeDef

get_principal_tag_attribute_map#

Use GetPrincipalTagAttributeMap to list all mappings between PrincipalTags and user attributes.

Type annotations and code completion for boto3.client("cognito-identity").get_principal_tag_attribute_map method. boto3 documentation

# get_principal_tag_attribute_map method definition

def get_principal_tag_attribute_map(
    self,
    *,
    IdentityPoolId: str,
    IdentityProviderName: str,
) -> GetPrincipalTagAttributeMapResponseTypeDef:  # (1)
    ...
  1. See GetPrincipalTagAttributeMapResponseTypeDef
# get_principal_tag_attribute_map method usage example with argument unpacking

kwargs: GetPrincipalTagAttributeMapInputRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityProviderName": ...,
}

parent.get_principal_tag_attribute_map(**kwargs)
  1. See GetPrincipalTagAttributeMapInputRequestTypeDef

list_identities#

Lists the identities in an identity pool.

Type annotations and code completion for boto3.client("cognito-identity").list_identities