getUser method

Future<GetUserResponse> getUser({
  1. required String networkId,
  2. required String userId,
  3. DateTime? endTime,
  4. DateTime? startTime,
})

Retrieves detailed information about a specific user in a Wickr network, including their profile, status, and activity history.

May throw BadRequestError. May throw ForbiddenError. May throw InternalServerError. May throw RateLimitError. May throw ResourceNotFoundError. May throw UnauthorizedError. May throw ValidationError.

Parameter networkId : The ID of the Wickr network containing the user.

Parameter userId : The unique identifier of the user to retrieve.

Parameter endTime : The end time for filtering the user's last activity. Only activity before this timestamp will be considered. Time is specified in epoch seconds.

Parameter startTime : The start time for filtering the user's last activity. Only activity after this timestamp will be considered. Time is specified in epoch seconds.

Implementation

Future<GetUserResponse> getUser({
  required String networkId,
  required String userId,
  DateTime? endTime,
  DateTime? startTime,
}) async {
  final $query = <String, List<String>>{
    if (endTime != null)
      'endTime': [_s.unixTimestampToJson(endTime).toString().toString()],
    if (startTime != null)
      'startTime': [_s.unixTimestampToJson(startTime).toString().toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/networks/${Uri.encodeComponent(networkId)}/users/${Uri.encodeComponent(userId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetUserResponse.fromJson(response);
}