Skip to content

list_realtime_contact_analysis_segments_v2 async

list_realtime_contact_analysis_segments_v2(
    instance_id: InstanceId,
    contact_id: ContactId,
    output_type: RealTimeContactAnalysisOutputType,
    segment_types: RealTimeContactAnalysisSegmentTypes,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    max_results: Optional[MaxResult100] = None,
    next_token: Optional[LargeNextToken] = None,
) -> ListRealtimeContactAnalysisSegmentsV2Response

Provides a list of analysis segments for a real-time chat analysis session. This API supports CHAT channels only.

This API does not support VOICE. If you attempt to use it for VOICE, an InvalidRequestException occurs.

Parameters:

  • instance_id (InstanceId) –

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • contact_id (ContactId) –

    The identifier of the contact in this instance of Connect Customer.

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

    The maximum number of results to return per page.

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

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • output_type (RealTimeContactAnalysisOutputType) –

    The Contact Lens output type to be returned.

  • segment_types (RealTimeContactAnalysisSegmentTypes) –

    Enum with segment types . Each value corresponds to a segment type returned in the segments list of the API. Each segment type has its own structure. Different channels may have different sets of supported segment types.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def list_realtime_contact_analysis_segments_v2(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    output_type: "capo_connect.types.real_time_contact_analysis_output_type.RealTimeContactAnalysisOutputType",
    segment_types: "capo_connect.types.real_time_contact_analysis_segment_types.RealTimeContactAnalysisSegmentTypes",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    max_results: Optional["capo_connect.types.max_result100.MaxResult100"] = None,
    next_token: Optional[
        "capo_connect.types.large_next_token.LargeNextToken"
    ] = None,
) -> "capo_connect.types.list_realtime_contact_analysis_segments_v2_response.ListRealtimeContactAnalysisSegmentsV2Response":
    """<p>Provides a list of analysis segments for a real-time chat analysis session. This API supports CHAT channels only. </p> <important> <p>This API does not support VOICE. If you attempt to use it for VOICE, an <code>InvalidRequestException</code> occurs.</p> </important>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
        contact_id: <p>The identifier of the contact in this instance of Connect Customer. </p>
        max_results: <p>The maximum number of results to return per page.</p>
        next_token: <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
        output_type: <p>The Contact Lens output type to be returned.</p>
        segment_types: <p>Enum with segment types . Each value corresponds to a segment type returned in the segments list of the API. Each segment type has its own structure. Different channels may have different sets of supported segment types.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.output_type_not_found_exception.OutputTypeNotFoundException: <p>Thrown for analyzed content when requested OutputType was not enabled for a given contact. For example, if an OutputType.Raw was requested for a contact that had `RedactedOnly` Redaction policy set in the flow.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.list_realtime_contact_analysis_segments_v2_request.ListRealtimeContactAnalysisSegmentsV2Request]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.list_realtime_contact_analysis_segments_v2_response.ListRealtimeContactAnalysisSegmentsV2Response"
    ]:
        import capo_connect._operations.amazon_connect_service.list_realtime_contact_analysis_segments_v2

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.list_realtime_contact_analysis_segments_v2.async_list_realtime_contact_analysis_segments_v2(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRealtimeContactAnalysisSegmentsV2")
    )
    input_: capo_connect.types.list_realtime_contact_analysis_segments_v2_request.ListRealtimeContactAnalysisSegmentsV2Request = {
        "instance_id": instance_id,
        "contact_id": contact_id,
        "output_type": output_type,
        "segment_types": segment_types,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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