Skip to content

channel_flow_callback async

channel_flow_callback(
    callback_id: CallbackIdType,
    channel_arn: ChimeArn,
    channel_message: ChannelMessageCallback,
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    delete_resource: Optional[NonNullableBoolean] = None,
) -> ChannelFlowCallbackResponse

Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.

You can return one of the following processing responses:

  • Update message content or metadata

  • Deny a message

  • Make no changes to the message

Parameters:

  • callback_id (CallbackIdType) –

    The identifier passed to the processor by the service when invoked. Use the identifier to call back the service.

  • channel_arn (ChimeArn) –

    The ARN of the channel.

  • delete_resource (Optional[NonNullableBoolean], default: None ) –

    When a processor determines that a message needs to be DENIED, pass this parameter with a value of true.

  • channel_message (ChannelMessageCallback) –

    Stores information about the processed message.

Raises:

Source code in docs_src/capo_chime_sdk_messaging/_services/async_chime_sdk_messaging.py
async def channel_flow_callback(
    self,
    callback_id: "capo_chime_sdk_messaging.types.callback_id_type.CallbackIdType",
    channel_arn: "capo_chime_sdk_messaging.types.chime_arn.ChimeArn",
    channel_message: "capo_chime_sdk_messaging.types.channel_message_callback.ChannelMessageCallback",
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    delete_resource: Optional[
        "capo_chime_sdk_messaging.types.non_nullable_boolean.NonNullableBoolean"
    ] = None,
) -> "capo_chime_sdk_messaging.types.channel_flow_callback_response.ChannelFlowCallbackResponse":
    """<p>Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.</p> <p>You can return one of the following processing responses:</p> <ul> <li> <p>Update message content or metadata</p> </li> <li> <p>Deny a message</p> </li> <li> <p>Make no changes to the message</p> </li> </ul>

    Args:
        callback_id: <p>The identifier passed to the processor by the service when invoked. Use the identifier to call back the service.</p>
        channel_arn: <p>The ARN of the channel.</p>
        delete_resource: <p>When a processor determines that a message needs to be <code>DENIED</code>, pass this parameter with a value of true.</p>
        channel_message: <p>Stores information about the processed message.</p>

    Raises:
        capo_chime_sdk_messaging.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_messaging.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
        capo_chime_sdk_messaging.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_messaging.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_messaging.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_messaging.errors.throttled_client_exception.ThrottledClientException: <p>The client exceeded its request rate limit.</p>
        capo_chime_sdk_messaging.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client is not currently authorized to make the request.</p>
        capo_chime_sdk_messaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chime_sdk_messaging.types.channel_flow_callback_request.ChannelFlowCallbackRequest]",
    ) -> AsyncOperationResponse[
        "capo_chime_sdk_messaging.types.channel_flow_callback_response.ChannelFlowCallbackResponse"
    ]:
        import capo_chime_sdk_messaging._operations.chime_messaging_service.channel_flow_callback

        (
            output,
            http_response,
        ) = await capo_chime_sdk_messaging._operations.chime_messaging_service.channel_flow_callback.async_channel_flow_callback(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_chime_sdk_messaging.types.channel_flow_callback_request.ChannelFlowCallbackRequest",
    ) -> dict[str, Any]:
        import capo_chime_sdk_messaging.types.channel_flow_callback_request

        return capo_chime_sdk_messaging.types.channel_flow_callback_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ChannelFlowCallback", redact_input=_redact_input),
    )
    input_: capo_chime_sdk_messaging.types.channel_flow_callback_request.ChannelFlowCallbackRequest = {
        "callback_id": callback_id,
        "channel_arn": channel_arn,
        "channel_message": channel_message,
    }
    if delete_resource is not None:
        input_["delete_resource"] = delete_resource

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output