Skip to content

start_speaker_enrollment_job async

start_speaker_enrollment_job(
    domain_id: DomainId,
    data_access_role_arn: IamRoleArn,
    input_data_config: InputDataConfig,
    output_data_config: OutputDataConfig,
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = None,
    client_token: Optional[ClientTokenString] = None,
    job_name: Optional[JobName] = None,
    enrollment_config: Optional[EnrollmentConfig] = None,
) -> StartSpeakerEnrollmentJobResponse

Starts a new batch speaker enrollment job using specified details.

Parameters:

  • client_token (Optional[ClientTokenString], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

  • job_name (Optional[JobName], default: None ) –

    A name for your speaker enrollment job.

  • domain_id (DomainId) –

    The identifier of the domain that contains the speaker enrollment job and in which the speakers are enrolled.

  • data_access_role_arn (IamRoleArn) –

    The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets to read the input manifest file and write the job output file. Refer to Batch enrollment using audio data from prior calls for the permissions needed in this role.

  • enrollment_config (Optional[EnrollmentConfig], default: None ) –

    The enrollment config that contains details such as the action to take when a speaker is already enrolled in Voice ID or when a speaker is identified as a fraudster.

  • input_data_config (InputDataConfig) –

    The input data config containing the S3 location for the input manifest file that contains the list of speaker enrollment requests.

  • output_data_config (OutputDataConfig) –

    The output data config containing the S3 location where Voice ID writes the job output file; you must also include a KMS key ID to encrypt the file.

Raises:

Source code in docs_src/capo_voice_id/_services/async_voice_id.py
async def start_speaker_enrollment_job(
    self,
    domain_id: "capo_voice_id.types.domain_id.DomainId",
    data_access_role_arn: "capo_voice_id.types.iam_role_arn.IamRoleArn",
    input_data_config: "capo_voice_id.types.input_data_config.InputDataConfig",
    output_data_config: "capo_voice_id.types.output_data_config.OutputDataConfig",
    *,
    config_overrides: Optional[AsyncVoiceIDClientConfig] = None,
    client_token: Optional[
        "capo_voice_id.types.client_token_string.ClientTokenString"
    ] = None,
    job_name: Optional["capo_voice_id.types.job_name.JobName"] = None,
    enrollment_config: Optional[
        "capo_voice_id.types.enrollment_config.EnrollmentConfig"
    ] = None,
) -> "capo_voice_id.types.start_speaker_enrollment_job_response.StartSpeakerEnrollmentJobResponse":
    """<p>Starts a new batch speaker enrollment job using specified details.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        job_name: <p>A name for your speaker enrollment job.</p>
        domain_id: <p>The identifier of the domain that contains the speaker enrollment job and in which the speakers are enrolled. </p>
        data_access_role_arn: <p>The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions to access customer's buckets to read the input manifest file and write the job output file. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-batch-enrollment.html">Batch enrollment using audio data from prior calls</a> for the permissions needed in this role.</p>
        enrollment_config: <p>The enrollment config that contains details such as the action to take when a speaker is already enrolled in Voice ID or when a speaker is identified as a fraudster.</p>
        input_data_config: <p>The input data config containing the S3 location for the input manifest file that contains the list of speaker enrollment requests.</p>
        output_data_config: <p>The output data config containing the S3 location where Voice ID writes the job output file; you must also include a KMS key ID to encrypt the file.</p>

    Raises:
        capo_voice_id.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. Check the error message and try again.</p>
        capo_voice_id.errors.conflict_exception.ConflictException: <p>The request failed due to a conflict. Check the <code>ConflictType</code> and error message for more details.</p>
        capo_voice_id.errors.internal_server_exception.InternalServerException: <p>The request failed due to an unknown error on the server side.</p>
        capo_voice_id.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found. Check the <code>ResourceType</code> and error message for more details.</p>
        capo_voice_id.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded the service quota. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#voiceid-quotas">Voice ID Service Quotas</a> and try your request again.</p>
        capo_voice_id.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Please slow down your request rate. Refer to <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html##voiceid-api-quotas"> Amazon Connect Voice ID Service API throttling quotas </a> and try your request again.</p>
        capo_voice_id.errors.validation_exception.ValidationException: <p>The request failed one or more validations; check the error message for more details.</p>
        capo_voice_id.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_voice_id.types.start_speaker_enrollment_job_request.StartSpeakerEnrollmentJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_voice_id.types.start_speaker_enrollment_job_response.StartSpeakerEnrollmentJobResponse"
    ]:
        import capo_voice_id._operations.voice_id.start_speaker_enrollment_job

        (
            output,
            http_response,
        ) = await capo_voice_id._operations.voice_id.start_speaker_enrollment_job.async_start_speaker_enrollment_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_voice_id.types.start_speaker_enrollment_job_request.StartSpeakerEnrollmentJobRequest",
    ) -> dict[str, Any]:
        import capo_voice_id.types.start_speaker_enrollment_job_request

        return capo_voice_id.types.start_speaker_enrollment_job_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_voice_id.types.start_speaker_enrollment_job_response.StartSpeakerEnrollmentJobResponse",
    ) -> dict[str, Any]:
        import capo_voice_id.types.start_speaker_enrollment_job_response

        return capo_voice_id.types.start_speaker_enrollment_job_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartSpeakerEnrollmentJob",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_voice_id.types.start_speaker_enrollment_job_request.StartSpeakerEnrollmentJobRequest = {
        "domain_id": domain_id,
        "data_access_role_arn": data_access_role_arn,
        "input_data_config": input_data_config,
        "output_data_config": output_data_config,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if job_name is not None:
        input_["job_name"] = job_name
    if enrollment_config is not None:
        input_["enrollment_config"] = enrollment_config

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