Skip to content

set_identity_pool_configuration

set_identity_pool_configuration(
    identity_pool_id: IdentityPoolId,
    *,
    config_overrides: Optional[CognitoSyncClientConfig] = None,
    push_sync: Optional[PushSync] = None,
    cognito_streams: Optional[CognitoStreams] = None,
) -> SetIdentityPoolConfigurationResponse

Sets the necessary configuration for push sync.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

SetIdentityPoolConfiguration The following examples have been edited for readability. POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZN-REQUESTID: a46db021-f5dd-45d6-af5b-7069fa4a211b X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.SetIdentityPoolConfiguration HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T200006Z AUTHORIZATION: AWS4-HMAC-SHA256 Credential=, SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature= { "Operation": "com.amazonaws.cognito.sync.model#SetIdentityPoolConfiguration", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID", "PushSync": { "ApplicationArns": ["PLATFORMARN1", "PLATFORMARN2"], "RoleArn": "ROLEARN" } } } 1.1 200 OK x-amzn-requestid: a46db021-f5dd-45d6-af5b-7069fa4a211b date: Sat, 04 Oct 2014 20:00:06 GMT content-type: application/json content-length: 332 { "Output": { "__type": "com.amazonaws.cognito.sync.model#SetIdentityPoolConfigurationResponse", "IdentityPoolId": "ID_POOL_ID", "PushSync": { "ApplicationArns": ["PLATFORMARN1", "PLATFORMARN2"], "RoleArn": "ROLEARN" } }, "Version": "1.0" }

Parameters:

  • identity_pool_id (IdentityPoolId) –

    A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.

  • push_sync (Optional[PushSync], default: None ) –

    Options to apply to this identity pool for push synchronization.

  • cognito_streams (Optional[CognitoStreams], default: None ) –

    Options to apply to this identity pool for Amazon Cognito streams.

Raises:

Source code in docs_src/capo_cognito_sync/_services/cognito_sync.py
def set_identity_pool_configuration(
    self,
    identity_pool_id: "capo_cognito_sync.types.identity_pool_id.IdentityPoolId",
    *,
    config_overrides: Optional[CognitoSyncClientConfig] = None,
    push_sync: Optional["capo_cognito_sync.types.push_sync.PushSync"] = None,
    cognito_streams: Optional[
        "capo_cognito_sync.types.cognito_streams.CognitoStreams"
    ] = None,
) -> "capo_cognito_sync.types.set_identity_pool_configuration_response.SetIdentityPoolConfigurationResponse":
    """<p>Sets the necessary configuration for push sync.</p><p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p> <examples> <example> <name>SetIdentityPoolConfiguration</name> <description>The following examples have been edited for readability.</description> <request> POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZN-REQUESTID: a46db021-f5dd-45d6-af5b-7069fa4a211b X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.SetIdentityPoolConfiguration HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T200006Z AUTHORIZATION: AWS4-HMAC-SHA256 Credential=<credential>, SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature=<signature> { "Operation": "com.amazonaws.cognito.sync.model#SetIdentityPoolConfiguration", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID", "PushSync": { "ApplicationArns": ["PLATFORMARN1", "PLATFORMARN2"], "RoleArn": "ROLEARN" } } } </request> <response> 1.1 200 OK x-amzn-requestid: a46db021-f5dd-45d6-af5b-7069fa4a211b date: Sat, 04 Oct 2014 20:00:06 GMT content-type: application/json content-length: 332 { "Output": { "__type": "com.amazonaws.cognito.sync.model#SetIdentityPoolConfigurationResponse", "IdentityPoolId": "ID_POOL_ID", "PushSync": { "ApplicationArns": ["PLATFORMARN1", "PLATFORMARN2"], "RoleArn": "ROLEARN" } }, "Version": "1.0" } </response> </example> </examples>

    Args:
        identity_pool_id: <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.</p>
        push_sync: <p>Options to apply to this identity pool for push synchronization.</p>
        cognito_streams: Options to apply to this identity pool for Amazon Cognito streams.

    Raises:
        capo_cognito_sync.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Thrown if there are parallel requests to modify a resource.</p>
        capo_cognito_sync.errors.internal_error_exception.InternalErrorException: Indicates an internal service error.
        capo_cognito_sync.errors.invalid_parameter_exception.InvalidParameterException: Thrown when a request parameter does not comply with the associated constraints.
        capo_cognito_sync.errors.not_authorized_exception.NotAuthorizedException: Thrown when a user is not authorized to access the requested resource.
        capo_cognito_sync.errors.resource_not_found_exception.ResourceNotFoundException: Thrown if the resource doesn't exist.
        capo_cognito_sync.errors.too_many_requests_exception.TooManyRequestsException: Thrown if the request is throttled.
        capo_cognito_sync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cognito_sync.types.set_identity_pool_configuration_request.SetIdentityPoolConfigurationRequest]",
    ) -> OperationResponse[
        "capo_cognito_sync.types.set_identity_pool_configuration_response.SetIdentityPoolConfigurationResponse"
    ]:
        import capo_cognito_sync._operations.aws_cognito_sync_service.set_identity_pool_configuration

        output, http_response = (
            capo_cognito_sync._operations.aws_cognito_sync_service.set_identity_pool_configuration.set_identity_pool_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetIdentityPoolConfiguration")
    )
    input_: capo_cognito_sync.types.set_identity_pool_configuration_request.SetIdentityPoolConfigurationRequest = {
        "identity_pool_id": identity_pool_id
    }
    if push_sync is not None:
        input_["push_sync"] = push_sync
    if cognito_streams is not None:
        input_["cognito_streams"] = cognito_streams

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output