Skip to content

create_batch_prediction_job

create_batch_prediction_job(
    job_id: identifier,
    input_path: s3BucketLocation,
    output_path: s3BucketLocation,
    event_type_name: identifier,
    detector_name: identifier,
    iam_role_arn: iamRoleArn,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    detector_version: Optional[wholeNumberVersionString] = None,
    tags: Optional[tagList] = None,
) -> CreateBatchPredictionJobResult

Creates a batch prediction job.

Parameters:

  • job_id (identifier) –

    The ID of the batch prediction job.

  • input_path (s3BucketLocation) –

    The Amazon S3 location of your training file.

  • output_path (s3BucketLocation) –

    The Amazon S3 location of your output file.

  • event_type_name (identifier) –

    The name of the event type.

  • detector_name (identifier) –

    The name of the detector.

  • detector_version (Optional[wholeNumberVersionString], default: None ) –

    The detector version.

  • iam_role_arn (iamRoleArn) –

    The ARN of the IAM role to use for this job request.

    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 and value pairs.

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/fraud_detector.py
def create_batch_prediction_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",
    detector_name: "capo_frauddetector.types.identifier.identifier",
    iam_role_arn: "capo_frauddetector.types.iam_role_arn.iamRoleArn",
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
    detector_version: Optional[
        "capo_frauddetector.types.whole_number_version_string.wholeNumberVersionString"
    ] = None,
    tags: Optional["capo_frauddetector.types.tag_list.tagList"] = None,
) -> "capo_frauddetector.types.create_batch_prediction_job_result.CreateBatchPredictionJobResult":
    """<p>Creates a batch prediction job.</p>

    Args:
        job_id: <p>The ID of the batch prediction job.</p>
        input_path: <p>The Amazon S3 location of your training file.</p>
        output_path: <p>The Amazon S3 location of your output file.</p>
        event_type_name: <p>The name of the event type.</p>
        detector_name: <p>The name of the detector.</p>
        detector_version: <p>The detector version.</p>
        iam_role_arn: <p>The ARN of the IAM role to use for this job request.</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 and value pairs.</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.
    """

    def _handler(
        req: "OperationRequest[capo_frauddetector.types.create_batch_prediction_job_request.CreateBatchPredictionJobRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.create_batch_prediction_job_result.CreateBatchPredictionJobResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.create_batch_prediction_job

        output, http_response = (
            capo_frauddetector._operations.aws_hawks_nest_service_facade.create_batch_prediction_job.create_batch_prediction_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateBatchPredictionJob")
    )
    input_: capo_frauddetector.types.create_batch_prediction_job_request.CreateBatchPredictionJobRequest = {
        "job_id": job_id,
        "input_path": input_path,
        "output_path": output_path,
        "event_type_name": event_type_name,
        "detector_name": detector_name,
        "iam_role_arn": iam_role_arn,
    }
    if detector_version is not None:
        input_["detector_version"] = detector_version
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output