Commit 5685c1aa authored by Mike Jones's avatar Mike Jones 🌶

Available API methods for Post

parent d35fd670
Pipeline #50 passed with stage
......@@ -7,6 +7,7 @@ use WebService::Mattermost::Helper::Alias 'view';
extends 'WebService::Mattermost::V4::API::Object';
with qw(
WebService::Mattermost::V4::API::Object::Role::APIMethods
WebService::Mattermost::V4::API::Object::Role::BelongingToChannel
WebService::Mattermost::V4::API::Object::Role::BelongingToUser
WebService::Mattermost::V4::API::Object::Role::ID
......@@ -41,6 +42,27 @@ has files => (is => 'ro', lazy => 1, builder => 1);
################################################################################
sub BUILD {
my $self = shift;
$self->api_resource_name('post');
$self->available_api_methods([ qw(
delete
update
patch
thread
files
pin
inpin
reactions
perform_action
) ]);
return 1;
}
################################################################################
sub _get_related_post {
my $self = shift;
my $id = shift;
......@@ -103,6 +125,41 @@ WebService::Mattermost::V4::API::Object::Post
Describes a Mattermost post.
=head2 METHODS
See matching methods in C<WebService::Mattermost::V4::API::Resource::Post>
for full documentation.
ID parameters are not required:
my $response = $mattermost->api->post->get('ID-HERE')->item->delete();
Is the same as:
my $response = $mattermost->api->post->delete('ID-HERE');
=over 4
=item C<delete()>
=item C<update()>
=item C<patch()>
=item C<thread()>
=item C<files()>
=item C<pin()>
=item C<inpin()>
=item C<reactions()>
=item C<perform_action()>
=back
=head2 ATTRIBUTES
=over 4
......@@ -149,6 +206,8 @@ Related root post object.
=over 4
=item C<WebService::Mattermost::V4::API::Object::Post>
=item C<WebService::Mattermost::V4::API::Object::Role::BelongingToChannel>
=item C<WebService::Mattermost::V4::API::Object::Role::BelongingToUser>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment