updateContact method
- required String contactArn,
- String? displayName,
- String? firstName,
- String? lastName,
- String? phoneNumber,
- List<
PhoneNumber> ? phoneNumbers, - List<
SipAddress> ? sipAddresses,
Updates the contact details by the contact ARN.
May throw NotFoundException. May throw ConcurrentModificationException.
Parameter contactArn
:
The ARN of the contact to update.
Parameter displayName
:
The updated display name of the contact.
Parameter firstName
:
The updated first name of the contact.
Parameter lastName
:
The updated last name of the contact.
Parameter phoneNumber
:
The updated phone number of the contact. The phone number type defaults to
WORK. You can either specify PhoneNumber or PhoneNumbers. We recommend
that you use PhoneNumbers, which lets you specify the phone number type
and multiple numbers.
Parameter phoneNumbers
:
The list of phone numbers for the contact.
Parameter sipAddresses
:
The list of SIP addresses for the contact.
Implementation
Future<void> updateContact({
required String contactArn,
String? displayName,
String? firstName,
String? lastName,
String? phoneNumber,
List<PhoneNumber>? phoneNumbers,
List<SipAddress>? sipAddresses,
}) async {
ArgumentError.checkNotNull(contactArn, 'contactArn');
_s.validateStringLength(
'displayName',
displayName,
1,
100,
);
_s.validateStringLength(
'firstName',
firstName,
1,
100,
);
_s.validateStringLength(
'lastName',
lastName,
1,
100,
);
_s.validateStringLength(
'phoneNumber',
phoneNumber,
0,
50,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AlexaForBusiness.UpdateContact'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ContactArn': contactArn,
if (displayName != null) 'DisplayName': displayName,
if (firstName != null) 'FirstName': firstName,
if (lastName != null) 'LastName': lastName,
if (phoneNumber != null) 'PhoneNumber': phoneNumber,
if (phoneNumbers != null) 'PhoneNumbers': phoneNumbers,
if (sipAddresses != null) 'SipAddresses': sipAddresses,
},
);
}