getGroupsWithHttpInfo method

Future<Response> getGroupsWithHttpInfo(
  1. String notAssociatedToTeam,
  2. String notAssociatedToChannel, {
  3. int? page,
  4. int? perPage,
  5. String? q,
  6. bool? includeMemberCount,
  7. int? since,
  8. bool? filterAllowReference,
})

Get groups

Retrieve a list of all groups not associated to a particular channel or team. not_associated_to_team OR not_associated_to_channel is required. If you use not_associated_to_team, you must be a team admin for that particular team (permission to manage that team). If you use not_associated_to_channel, you must be a channel admin for that particular channel (permission to manage that channel). Minimum server version: 5.11

Note: This method returns the HTTP Response.

Parameters:

  • String notAssociatedToTeam (required): Team GUID which is used to return all the groups not associated to this team

  • String notAssociatedToChannel (required): Group GUID which is used to return all the groups not associated to this channel

  • int page: The page to select.

  • int perPage: The number of groups per page.

  • String q: String to pattern match the name and display_name field. Will return all groups whose name and display_name field match any of the text.

  • bool includeMemberCount: Boolean which adds the member_count attribute to each group JSON object

  • int since: Only return groups that have been modified since the given Unix timestamp (in milliseconds). All modified groups, including deleted and created groups, will be returned. Minimum server version: 5.24

  • bool filterAllowReference: Boolean which filters the group entries with the allow_reference attribute set.

Implementation

Future<Response> getGroupsWithHttpInfo(
  String notAssociatedToTeam,
  String notAssociatedToChannel, {
  int? page,
  int? perPage,
  String? q,
  bool? includeMemberCount,
  int? since,
  bool? filterAllowReference,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/groups';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (perPage != null) {
    queryParams.addAll(_queryParams('', 'per_page', perPage));
  }
  if (q != null) {
    queryParams.addAll(_queryParams('', 'q', q));
  }
  if (includeMemberCount != null) {
    queryParams.addAll(_queryParams('', 'include_member_count', includeMemberCount));
  }
  queryParams.addAll(_queryParams('', 'not_associated_to_team', notAssociatedToTeam));
  queryParams.addAll(_queryParams('', 'not_associated_to_channel', notAssociatedToChannel));
  if (since != null) {
    queryParams.addAll(_queryParams('', 'since', since));
  }
  if (filterAllowReference != null) {
    queryParams.addAll(_queryParams('', 'filter_allow_reference', filterAllowReference));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}