Skip to content

create_profile

create_profile(
    name: ProfileName,
    phone: Phone,
    business_name: BusinessName,
    logging: Logging,
    *,
    config_overrides: Optional[b2biClientConfig] = None,
    email: Optional[Email] = None,
    client_token: Optional[str] = None,
    tags: Optional[TagList] = None,
) -> CreateProfileResponse

Creates a customer profile. You can have up to five customer profiles, each representing a distinct private network. A profile is the mechanism used to create the concept of a private network.

Parameters:

  • name (ProfileName) –

    Specifies the name of the profile.

  • email (Optional[Email], default: None ) –

    Specifies the email address associated with this customer profile.

  • phone (Phone) –

    Specifies the phone number associated with the profile.

  • business_name (BusinessName) –

    Specifies the name for the business associated with this profile.

  • logging (Logging) –

    Specifies whether or not logging is enabled for this profile.

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

>>> client.create_profile(business_name="John's Shipping", client_token='foo', email='[email protected]', logging='ENABLED', name='Shipping Profile', phone='5555555555', tags=[{'Key': 'sampleKey', 'Value': 'sampleValue'}])
Source code in docs_src/capo_b2bi/_services/b2bi.py
def create_profile(
    self,
    name: "capo_b2bi.types.profile_name.ProfileName",
    phone: "capo_b2bi.types.phone.Phone",
    business_name: "capo_b2bi.types.business_name.BusinessName",
    logging: "capo_b2bi.types.logging.Logging",
    *,
    config_overrides: Optional[b2biClientConfig] = None,
    email: Optional["capo_b2bi.types.email.Email"] = None,
    client_token: Optional[str] = None,
    tags: Optional["capo_b2bi.types.tag_list.TagList"] = None,
) -> "capo_b2bi.types.create_profile_response.CreateProfileResponse":
    """<p>Creates a customer profile. You can have up to five customer profiles, each representing a distinct private network. A profile is the mechanism used to create the concept of a private network.</p>

    Args:
        name: <p>Specifies the name of the profile.</p>
        email: <p>Specifies the email address associated with this customer profile.</p>
        phone: <p>Specifies the phone number associated with the profile.</p>
        business_name: <p>Specifies the name for the business associated with this profile.</p>
        logging: <p>Specifies whether or not logging is enabled for this profile.</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 CreateProfile call

        >>> client.create_profile(business_name="John's Shipping", client_token='foo', email='[email protected]', logging='ENABLED', name='Shipping Profile', phone='5555555555', tags=[{'Key': 'sampleKey', 'Value': 'sampleValue'}])
    """

    def _handler(
        req: "OperationRequest[capo_b2bi.types.create_profile_request.CreateProfileRequest]",
    ) -> OperationResponse[
        "capo_b2bi.types.create_profile_response.CreateProfileResponse"
    ]:
        import capo_b2bi._operations.b2_bi.create_profile

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

    def _redact_input(
        input_: "capo_b2bi.types.create_profile_request.CreateProfileRequest",
    ) -> dict[str, Any]:
        import capo_b2bi.types.create_profile_request

        return capo_b2bi.types.create_profile_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_b2bi.types.create_profile_response.CreateProfileResponse",
    ) -> dict[str, Any]:
        import capo_b2bi.types.create_profile_response

        return capo_b2bi.types.create_profile_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_b2bi.types.create_profile_request.CreateProfileRequest = {
        "name": name,
        "phone": phone,
        "business_name": business_name,
        "logging": logging,
    }
    if email is not None:
        input_["email"] = email
    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