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.