getPostThreadWithHttpInfo method

Future<Response> getPostThreadWithHttpInfo(
  1. String postId, {
  2. int? perPage,
  3. String? fromPost,
  4. int? fromCreateAt,
  5. String? direction,
  6. bool? skipFetchThreads,
  7. bool? collapsedThreads,
  8. bool? collapsedThreadsExtended,
})

Get a thread

Get a post and the rest of the posts in the same thread. ##### Permissions Must have read_channel permission for the channel the post is in or if the channel is public, have the read_public_channels permission for the team.

Note: This method returns the HTTP Response.

Parameters:

  • String postId (required): ID of a post in the thread

  • int perPage: The number of posts per page

  • String fromPost: The post_id to return the next page of posts from

  • int fromCreateAt: The create_at timestamp to return the next page of posts from

  • String direction: The direction to return the posts. Either up or down.

  • bool skipFetchThreads: Whether to skip fetching threads or not

  • bool collapsedThreads: Whether the client uses CRT or not

  • bool collapsedThreadsExtended: Whether to return the associated users as part of the response or not

Implementation

Future<Response> getPostThreadWithHttpInfo(
  String postId, {
  int? perPage,
  String? fromPost,
  int? fromCreateAt,
  String? direction,
  bool? skipFetchThreads,
  bool? collapsedThreads,
  bool? collapsedThreadsExtended,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/posts/{post_id}/thread'.replaceAll('{post_id}', postId);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (perPage != null) {
    queryParams.addAll(_queryParams('', 'perPage', perPage));
  }
  if (fromPost != null) {
    queryParams.addAll(_queryParams('', 'fromPost', fromPost));
  }
  if (fromCreateAt != null) {
    queryParams.addAll(_queryParams('', 'fromCreateAt', fromCreateAt));
  }
  if (direction != null) {
    queryParams.addAll(_queryParams('', 'direction', direction));
  }
  if (skipFetchThreads != null) {
    queryParams.addAll(_queryParams('', 'skipFetchThreads', skipFetchThreads));
  }
  if (collapsedThreads != null) {
    queryParams.addAll(_queryParams('', 'collapsedThreads', collapsedThreads));
  }
  if (collapsedThreadsExtended != null) {
    queryParams.addAll(_queryParams('', 'collapsedThreadsExtended', collapsedThreadsExtended));
  }

  const contentTypes = <String>[];

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