set_cognito_events(
identity_pool_id: IdentityPoolId,
events: Events,
*,
config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> None
Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.
This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.
Parameters:
-
identity_pool_id
(IdentityPoolId)
–
The Cognito Identity Pool to use when configuring Cognito Events
-
events
(Events)
–
Raises:
Source code in docs_src/capo_cognito_sync/_services/async_cognito_sync.py
| async def set_cognito_events(
self,
identity_pool_id: "capo_cognito_sync.types.identity_pool_id.IdentityPoolId",
events: "capo_cognito_sync.types.events.Events",
*,
config_overrides: Optional[AsyncCognitoSyncClientConfig] = None,
) -> None:
"""<p>Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.</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>
Args:
identity_pool_id: <p>The Cognito Identity Pool to use when configuring Cognito Events</p>
events: <p>The events to configure</p>
Raises:
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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cognito_sync.types.set_cognito_events_request.SetCognitoEventsRequest]",
) -> AsyncOperationResponse[None]:
import capo_cognito_sync._operations.aws_cognito_sync_service.set_cognito_events
(
output,
http_response,
) = await capo_cognito_sync._operations.aws_cognito_sync_service.set_cognito_events.async_set_cognito_events(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SetCognitoEvents")
)
input_: capo_cognito_sync.types.set_cognito_events_request.SetCognitoEventsRequest = {
"identity_pool_id": identity_pool_id,
"events": events,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|