updateProfile method
- required String domainName,
- required String profileId,
- String? accountNumber,
- String? additionalInformation,
- UpdateAddress? address,
- Map<
String, String> ? attributes, - UpdateAddress? billingAddress,
- String? birthDate,
- String? businessEmailAddress,
- String? businessName,
- String? businessPhoneNumber,
- String? emailAddress,
- EngagementPreferences? engagementPreferences,
- String? firstName,
- Gender? gender,
- String? genderString,
- String? homePhoneNumber,
- String? lastName,
- UpdateAddress? mailingAddress,
- String? middleName,
- String? mobilePhoneNumber,
- PartyType? partyType,
- String? partyTypeString,
- String? personalEmailAddress,
- String? phoneNumber,
- ProfileType? profileType,
- UpdateAddress? shippingAddress,
Updates the properties of a profile. The ProfileId is required for updating a customer profile.
When calling the UpdateProfile API, specifying an empty string value means that any existing value will be removed. Not specifying a string value means that any value already there will be kept.
May throw AccessDeniedException.
May throw BadRequestException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter domainName :
The unique name of the domain.
Parameter profileId :
The unique identifier of a customer profile.
Parameter accountNumber :
An account number that you have assigned to the customer.
Parameter additionalInformation :
Any additional information relevant to the customer’s profile.
Parameter address :
A generic address associated with the customer that is not mailing,
shipping, or billing.
Parameter attributes :
A key value pair of attributes of a customer profile.
Parameter billingAddress :
The customer’s billing address.
Parameter birthDate :
The customer’s birth date.
Parameter businessEmailAddress :
The customer’s business email address.
Parameter businessName :
The name of the customer’s business.
Parameter businessPhoneNumber :
The customer’s business phone number.
Parameter emailAddress :
The customer’s email address, which has not been specified as a personal
or business address.
Parameter engagementPreferences :
Object that defines users preferred methods of engagement.
Parameter firstName :
The customer’s first name.
Parameter gender :
The gender with which the customer identifies.
Parameter genderString :
An alternative to Gender which accepts any string as input.
Parameter homePhoneNumber :
The customer’s home phone number.
Parameter lastName :
The customer’s last name.
Parameter mailingAddress :
The customer’s mailing address.
Parameter middleName :
The customer’s middle name.
Parameter mobilePhoneNumber :
The customer’s mobile phone number.
Parameter partyType :
The type of profile used to describe the customer.
Parameter partyTypeString :
An alternative to PartyType which accepts any string as
input.
Parameter personalEmailAddress :
The customer’s personal email address.
Parameter phoneNumber :
The customer’s phone number, which has not been specified as a mobile,
home, or business number.
Parameter profileType :
Determines the type of the profile.
Parameter shippingAddress :
The customer’s shipping address.
Implementation
Future<UpdateProfileResponse> updateProfile({
required String domainName,
required String profileId,
String? accountNumber,
String? additionalInformation,
UpdateAddress? address,
Map<String, String>? attributes,
UpdateAddress? billingAddress,
String? birthDate,
String? businessEmailAddress,
String? businessName,
String? businessPhoneNumber,
String? emailAddress,
EngagementPreferences? engagementPreferences,
String? firstName,
Gender? gender,
String? genderString,
String? homePhoneNumber,
String? lastName,
UpdateAddress? mailingAddress,
String? middleName,
String? mobilePhoneNumber,
PartyType? partyType,
String? partyTypeString,
String? personalEmailAddress,
String? phoneNumber,
ProfileType? profileType,
UpdateAddress? shippingAddress,
}) async {
final $payload = <String, dynamic>{
'ProfileId': profileId,
if (accountNumber != null) 'AccountNumber': accountNumber,
if (additionalInformation != null)
'AdditionalInformation': additionalInformation,
if (address != null) 'Address': address,
if (attributes != null) 'Attributes': attributes,
if (billingAddress != null) 'BillingAddress': billingAddress,
if (birthDate != null) 'BirthDate': birthDate,
if (businessEmailAddress != null)
'BusinessEmailAddress': businessEmailAddress,
if (businessName != null) 'BusinessName': businessName,
if (businessPhoneNumber != null)
'BusinessPhoneNumber': businessPhoneNumber,
if (emailAddress != null) 'EmailAddress': emailAddress,
if (engagementPreferences != null)
'EngagementPreferences': engagementPreferences,
if (firstName != null) 'FirstName': firstName,
if (gender != null) 'Gender': gender.value,
if (genderString != null) 'GenderString': genderString,
if (homePhoneNumber != null) 'HomePhoneNumber': homePhoneNumber,
if (lastName != null) 'LastName': lastName,
if (mailingAddress != null) 'MailingAddress': mailingAddress,
if (middleName != null) 'MiddleName': middleName,
if (mobilePhoneNumber != null) 'MobilePhoneNumber': mobilePhoneNumber,
if (partyType != null) 'PartyType': partyType.value,
if (partyTypeString != null) 'PartyTypeString': partyTypeString,
if (personalEmailAddress != null)
'PersonalEmailAddress': personalEmailAddress,
if (phoneNumber != null) 'PhoneNumber': phoneNumber,
if (profileType != null) 'ProfileType': profileType.value,
if (shippingAddress != null) 'ShippingAddress': shippingAddress,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/domains/${Uri.encodeComponent(domainName)}/profiles',
exceptionFnMap: _exceptionFns,
);
return UpdateProfileResponse.fromJson(response);
}