NAME

WebService::Mattermost::V4::API::Resource::Channel - Wrapped API methods for the channel API endpoints.

VERSION

version 0.30

DESCRIPTION

USAGE

my $mm = WebService::Mattermost->new({
    authenticate => 1,
    username     => 'me@somewhere.com',
    password     => 'hunter2',
    base_url     => 'https://my.mattermost.server.com/api/v4/',
});

my $resource = $mm->api->channel;

Optionally, you can set a global channel ID and not pass that argument to every method:

$resource->id('CHANNEL-ID-HERE');

This would make the get() call look like:

my $response = $resource->get();

METHODS

get()

Get a channel

my $response = $resource->get('CHANNEL-ID-HERE');
update()

Update a channel

my $response = $resource->update('CHANNEL-ID-HERE', {
    # Optional parameters
    name         => '...',
    display_name => '...',
    purpose      => '...',
    header       => '...',
    type         => '...',
});
delete()

Delete a channel

my $response = $resource->delete('CHANNEL-ID-HERE');
patch()

Patch a channel

my $response = $resource->patch('CHANNEL-ID-HERE', {
    # Optional parameters
    name         => '...',
    display_name => '...',
    purpose      => '...',
    header       => '...',
});
toggle_private_status()

Convert a channel from public to private

my $response = $resource->toggle_private_status('CHANNEL-ID-HERE');
restore()

Restore a channel

my $response = $resource->restore('CHANNEL-ID-HERE');
stats()

Get channel statistics

my $response = $resource->stats('CHANNEL-ID-HERE');
pinned()

Get a channel's pinned posts

my $response = $resource->pinned('CHANNEL-ID-HERE');
set_scheme()

Set a channel's scheme

my $response = $resource->set_scheme('CHANNEL-ID-HERE', {
    # Required parameters:
    scheme_id => '...',
});
posts()

Get posts for a channel

my $response = $resource->posts('CHANNEL-ID-HERE', {
    # Optional parameters:
    page     => 0,
    per_page => 60,
    since    => 'UNIX-TIMESTAMP', # milliseconds
    before   => 'POST-ID-HERE',
    after    => 'POST-ID-HERE',
});

AUTHOR

Mike Jones <mike@netsplit.org.uk>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Mike Jones.

This is free software, licensed under:

The MIT (X11) License