getChannelsForTeamForUserWithHttpInfo method

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

Get channels for user

Get all the channels on a team for a user. ##### Permissions Logged in as the user, or have edit_other_users permission, and view_team permission for the team.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): User GUID

  • String teamId (required): Team GUID

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

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

Implementation

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

  // ignore: prefer_final_locals
  Object? postBody;

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

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

  const contentTypes = <String>[];

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