listMemberships method

Future<MembershipList> listMemberships({
  1. required String teamId,
  2. List<String>? queries,
  3. String? search,
})

List team memberships

Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.

Implementation

Future<models.MembershipList> listMemberships(
    {required String teamId, List<String>? queries, String? search}) async {
  final String apiPath =
      '/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);

  final Map<String, dynamic> apiParams = {
    'queries': queries,
    'search': search,
  };

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.get,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.MembershipList.fromMap(res.data);
}