Skip to content

create_profile

create_profile(
    domain_name: name,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    account_number: Optional[sensitiveString1To255] = None,
    additional_information: Optional[sensitiveString1To1000] = None,
    party_type: Optional[PartyType] = None,
    business_name: Optional[sensitiveString1To255] = None,
    first_name: Optional[sensitiveString1To255] = None,
    middle_name: Optional[sensitiveString1To255] = None,
    last_name: Optional[sensitiveString1To255] = None,
    birth_date: Optional[sensitiveString1To255] = None,
    gender: Optional[Gender] = None,
    phone_number: Optional[sensitiveString1To255] = None,
    mobile_phone_number: Optional[sensitiveString1To255] = None,
    home_phone_number: Optional[sensitiveString1To255] = None,
    business_phone_number: Optional[sensitiveString1To255] = None,
    email_address: Optional[sensitiveString1To255] = None,
    personal_email_address: Optional[sensitiveString1To255] = None,
    business_email_address: Optional[sensitiveString1To255] = None,
    address: Optional[Address] = None,
    shipping_address: Optional[Address] = None,
    mailing_address: Optional[Address] = None,
    billing_address: Optional[Address] = None,
    attributes: Optional[Attributes] = None,
    party_type_string: Optional[sensitiveString1To255] = None,
    gender_string: Optional[sensitiveString1To255] = None,
    profile_type: Optional[ProfileType] = None,
    engagement_preferences: Optional[EngagementPreferences] = None,
) -> CreateProfileResponse

Creates a standard profile.

A standard profile represents the following attributes for a customer profile in a domain.

Parameters:

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def create_profile(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    account_number: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    additional_information: Optional[
        "capo_customer_profiles.types.sensitive_string1_to1000.sensitiveString1To1000"
    ] = None,
    party_type: Optional[
        "capo_customer_profiles.types.party_type.PartyType"
    ] = None,
    business_name: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    first_name: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    middle_name: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    last_name: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    birth_date: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    gender: Optional["capo_customer_profiles.types.gender.Gender"] = None,
    phone_number: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    mobile_phone_number: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    home_phone_number: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    business_phone_number: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    email_address: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    personal_email_address: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    business_email_address: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    address: Optional["capo_customer_profiles.types.address.Address"] = None,
    shipping_address: Optional[
        "capo_customer_profiles.types.address.Address"
    ] = None,
    mailing_address: Optional[
        "capo_customer_profiles.types.address.Address"
    ] = None,
    billing_address: Optional[
        "capo_customer_profiles.types.address.Address"
    ] = None,
    attributes: Optional[
        "capo_customer_profiles.types.attributes.Attributes"
    ] = None,
    party_type_string: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    gender_string: Optional[
        "capo_customer_profiles.types.sensitive_string1_to255.sensitiveString1To255"
    ] = None,
    profile_type: Optional[
        "capo_customer_profiles.types.profile_type.ProfileType"
    ] = None,
    engagement_preferences: Optional[
        "capo_customer_profiles.types.engagement_preferences.EngagementPreferences"
    ] = None,
) -> "capo_customer_profiles.types.create_profile_response.CreateProfileResponse":
    """<p>Creates a standard profile.</p> <p>A standard profile represents the following attributes for a customer profile in a domain.</p>

    Args:
        domain_name: <p>The unique name of the domain.</p>
        account_number: <p>An account number that you have assigned to the customer.</p>
        additional_information: <p>Any additional information relevant to the customer’s profile.</p>
        party_type: <p>The type of profile used to describe the customer.</p>
        business_name: <p>The name of the customer’s business.</p>
        first_name: <p>The customer’s first name.</p>
        middle_name: <p>The customer’s middle name.</p>
        last_name: <p>The customer’s last name.</p>
        birth_date: <p>The customer’s birth date. </p>
        gender: <p>The gender with which the customer identifies. </p>
        phone_number: <p>The customer’s phone number, which has not been specified as a mobile, home, or business number. </p>
        mobile_phone_number: <p>The customer’s mobile phone number.</p>
        home_phone_number: <p>The customer’s home phone number.</p>
        business_phone_number: <p>The customer’s business phone number.</p>
        email_address: <p>The customer’s email address, which has not been specified as a personal or business address. </p>
        personal_email_address: <p>The customer’s personal email address.</p>
        business_email_address: <p>The customer’s business email address.</p>
        address: <p>A generic address associated with the customer that is not mailing, shipping, or billing.</p>
        shipping_address: <p>The customer’s shipping address.</p>
        mailing_address: <p>The customer’s mailing address.</p>
        billing_address: <p>The customer’s billing address.</p>
        attributes: <p>A key value pair of attributes of a customer profile.</p>
        party_type_string: <p>An alternative to <code>PartyType</code> which accepts any string as input.</p>
        gender_string: <p>An alternative to <code>Gender</code> which accepts any string as input.</p>
        profile_type: <p>The type of the profile.</p>
        engagement_preferences: <p>Object that defines the preferred methods of engagement, per channel.</p>

    Raises:
        capo_customer_profiles.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_customer_profiles.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_customer_profiles.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred.</p>
        capo_customer_profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_customer_profiles.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_customer_profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_customer_profiles._operations.customer_profiles_20200815.create_profile.create_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_customer_profiles.types.create_profile_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateProfile", redact_input=_redact_input),
    )
    input_: capo_customer_profiles.types.create_profile_request.CreateProfileRequest = {
        "domain_name": domain_name
    }
    if account_number is not None:
        input_["account_number"] = account_number
    if additional_information is not None:
        input_["additional_information"] = additional_information
    if party_type is not None:
        input_["party_type"] = party_type
    if business_name is not None:
        input_["business_name"] = business_name
    if first_name is not None:
        input_["first_name"] = first_name
    if middle_name is not None:
        input_["middle_name"] = middle_name
    if last_name is not None:
        input_["last_name"] = last_name
    if birth_date is not None:
        input_["birth_date"] = birth_date
    if gender is not None:
        input_["gender"] = gender
    if phone_number is not None:
        input_["phone_number"] = phone_number
    if mobile_phone_number is not None:
        input_["mobile_phone_number"] = mobile_phone_number
    if home_phone_number is not None:
        input_["home_phone_number"] = home_phone_number
    if business_phone_number is not None:
        input_["business_phone_number"] = business_phone_number
    if email_address is not None:
        input_["email_address"] = email_address
    if personal_email_address is not None:
        input_["personal_email_address"] = personal_email_address
    if business_email_address is not None:
        input_["business_email_address"] = business_email_address
    if address is not None:
        input_["address"] = address
    if shipping_address is not None:
        input_["shipping_address"] = shipping_address
    if mailing_address is not None:
        input_["mailing_address"] = mailing_address
    if billing_address is not None:
        input_["billing_address"] = billing_address
    if attributes is not None:
        input_["attributes"] = attributes
    if party_type_string is not None:
        input_["party_type_string"] = party_type_string
    if gender_string is not None:
        input_["gender_string"] = gender_string
    if profile_type is not None:
        input_["profile_type"] = profile_type
    if engagement_preferences is not None:
        input_["engagement_preferences"] = engagement_preferences

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output