Skip to content

start_transformer_job async

start_transformer_job(
    input_file: S3Location,
    output_location: S3Location,
    transformer_id: TransformerId,
    *,
    config_overrides: Optional[Asyncb2biClientConfig] = None,
    client_token: Optional[str] = None,
) -> StartTransformerJobResponse

Runs a job, using a transformer, to parse input EDI (electronic data interchange) file into the output structures used by Amazon Web Services B2B Data Interchange.

If you only want to transform EDI (electronic data interchange) documents, you don't need to create profiles, partnerships or capabilities. Just create and configure a transformer, and then run the StartTransformerJob API to process your files.

The system stores transformer jobs for 30 days. During that period, you can run GetTransformerJob and supply its transformerId and transformerJobId to return details of the job.

Parameters:

  • input_file (S3Location) –

    Specifies the location of the input file for the transformation. The location consists of an Amazon S3 bucket and prefix.

  • output_location (S3Location) –

    Specifies the location of the output file for the transformation. The location consists of an Amazon S3 bucket and prefix.

  • transformer_id (TransformerId) –

    Specifies the system-assigned unique identifier for the transformer.

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

    Reserved for future use.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    A conflict exception is thrown when you attempt to delete a resource (such as a profile or a capability) that is being used by other resources.

  • InternalServerException –

    This exception is thrown when an error occurs in the Amazon Web Services B2B Data Interchange service.

  • ResourceNotFoundException –

    Occurs when the requested resource does not exist, or cannot be found. In some cases, the resource exists in a region other than the region specified in the API call.

  • ThrottlingException –

    The request was denied due to throttling: the data speed and rendering may be limited depending on various parameters and conditions.

  • ValidationException –

    Occurs when a B2BI object cannot be validated against a request from another object. This exception can be thrown during standard EDI validation or when custom validation rules fail, such as when element length constraints are violated, invalid codes are used in code list validations, or required elements are missing based on configured element requirement rules.

  • UnknownServiceError –

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

Examples:

Sample StartTransformerJob call

>>> await client.start_transformer_job(client_token='foo', input_file={'bucketName': 'test-bucket', 'key': 'input/inputFile.txt'}, output_location={'bucketName': 'test-bucket', 'key': 'output/'}, transformer_id='tr-974c129999f84d8c9')
Source code in docs_src/capo_b2bi/_services/async_b2bi.py
async def start_transformer_job(
    self,
    input_file: "capo_b2bi.types.s3_location.S3Location",
    output_location: "capo_b2bi.types.s3_location.S3Location",
    transformer_id: "capo_b2bi.types.transformer_id.TransformerId",
    *,
    config_overrides: Optional[Asyncb2biClientConfig] = None,
    client_token: Optional[str] = None,
) -> "capo_b2bi.types.start_transformer_job_response.StartTransformerJobResponse":
    """<p>Runs a job, using a transformer, to parse input EDI (electronic data interchange) file into the output structures used by Amazon Web Services B2B Data Interchange.</p> <p>If you only want to transform EDI (electronic data interchange) documents, you don't need to create profiles, partnerships or capabilities. Just create and configure a transformer, and then run the <code>StartTransformerJob</code> API to process your files.</p> <note> <p>The system stores transformer jobs for 30 days. During that period, you can run <a href="https://docs.aws.amazon.com/b2bi/latest/APIReference/API_GetTransformerJob.html">GetTransformerJob</a> and supply its <code>transformerId</code> and <code>transformerJobId</code> to return details of the job.</p> </note>

    Args:
        input_file: <p>Specifies the location of the input file for the transformation. The location consists of an Amazon S3 bucket and prefix.</p>
        output_location: <p>Specifies the location of the output file for the transformation. The location consists of an Amazon S3 bucket and prefix.</p>
        transformer_id: <p>Specifies the system-assigned unique identifier for the transformer.</p>
        client_token: <p>Reserved for future use.</p>

    Raises:
        capo_b2bi.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_b2bi.errors.conflict_exception.ConflictException: <p>A conflict exception is thrown when you attempt to delete a resource (such as a profile or a capability) that is being used by other resources.</p>
        capo_b2bi.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when an error occurs in the Amazon Web Services B2B Data Interchange service.</p>
        capo_b2bi.errors.resource_not_found_exception.ResourceNotFoundException: <p>Occurs when the requested resource does not exist, or cannot be found. In some cases, the resource exists in a region other than the region specified in the API call.</p>
        capo_b2bi.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling: the data speed and rendering may be limited depending on various parameters and conditions.</p>
        capo_b2bi.errors.validation_exception.ValidationException: <p>Occurs when a B2BI object cannot be validated against a request from another object. This exception can be thrown during standard EDI validation or when custom validation rules fail, such as when element length constraints are violated, invalid codes are used in code list validations, or required elements are missing based on configured element requirement rules.</p>
        capo_b2bi.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample StartTransformerJob call

        >>> await client.start_transformer_job(client_token='foo', input_file={'bucketName': 'test-bucket', 'key': 'input/inputFile.txt'}, output_location={'bucketName': 'test-bucket', 'key': 'output/'}, transformer_id='tr-974c129999f84d8c9')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_b2bi.types.start_transformer_job_request.StartTransformerJobRequest]",
    ) -> AsyncOperationResponse[
        "capo_b2bi.types.start_transformer_job_response.StartTransformerJobResponse"
    ]:
        import capo_b2bi._operations.b2_bi.start_transformer_job

        (
            output,
            http_response,
        ) = await capo_b2bi._operations.b2_bi.start_transformer_job.async_start_transformer_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartTransformerJob")
    )
    input_: capo_b2bi.types.start_transformer_job_request.StartTransformerJobRequest = {
        "input_file": input_file,
        "output_location": output_location,
        "transformer_id": transformer_id,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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