getChannelsForUserWithHttpInfo method

Future<Response> getChannelsForUserWithHttpInfo(
  1. String userId, {
  2. int? lastDeleteAt,
  3. bool? includeDeleted,
})

Get all channels from all teams

Get all channels from all teams that a user is a member of. Minimum server version: 6.1 ##### Permissions Logged in as the user, or have edit_other_users permission.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): The ID of the user. This can also be "me" which will point to the current user.

  • int lastDeleteAt: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false.

  • bool includeDeleted: Defines if deleted channels should be returned or not

Implementation

Future<Response> getChannelsForUserWithHttpInfo(
  String userId, {
  int? lastDeleteAt,
  bool? includeDeleted,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/users/{user_id}/channels'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (lastDeleteAt != null) {
    queryParams.addAll(_queryParams('', 'last_delete_at', lastDeleteAt));
  }
  if (includeDeleted != null) {
    queryParams.addAll(_queryParams('', 'include_deleted', includeDeleted));
  }

  const contentTypes = <String>[];

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