patchPostWithHttpInfo method

Future<Response> patchPostWithHttpInfo(
  1. String postId,
  2. MmPatchPostRequest mmPatchPostRequest
)

Patch a post

Partially update a post by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored. ##### Permissions Must have the edit_post permission.

Note: This method returns the HTTP Response.

Parameters:

  • String postId (required): Post GUID

  • MmPatchPostRequest mmPatchPostRequest (required): Post object that is to be updated

Implementation

Future<Response> patchPostWithHttpInfo(
  String postId,
  MmPatchPostRequest mmPatchPostRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/posts/{post_id}/patch'.replaceAll('{post_id}', postId);

  // ignore: prefer_final_locals
  Object? postBody = mmPatchPostRequest;

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