Skip to content

create_batch_import_job async

create_batch_import_job(
    job_id: identifier,
    input_path: s3BucketLocation,
    output_path: s3BucketLocation,
    event_type_name: identifier,
    iam_role_arn: iamRoleArn,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    tags: Optional[tagList] = None,
) -> CreateBatchImportJobResult

Creates a batch import job.

Parameters:

  • job_id (identifier) –

    The ID of the batch import job. The ID cannot be of a past job, unless the job exists in CREATE_FAILED state.

  • input_path (s3BucketLocation) –

    The URI that points to the Amazon S3 location of your data file.

  • output_path (s3BucketLocation) –

    The URI that points to the Amazon S3 location for storing your results.

  • event_type_name (identifier) –

    The name of the event type.

  • iam_role_arn (iamRoleArn) –

    The ARN of the IAM role created for Amazon S3 bucket that holds your data file.

    The IAM role must have read permissions to your input S3 bucket and write permissions to your output S3 bucket. For more information about bucket permissions, see User policy examples in the Amazon S3 User Guide.

  • tags (Optional[tagList], default: None ) –

    A collection of key-value pairs associated with this request.

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • InternalServerException –

    An exception indicating an internal server error.

  • ResourceNotFoundException –

    An exception indicating the specified resource was not found.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

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

Source code in docs_src/capo_frauddetector/_services/async_fraud_detector.py
async def create_batch_import_job(
    self,
    job_id: "capo_frauddetector.types.identifier.identifier",
    input_path: "capo_frauddetector.types.s3_bucket_location.s3BucketLocation",
    output_path: "capo_frauddetector.types.s3_bucket_location.s3BucketLocation",
    event_type_name: "capo_frauddetector.types.identifier.identifier",
    iam_role_arn: "capo_frauddetector.types.iam_role_arn.iamRoleArn",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
) -> "capo_frauddetector.types.create_batch_import_job_result.CreateBatchImportJobResult":
    """<p>Creates a batch import job. </p>

    Args:
        job_id: <p>The ID of the batch import job. The ID cannot be of a past job, unless the job exists in <code>CREATE_FAILED</code> state.</p>
        input_path: <p>The URI that points to the Amazon S3 location of your data file.</p>
        output_path: <p>The URI that points to the Amazon S3 location for storing your results. </p>
        event_type_name: <p>The name of the event type.</p>
        iam_role_arn: <p>The ARN of the IAM role created for Amazon S3 bucket that holds your data file.</p> <p>The IAM role must have read permissions to your input S3 bucket and write permissions to your output S3 bucket. For more information about bucket permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html">User policy examples</a> in the <i>Amazon S3 User Guide</i>.</p>
        tags: <p>A collection of key-value pairs associated with this request. </p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception indicating the specified resource was not found.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_frauddetector.types.create_batch_import_job_request.CreateBatchImportJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.create_batch_import_job_result.CreateBatchImportJobResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.create_batch_import_job

        (
            output,
            http_response,
        ) = await capo_frauddetector._operations.aws_hawks_nest_service_facade.create_batch_import_job.async_create_batch_import_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateBatchImportJob")
    )
    input_: capo_frauddetector.types.create_batch_import_job_request.CreateBatchImportJobRequest = {
        "job_id": job_id,
        "input_path": input_path,
        "output_path": output_path,
        "event_type_name": event_type_name,
        "iam_role_arn": iam_role_arn,
    }
    if tags is not None:
        input_["tags"] = tags

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