Skip to content

CognitoSyncClient#

Index > CognitoSync > CognitoSyncClient

Auto-generated documentation for CognitoSync type annotations stubs module mypy-boto3-cognito-sync.

CognitoSyncClient#

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

# CognitoSyncClient usage example

from boto3.session import Session
from mypy_boto3_cognito_sync.client import CognitoSyncClient

def get_cognito-sync_client() -> CognitoSyncClient:
    return Session().client("cognito-sync")

Exceptions#

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

# Exceptions.exceptions usage example

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

try:
    do_something(client)
except (
    client.exceptions.AlreadyStreamedException,
    client.exceptions.ClientError,
    client.exceptions.ConcurrentModificationException,
    client.exceptions.DuplicateRequestException,
    client.exceptions.InternalErrorException,
    client.exceptions.InvalidConfigurationException,
    client.exceptions.InvalidLambdaFunctionOutputException,
    client.exceptions.InvalidParameterException,
    client.exceptions.LambdaThrottledException,
    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_sync.client import Exceptions

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

Methods#

bulk_publish#

Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream.

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

# bulk_publish method definition

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

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

parent.bulk_publish(**kwargs)
  1. See BulkPublishRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("cognito-sync").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-sync").close method. boto3 documentation

# close method definition

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

delete_dataset#

Deletes the specific dataset.

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

# delete_dataset method definition

def delete_dataset(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
) -> DeleteDatasetResponseTypeDef:  # (1)
    ...
  1. See DeleteDatasetResponseTypeDef
# delete_dataset method usage example with argument unpacking

kwargs: DeleteDatasetRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
}

parent.delete_dataset(**kwargs)
  1. See DeleteDatasetRequestRequestTypeDef

describe_dataset#

Gets meta data about a dataset by identity and dataset name.

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

# describe_dataset method definition

def describe_dataset(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
) -> DescribeDatasetResponseTypeDef:  # (1)
    ...
  1. See DescribeDatasetResponseTypeDef
# describe_dataset method usage example with argument unpacking

kwargs: DescribeDatasetRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
}

parent.describe_dataset(**kwargs)
  1. See DescribeDatasetRequestRequestTypeDef

describe_identity_pool_usage#

Gets usage details (for example, data storage) about a particular identity pool.

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

# describe_identity_pool_usage method definition

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

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

parent.describe_identity_pool_usage(**kwargs)
  1. See DescribeIdentityPoolUsageRequestRequestTypeDef

describe_identity_usage#

Gets usage information for an identity, including number of datasets and data usage.

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

# describe_identity_usage method definition

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

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

parent.describe_identity_usage(**kwargs)
  1. See DescribeIdentityUsageRequestRequestTypeDef

generate_presigned_url#

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

Type annotations and code completion for boto3.client("cognito-sync").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_bulk_publish_details#

Get the status of the last BulkPublish operation for an identity pool.

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

# get_bulk_publish_details method definition

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

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

parent.get_bulk_publish_details(**kwargs)
  1. See GetBulkPublishDetailsRequestRequestTypeDef

get_cognito_events#

Gets the events and the corresponding Lambda functions associated with an identity pool.

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

# get_cognito_events method definition

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

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

parent.get_cognito_events(**kwargs)
  1. See GetCognitoEventsRequestRequestTypeDef

get_identity_pool_configuration#

Gets the configuration settings of an identity pool.

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

# get_identity_pool_configuration method definition

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

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

parent.get_identity_pool_configuration(**kwargs)
  1. See GetIdentityPoolConfigurationRequestRequestTypeDef

list_datasets#

Lists datasets for an identity.

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

# list_datasets method definition

def list_datasets(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListDatasetsResponseTypeDef:  # (1)
    ...
  1. See ListDatasetsResponseTypeDef
# list_datasets method usage example with argument unpacking

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

parent.list_datasets(**kwargs)
  1. See ListDatasetsRequestRequestTypeDef

list_identity_pool_usage#

Gets a list of identity pools registered with Cognito.

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

# list_identity_pool_usage method definition

def list_identity_pool_usage(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListIdentityPoolUsageResponseTypeDef:  # (1)
    ...
  1. See ListIdentityPoolUsageResponseTypeDef
# list_identity_pool_usage method usage example with argument unpacking

kwargs: ListIdentityPoolUsageRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_identity_pool_usage(**kwargs)
  1. See ListIdentityPoolUsageRequestRequestTypeDef

list_records#

Gets paginated records, optionally changed after a particular sync count for a dataset and identity.

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

# list_records method definition

def list_records(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
    LastSyncCount: int = ...,
    NextToken: str = ...,
    MaxResults: int = ...,
    SyncSessionToken: str = ...,
) -> ListRecordsResponseTypeDef:  # (1)
    ...
  1. See ListRecordsResponseTypeDef
# list_records method usage example with argument unpacking

kwargs: ListRecordsRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
}

parent.list_records(**kwargs)
  1. See ListRecordsRequestRequestTypeDef

register_device#

Registers a device to receive push sync notifications.

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

# register_device method definition

def register_device(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    Platform: PlatformType,  # (1)
    Token: str,
) -> RegisterDeviceResponseTypeDef:  # (2)
    ...
  1. See PlatformType
  2. See RegisterDeviceResponseTypeDef
# register_device method usage example with argument unpacking

kwargs: RegisterDeviceRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "Platform": ...,
    "Token": ...,
}

parent.register_device(**kwargs)
  1. See RegisterDeviceRequestRequestTypeDef

set_cognito_events#

Sets the AWS Lambda function for a given event type for an identity pool.

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

# set_cognito_events method definition

def set_cognito_events(
    self,
    *,
    IdentityPoolId: str,
    Events: Mapping[str, str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# set_cognito_events method usage example with argument unpacking

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

parent.set_cognito_events(**kwargs)
  1. See SetCognitoEventsRequestRequestTypeDef

set_identity_pool_configuration#

Sets the necessary configuration for push sync.

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

# set_identity_pool_configuration method definition

def set_identity_pool_configuration(
    self,
    *,
    IdentityPoolId: str,
    PushSync: PushSyncTypeDef = ...,  # (1)
    CognitoStreams: CognitoStreamsTypeDef = ...,  # (2)
) -> SetIdentityPoolConfigurationResponseTypeDef:  # (3)
    ...
  1. See PushSyncTypeDef
  2. See CognitoStreamsTypeDef
  3. See SetIdentityPoolConfigurationResponseTypeDef
# set_identity_pool_configuration method usage example with argument unpacking

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

parent.set_identity_pool_configuration(**kwargs)
  1. See SetIdentityPoolConfigurationRequestRequestTypeDef

subscribe_to_dataset#

Subscribes to receive notifications when a dataset is modified by another device.

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

# subscribe_to_dataset method definition

def subscribe_to_dataset(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
    DeviceId: str,
) -> Dict[str, Any]:
    ...
# subscribe_to_dataset method usage example with argument unpacking

kwargs: SubscribeToDatasetRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
    "DeviceId": ...,
}

parent.subscribe_to_dataset(**kwargs)
  1. See SubscribeToDatasetRequestRequestTypeDef

unsubscribe_from_dataset#

Unsubscribes from receiving notifications when a dataset is modified by another device.

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

# unsubscribe_from_dataset method definition

def unsubscribe_from_dataset(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
    DeviceId: str,
) -> Dict[str, Any]:
    ...
# unsubscribe_from_dataset method usage example with argument unpacking

kwargs: UnsubscribeFromDatasetRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
    "DeviceId": ...,
}

parent.unsubscribe_from_dataset(**kwargs)
  1. See UnsubscribeFromDatasetRequestRequestTypeDef

update_records#

Posts updates to records and adds and deletes records for a dataset and user.

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

# update_records method definition

def update_records(
    self,
    *,
    IdentityPoolId: str,
    IdentityId: str,
    DatasetName: str,
    SyncSessionToken: str,
    DeviceId: str = ...,
    RecordPatches: Sequence[RecordPatchTypeDef] = ...,  # (1)
    ClientContext: str = ...,
) -> UpdateRecordsResponseTypeDef:  # (2)
    ...
  1. See RecordPatchTypeDef
  2. See UpdateRecordsResponseTypeDef
# update_records method usage example with argument unpacking

kwargs: UpdateRecordsRequestRequestTypeDef = {  # (1)
    "IdentityPoolId": ...,
    "IdentityId": ...,
    "DatasetName": ...,
    "SyncSessionToken": ...,
}

parent.update_records(**kwargs)
  1. See UpdateRecordsRequestRequestTypeDef