Skip to content

create_capability

create_capability(
    name: CapabilityName,
    type: CapabilityType,
    configuration: CapabilityConfiguration,
    *,
    config_overrides: Optional[b2biClientConfig] = None,
    instructions_documents: Optional[InstructionsDocuments] = None,
    client_token: Optional[str] = None,
    tags: Optional[TagList] = None,
) -> CreateCapabilityResponse

Instantiates a capability based on the specified parameters. A trading capability contains the information required to transform incoming EDI documents into JSON or XML outputs.

Parameters:

  • name (CapabilityName) –

    Specifies the name of the capability, used to identify it.

  • type (CapabilityType) –

    Specifies the type of the capability. Currently, only edi is supported.

  • configuration (CapabilityConfiguration) –

    Specifies a structure that contains the details for a capability.

  • instructions_documents (Optional[InstructionsDocuments], default: None ) –

    Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.

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

    Reserved for future use.

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

    Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.

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 CreateCapability call

>>> client.create_capability(name='b2biexample', type='edi', configuration={'edi': {'type': {'x12Details': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'inputLocation': {'bucketName': 'test-bucket', 'key': 'input/'}, 'outputLocation': {'bucketName': 'test-bucket', 'key': 'output/'}, 'transformerId': 'tr-9a893cf536df4658b'}}, instructions_documents=[{'bucketName': 'test-bucket', 'key': 'instructiondoc.txt'}], client_token='foo', tags=[{'Key': 'capabilityKey1', 'Value': 'capabilityValue1'}])
Source code in docs_src/capo_b2bi/_services/b2bi.py
def create_capability(
    self,
    name: "capo_b2bi.types.capability_name.CapabilityName",
    type: "capo_b2bi.types.capability_type.CapabilityType",
    configuration: "capo_b2bi.types.capability_configuration.CapabilityConfiguration",
    *,
    config_overrides: Optional[b2biClientConfig] = None,
    instructions_documents: Optional[
        "capo_b2bi.types.instructions_documents.InstructionsDocuments"
    ] = None,
    client_token: Optional[str] = None,
    tags: Optional["capo_b2bi.types.tag_list.TagList"] = None,
) -> "capo_b2bi.types.create_capability_response.CreateCapabilityResponse":
    """<p>Instantiates a capability based on the specified parameters. A trading capability contains the information required to transform incoming EDI documents into JSON or XML outputs.</p>

    Args:
        name: <p>Specifies the name of the capability, used to identify it.</p>
        type: <p>Specifies the type of the capability. Currently, only <code>edi</code> is supported.</p>
        configuration: <p>Specifies a structure that contains the details for a capability.</p>
        instructions_documents: <p>Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.</p>
        client_token: <p>Reserved for future use.</p>
        tags: <p>Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.</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 CreateCapability call

        >>> client.create_capability(name='b2biexample', type='edi', configuration={'edi': {'type': {'x12Details': {'transactionSet': 'X12_110', 'version': 'VERSION_4010'}}, 'inputLocation': {'bucketName': 'test-bucket', 'key': 'input/'}, 'outputLocation': {'bucketName': 'test-bucket', 'key': 'output/'}, 'transformerId': 'tr-9a893cf536df4658b'}}, instructions_documents=[{'bucketName': 'test-bucket', 'key': 'instructiondoc.txt'}], client_token='foo', tags=[{'Key': 'capabilityKey1', 'Value': 'capabilityValue1'}])
    """

    def _handler(
        req: "OperationRequest[capo_b2bi.types.create_capability_request.CreateCapabilityRequest]",
    ) -> OperationResponse[
        "capo_b2bi.types.create_capability_response.CreateCapabilityResponse"
    ]:
        import capo_b2bi._operations.b2_bi.create_capability

        output, http_response = (
            capo_b2bi._operations.b2_bi.create_capability.create_capability(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCapability")
    )
    input_: capo_b2bi.types.create_capability_request.CreateCapabilityRequest = {
        "name": name,
        "type": type,
        "configuration": configuration,
    }
    if instructions_documents is not None:
        input_["instructions_documents"] = instructions_documents
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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