Skip to content

update_transformer async

update_transformer(
    transformer_id: TransformerId,
    *,
    config_overrides: Optional[Asyncb2biClientConfig] = None,
    name: Optional[TransformerName] = None,
    status: Optional[TransformerStatus] = None,
    file_format: Optional[FileFormat] = None,
    mapping_template: Optional[MappingTemplate] = None,
    edi_type: Optional[EdiType] = None,
    sample_document: Optional[FileLocation] = None,
    input_conversion: Optional[InputConversion] = None,
    mapping: Optional[Mapping] = None,
    output_conversion: Optional[OutputConversion] = None,
    sample_documents: Optional[SampleDocuments] = None,
) -> UpdateTransformerResponse

Updates the specified parameters for a transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.

Parameters:

  • transformer_id (TransformerId) –

    Specifies the system-assigned unique identifier for the transformer.

  • name (Optional[TransformerName], default: None ) –

    Specify a new name for the transformer, if you want to update it.

  • status (Optional[TransformerStatus], default: None ) –

    Specifies the transformer's status. You can update the state of the transformer from inactive to active.

  • file_format (Optional[FileFormat], default: None ) –

    Specifies that the currently supported file formats for EDI transformations are JSON and XML.

  • mapping_template (Optional[MappingTemplate], default: None ) –

    Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.

    This parameter is available for backwards compatibility. Use the Mapping data type instead.

  • edi_type (Optional[EdiType], default: None ) –

    Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.

  • sample_document (Optional[FileLocation], default: None ) –

    Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.

  • input_conversion (Optional[InputConversion], default: None ) –

    To update, specify the InputConversion object, which contains the format options for the inbound transformation.

  • mapping (Optional[Mapping], default: None ) –

    Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).

  • output_conversion (Optional[OutputConversion], default: None ) –

    To update, specify the OutputConversion object, which contains the format options for the outbound transformation.

  • sample_documents (Optional[SampleDocuments], default: None ) –

    Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.

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.

  • ServiceQuotaExceededException –

    Occurs when the calling command attempts to exceed one of the service quotas, for example trying to create a capability when you already have the maximum number of capabilities allowed.

  • 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 UpdateTransformer call

>>> await client.update_transformer(input_conversion={'fromFormat': 'X12', 'formatOptions': {'x12': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'advancedOptions': {'x12': {'splitOptions': {'splitBy': 'NONE'}, 'validationOptions': {'validationRules': [{'codeListValidationRule': {'elementId': '1234', 'codesToAdd': ['A', 'B', 'C'], 'codesToRemove': ['X', 'Y', 'Z']}}, {'elementRequirementValidationRule': {'elementPosition': 'NM1-01', 'requirement': 'MANDATORY'}}, {'elementLengthValidationRule': {'elementId': '5678', 'maxLength': 10, 'minLength': 2}}]}}}}, mapping={'templateLanguage': 'JSONATA', 'template': '{}'}, sample_documents={'bucketName': 'test-bucket', 'keys': [{'input': 'sampleDoc.txt'}]}, name='transformX12', status='inactive', transformer_id='tr-974c129999f84d8c9')
Source code in docs_src/capo_b2bi/_services/async_b2bi.py
async def update_transformer(
    self,
    transformer_id: "capo_b2bi.types.transformer_id.TransformerId",
    *,
    config_overrides: Optional[Asyncb2biClientConfig] = None,
    name: Optional["capo_b2bi.types.transformer_name.TransformerName"] = None,
    status: Optional["capo_b2bi.types.transformer_status.TransformerStatus"] = None,
    file_format: Optional["capo_b2bi.types.file_format.FileFormat"] = None,
    mapping_template: Optional[
        "capo_b2bi.types.mapping_template.MappingTemplate"
    ] = None,
    edi_type: Optional["capo_b2bi.types.edi_type.EdiType"] = None,
    sample_document: Optional["capo_b2bi.types.file_location.FileLocation"] = None,
    input_conversion: Optional[
        "capo_b2bi.types.input_conversion.InputConversion"
    ] = None,
    mapping: Optional["capo_b2bi.types.mapping.Mapping"] = None,
    output_conversion: Optional[
        "capo_b2bi.types.output_conversion.OutputConversion"
    ] = None,
    sample_documents: Optional[
        "capo_b2bi.types.sample_documents.SampleDocuments"
    ] = None,
) -> "capo_b2bi.types.update_transformer_response.UpdateTransformerResponse":
    """<p>Updates the specified parameters for a transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.</p>

    Args:
        transformer_id: <p>Specifies the system-assigned unique identifier for the transformer.</p>
        name: <p>Specify a new name for the transformer, if you want to update it.</p>
        status: <p>Specifies the transformer's status. You can update the state of the transformer from <code>inactive</code> to <code>active</code>.</p>
        file_format: <p>Specifies that the currently supported file formats for EDI transformations are <code>JSON</code> and <code>XML</code>.</p>
        mapping_template: <p>Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.</p> <note> <p>This parameter is available for backwards compatibility. Use the <a href="https://docs.aws.amazon.com/b2bi/latest/APIReference/API_Mapping.html">Mapping</a> data type instead.</p> </note>
        edi_type: <p>Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.</p>
        sample_document: <p>Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.</p>
        input_conversion: <p>To update, specify the <code>InputConversion</code> object, which contains the format options for the inbound transformation.</p>
        mapping: <p>Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).</p>
        output_conversion: <p>To update, specify the <code>OutputConversion</code> object, which contains the format options for the outbound transformation.</p>
        sample_documents: <p>Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Occurs when the calling command attempts to exceed one of the service quotas, for example trying to create a capability when you already have the maximum number of capabilities allowed.</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 UpdateTransformer call

        >>> await client.update_transformer(input_conversion={'fromFormat': 'X12', 'formatOptions': {'x12': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'advancedOptions': {'x12': {'splitOptions': {'splitBy': 'NONE'}, 'validationOptions': {'validationRules': [{'codeListValidationRule': {'elementId': '1234', 'codesToAdd': ['A', 'B', 'C'], 'codesToRemove': ['X', 'Y', 'Z']}}, {'elementRequirementValidationRule': {'elementPosition': 'NM1-01', 'requirement': 'MANDATORY'}}, {'elementLengthValidationRule': {'elementId': '5678', 'maxLength': 10, 'minLength': 2}}]}}}}, mapping={'templateLanguage': 'JSONATA', 'template': '{}'}, sample_documents={'bucketName': 'test-bucket', 'keys': [{'input': 'sampleDoc.txt'}]}, name='transformX12', status='inactive', transformer_id='tr-974c129999f84d8c9')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_b2bi.types.update_transformer_request.UpdateTransformerRequest]",
    ) -> AsyncOperationResponse[
        "capo_b2bi.types.update_transformer_response.UpdateTransformerResponse"
    ]:
        import capo_b2bi._operations.b2_bi.update_transformer

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTransformer")
    )
    input_: capo_b2bi.types.update_transformer_request.UpdateTransformerRequest = {
        "transformer_id": transformer_id
    }
    if name is not None:
        input_["name"] = name
    if status is not None:
        input_["status"] = status
    if file_format is not None:
        input_["file_format"] = file_format
    if mapping_template is not None:
        input_["mapping_template"] = mapping_template
    if edi_type is not None:
        input_["edi_type"] = edi_type
    if sample_document is not None:
        input_["sample_document"] = sample_document
    if input_conversion is not None:
        input_["input_conversion"] = input_conversion
    if mapping is not None:
        input_["mapping"] = mapping
    if output_conversion is not None:
        input_["output_conversion"] = output_conversion
    if sample_documents is not None:
        input_["sample_documents"] = sample_documents

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