Skip to content

list_attachments async

list_attachments(
    application_id: ApplicationId,
    *,
    config_overrides: Optional[AsyncQBusinessClientConfig] = None,
    conversation_id: Optional[ConversationId] = None,
    user_id: Optional[UserId] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResultsIntegerForListAttachments] = None,
) -> ListAttachmentsResponse

Gets a list of attachments associated with an Amazon Q Business web experience or a list of attachements associated with a specific Amazon Q Business conversation.

Parameters:

  • application_id (ApplicationId) –

    The unique identifier for the Amazon Q Business application.

  • conversation_id (Optional[ConversationId], default: None ) –

    The unique identifier of the Amazon Q Business web experience conversation.

  • user_id (Optional[UserId], default: None ) –

    The unique identifier of the user involved in the Amazon Q Business web experience conversation.

  • next_token (Optional[NextToken], default: None ) –

    If the number of attachments returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of attachments.

  • max_results (Optional[MaxResultsIntegerForListAttachments], default: None ) –

    The maximum number of attachements to return.

Raises:

  • AccessDeniedException –

    You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.

  • InternalServerException –

    An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.

  • LicenseNotFoundException –

    You don't have permissions to perform the action because your license is inactive. Ask your admin to activate your license and try again after your licence is active.

  • ResourceNotFoundException –

    The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.

  • ThrottlingException –

    The request was denied due to throttling. Reduce the number of requests and try again.

  • ValidationException –

    The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_qbusiness/_services/async_q_business.py
async def list_attachments(
    self,
    application_id: "capo_qbusiness.types.application_id.ApplicationId",
    *,
    config_overrides: Optional[AsyncQBusinessClientConfig] = None,
    conversation_id: Optional[
        "capo_qbusiness.types.conversation_id.ConversationId"
    ] = None,
    user_id: Optional["capo_qbusiness.types.user_id.UserId"] = None,
    next_token: Optional["capo_qbusiness.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_qbusiness.types.max_results_integer_for_list_attachments.MaxResultsIntegerForListAttachments"
    ] = None,
) -> "capo_qbusiness.types.list_attachments_response.ListAttachmentsResponse":
    """<p>Gets a list of attachments associated with an Amazon Q Business web experience or a list of attachements associated with a specific Amazon Q Business conversation.</p>

    Args:
        application_id: <p>The unique identifier for the Amazon Q Business application.</p>
        conversation_id: <p>The unique identifier of the Amazon Q Business web experience conversation.</p>
        user_id: <p>The unique identifier of the user involved in the Amazon Q Business web experience conversation.</p>
        next_token: <p>If the number of attachments returned exceeds <code>maxResults</code>, Amazon Q Business returns a next token as a pagination token to retrieve the next set of attachments.</p>
        max_results: <p>The maximum number of attachements to return.</p>

    Raises:
        capo_qbusiness.errors.access_denied_exception.AccessDeniedException: <p> You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.</p>
        capo_qbusiness.errors.internal_server_exception.InternalServerException: <p>An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
        capo_qbusiness.errors.license_not_found_exception.LicenseNotFoundException: <p>You don't have permissions to perform the action because your license is inactive. Ask your admin to activate your license and try again after your licence is active.</p>
        capo_qbusiness.errors.resource_not_found_exception.ResourceNotFoundException: <p>The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.</p>
        capo_qbusiness.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling. Reduce the number of requests and try again.</p>
        capo_qbusiness.errors.validation_exception.ValidationException: <p>The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.</p>
        capo_qbusiness.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qbusiness.types.list_attachments_request.ListAttachmentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_qbusiness.types.list_attachments_response.ListAttachmentsResponse"
    ]:
        import capo_qbusiness._operations.expert_q.list_attachments

        (
            output,
            http_response,
        ) = await capo_qbusiness._operations.expert_q.list_attachments.async_list_attachments(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAttachments")
    )
    input_: capo_qbusiness.types.list_attachments_request.ListAttachmentsRequest = {
        "application_id": application_id
    }
    if conversation_id is not None:
        input_["conversation_id"] = conversation_id
    if user_id is not None:
        input_["user_id"] = user_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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