updatePostWithHttpInfo method

Future<Response> updatePostWithHttpInfo(
  1. String postId,
  2. MmUpdatePostRequest mmUpdatePostRequest
)

Update a post

Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank. ##### Permissions Must have edit_post permission for the channel the post is in.

Note: This method returns the HTTP Response.

Parameters:

  • String postId (required): ID of the post to update

  • MmUpdatePostRequest mmUpdatePostRequest (required): Post object that is to be updated

Implementation

Future<Response> updatePostWithHttpInfo(
  String postId,
  MmUpdatePostRequest mmUpdatePostRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/posts/{post_id}'.replaceAll('{post_id}', postId);

  // ignore: prefer_final_locals
  Object? postBody = mmUpdatePostRequest;

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

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

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