updateUserHierarchy method

Future<void> updateUserHierarchy({
  1. required String instanceId,
  2. required String userId,
  3. String? hierarchyGroupId,
})

Assigns the specified hierarchy group to the specified user.

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter userId : The identifier of the user account.

Parameter hierarchyGroupId : The identifier of the hierarchy group.

Implementation

Future<void> updateUserHierarchy({
  required String instanceId,
  required String userId,
  String? hierarchyGroupId,
}) async {
  final $payload = <String, dynamic>{
    if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId,
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/hierarchy',
    exceptionFnMap: _exceptionFns,
  );
}