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 InvalidRequestException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalServiceException.

Parameter instanceId : The identifier of the Amazon Connect 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 {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  _s.validateStringLength(
    'instanceId',
    instanceId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userId, 'userId');
  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,
  );
}