viewChannelWithHttpInfo method

Future<Response> viewChannelWithHttpInfo(
  1. String userId,
  2. MmViewChannelRequest mmViewChannelRequest
)

View channel

Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel. ##### Permissions Must be logged in as user or have edit_other_users permission. Response only includes last_viewed_at_times in Mattermost server 4.3 and newer.

Note: This method returns the HTTP Response.

Parameters:

  • String userId (required): User ID to perform the view action for

  • MmViewChannelRequest mmViewChannelRequest (required): Paremeters affecting how and which channels to view

Implementation

Future<Response> viewChannelWithHttpInfo(
  String userId,
  MmViewChannelRequest mmViewChannelRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/channels/members/{user_id}/view'.replaceAll('{user_id}', userId);

  // ignore: prefer_final_locals
  Object? postBody = mmViewChannelRequest;

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

  const contentTypes = <String>['application/json'];

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