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 UnauthorizedClientException. May throw NotFoundException. May throw ForbiddenException. May throw BadRequestException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

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 {
  ArgumentError.checkNotNull(accountId, 'accountId');
  ArgumentError.checkNotNull(userId, 'userId');
  final $payload = <String, dynamic>{
    if (alexaForBusinessMetadata != null)
      'AlexaForBusinessMetadata': alexaForBusinessMetadata,
    if (licenseType != null) 'LicenseType': licenseType.toValue(),
    if (userType != null) 'UserType': userType.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(accountId)}/users/${Uri.encodeComponent(userId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateUserResponse.fromJson(response);
}