Skip to content

create_profile async

create_profile(
    as2_id: As2Id,
    profile_type: ProfileType,
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    certificate_ids: Optional[CertificateIds] = None,
    tags: Optional[Tags] = None,
) -> CreateProfileResponse

Creates the local or partner profile to use for AS2 transfers.

Parameters:

  • as2_id (As2Id) –

    The As2Id is the AS2-name, as defined in the RFC 4130. For inbound transfers, this is the AS2-From header for the AS2 messages sent from the partner. For outbound connectors, this is the AS2-To header for the AS2 messages sent to the partner using the StartFileTransfer API operation. This ID cannot include spaces.

  • profile_type (ProfileType) –

    Determines the type of profile to create:

    • Specify LOCAL to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.

    • Specify PARTNER to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.

  • certificate_ids (Optional[CertificateIds], default: None ) –

    An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.

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

    Key-value pairs that can be used to group and search for AS2 profiles.

Raises:

Source code in docs_src/capo_transfer/_services/async_transfer.py
async def create_profile(
    self,
    as2_id: "capo_transfer.types.as2_id.As2Id",
    profile_type: "capo_transfer.types.profile_type.ProfileType",
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    certificate_ids: Optional[
        "capo_transfer.types.certificate_ids.CertificateIds"
    ] = None,
    tags: Optional["capo_transfer.types.tags.Tags"] = None,
) -> "capo_transfer.types.create_profile_response.CreateProfileResponse":
    """<p>Creates the local or partner profile to use for AS2 transfers.</p>

    Args:
        as2_id: <p>The <code>As2Id</code> is the <i>AS2-name</i>, as defined in the <a href="https://datatracker.ietf.org/doc/html/rfc4130">RFC 4130</a>. For inbound transfers, this is the <code>AS2-From</code> header for the AS2 messages sent from the partner. For outbound connectors, this is the <code>AS2-To</code> header for the AS2 messages sent to the partner using the <code>StartFileTransfer</code> API operation. This ID cannot include spaces.</p>
        profile_type: <p>Determines the type of profile to create:</p> <ul> <li> <p>Specify <code>LOCAL</code> to create a local profile. A local profile represents the AS2-enabled Transfer Family server organization or party.</p> </li> <li> <p>Specify <code>PARTNER</code> to create a partner profile. A partner profile represents a remote organization, external to Transfer Family.</p> </li> </ul>
        certificate_ids: <p>An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles.</p>
        tags: <p>Key-value pairs that can be used to group and search for AS2 profiles.</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_transfer.types.create_profile_request.CreateProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_transfer.types.create_profile_response.CreateProfileResponse"
    ]:
        import capo_transfer._operations.transfer_service.create_profile

        (
            output,
            http_response,
        ) = await capo_transfer._operations.transfer_service.create_profile.async_create_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProfile")
    )
    input_: capo_transfer.types.create_profile_request.CreateProfileRequest = {
        "as2_id": as2_id,
        "profile_type": profile_type,
    }
    if certificate_ids is not None:
        input_["certificate_ids"] = certificate_ids
    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