getChannelByNameWithHttpInfo method

Future<Response> getChannelByNameWithHttpInfo(
  1. String teamId,
  2. String channelName, {
  3. bool? includeDeleted,
})

Get a channel by name

Gets channel from the provided team id and channel name strings. ##### Permissions read_channel permission for the channel.

Note: This method returns the HTTP Response.

Parameters:

  • String teamId (required): Team GUID

  • String channelName (required): Channel Name

  • bool includeDeleted: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+)

Implementation

Future<Response> getChannelByNameWithHttpInfo(
  String teamId,
  String channelName, {
  bool? includeDeleted,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/teams/{team_id}/channels/name/{channel_name}'
      .replaceAll('{team_id}', teamId)
      .replaceAll('{channel_name}', channelName);

  // 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));
  }

  const contentTypes = <String>[];

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