Skip to content

stop_contact_recording async

stop_contact_recording(
    instance_id: InstanceId,
    contact_id: ContactId,
    initial_contact_id: ContactId,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    contact_recording_type: Optional[ContactRecordingType] = None,
) -> StopContactRecordingResponse

Stops recording a call when a contact is being recorded. StopContactRecording is a one-time action. If you use StopContactRecording to stop recording an ongoing call, you can't use StartContactRecording to restart it. For scenarios where the recording has started and you want to suspend it for sensitive information (for example, to collect a credit card number), and then restart it, use SuspendContactRecording and ResumeContactRecording.

Only voice recordings are supported at this time.

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.

  • initial_contact_id (ContactId) –

    The identifier of the contact. This is the identifier of the contact associated with the first interaction with the contact center.

  • contact_recording_type (Optional[ContactRecordingType], default: None ) –

    The type of recording being operated on.

Raises:

  • InternalServiceException –

    Request processing failed because of an error or failure with the service.

  • InvalidActiveRegionException –

    This exception occurs when an API request is made to a non-active region in an Amazon Connect instance configured with Amazon Connect Global Resiliency. For example, if the active region is US West (Oregon) and a request is made to US East (N. Virginia), the exception will be returned.

  • InvalidRequestException –

    The request is not valid.

  • ResourceNotFoundException –

    The specified resource was not found.

  • UnknownServiceError –

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

Source code in docs_src/capo_connect/_services/async_connect.py
async def stop_contact_recording(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    contact_id: "capo_connect.types.contact_id.ContactId",
    initial_contact_id: "capo_connect.types.contact_id.ContactId",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    contact_recording_type: Optional[
        "capo_connect.types.contact_recording_type.ContactRecordingType"
    ] = None,
) -> "capo_connect.types.stop_contact_recording_response.StopContactRecordingResponse":
    """<p>Stops recording a call when a contact is being recorded. StopContactRecording is a one-time action. If you use StopContactRecording to stop recording an ongoing call, you can't use StartContactRecording to restart it. For scenarios where the recording has started and you want to suspend it for sensitive information (for example, to collect a credit card number), and then restart it, use SuspendContactRecording and ResumeContactRecording.</p> <p>Only voice recordings are supported at this time.</p>

    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.</p>
        initial_contact_id: <p>The identifier of the contact. This is the identifier of the contact associated with the first interaction with the contact center.</p>
        contact_recording_type: <p>The type of recording being operated on.</p>

    Raises:
        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_active_region_exception.InvalidActiveRegionException: <p>This exception occurs when an API request is made to a non-active region in an Amazon Connect instance configured with Amazon Connect Global Resiliency. For example, if the active region is US West (Oregon) and a request is made to US East (N. Virginia), the exception will be returned.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.stop_contact_recording_request.StopContactRecordingRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.stop_contact_recording_response.StopContactRecordingResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.stop_contact_recording

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopContactRecording")
    )
    input_: capo_connect.types.stop_contact_recording_request.StopContactRecordingRequest = {
        "instance_id": instance_id,
        "contact_id": contact_id,
        "initial_contact_id": initial_contact_id,
    }
    if contact_recording_type is not None:
        input_["contact_recording_type"] = contact_recording_type

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