updatePosts method
Future<UpdatePosts200Response?>
updatePosts(
- String companyId,
- String postId,
- PostsUpdate postsUpdate
Update an existing post by ID. Note: last_edited_at is automatically updated.
Parameters:
-
String companyId (required): Unique identifier for the Company
-
String postId (required): Unique identifier for the Post
-
PostsUpdate postsUpdate (required):
Implementation
Future<UpdatePosts200Response?> updatePosts(String companyId, String postId, PostsUpdate postsUpdate,) async {
final response = await updatePostsWithHttpInfo(companyId, postId, postsUpdate,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UpdatePosts200Response',) as UpdatePosts200Response;
}
return null;
}