updateUser method

Future<UpdateUserResponse> updateUser({
  1. required String accountId,
  2. required String userId,
  3. AlexaForBusinessMetadata? alexaForBusinessMetadata,
  4. License? licenseType,
  5. UserType? userType,
})

Updates user details for a specified user ID. Currently, only LicenseType updates are supported for this action.

May throw BadRequestException. May throw ForbiddenException. May throw NotFoundException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter accountId : The Amazon Chime account ID.

Parameter userId : The user ID.

Parameter alexaForBusinessMetadata : The Alexa for Business metadata.

Parameter licenseType : The user license type to update. This must be a supported license type for the Amazon Chime account that the user belongs to.

Parameter userType : The user type.

Implementation

Future<UpdateUserResponse> updateUser({
  required String accountId,
  required String userId,
  AlexaForBusinessMetadata? alexaForBusinessMetadata,
  License? licenseType,
  UserType? userType,
}) async {
  final $payload = <String, dynamic>{
    if (alexaForBusinessMetadata != null)
      'AlexaForBusinessMetadata': alexaForBusinessMetadata,
    if (licenseType != null) 'LicenseType': licenseType.value,
    if (userType != null) 'UserType': userType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/users/${Uri.encodeComponent(userId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateUserResponse.fromJson(response);
}