getChannelByNameForTeamNameWithHttpInfo method

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

Get a channel by name and team name

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

Note: This method returns the HTTP Response.

Parameters:

  • String teamName (required): Team Name

  • String channelName (required): Channel Name

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

Implementation

Future<Response> getChannelByNameForTeamNameWithHttpInfo(
  String teamName,
  String channelName, {
  bool? includeDeleted,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/teams/name/{team_name}/channels/name/{channel_name}'
      .replaceAll('{team_name}', teamName)
      .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,
  );
}