NAME

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

VERSION

version 0.28

DESCRIPTION

Channel member related API calls.

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_member;

Optionally, you can set global channel and user IDs, and not pass those arguments to every method:

    $resource->channel_id('CHANNEL-ID-HERE');
    $resource->user_id('USER-ID-HERE');

This would make the get() call look like:

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

And the add() one look like:

    my $response = $resource->add({
        user_id      => '...',
        post_root_id => '...',
    });

METHODS

add()

Add user to channel

    my $response = $resource->add('CHANNEL-ID-HERE', {
        # Required parameters:
        user_id => '...',

        # Optional parameters:
        post_root_id => '...',
    });
all()

Get channel members

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

Get channel member

    my $response = $resource->get('CHANNEL-ID-HERE', 'USER-ID-HERE');
get_many()

Get channel members by IDs

remove()

Remove user from channel

    my $response = $resource->remove('CHANNEL-ID-HERE', 'USER-ID-HERE');
set_notify_props()

Update channel notifications

    my $response = $resource->set_notify_props('CHANNEL-ID-HERE', 'USER-ID-HERE', {
        email       => \1, # or \0 for false
        push        => \1,
        desktop     => \1,
        mark_unread => \1,
    });
set_roles()

Update channel roles

    my $response = $resource->set_roles('CHANNEL-ID-HERE', 'USER-ID-HERE', {
        # Required parameters:
        roles => 'SPACE DELIMITED ROLES',
    });
set_scheme_roles()

Update the scheme-derived roles of a channel member

    my $response = $resource->set_scheme_roles('CHANNEL-ID-HERE', 'USER-ID-HERE', {
        # Required parameters:
        scheme_admin => \0, # false
        scheme_user  => \1, # or true
    });
set_viewed()

View channel

    my $response = $resource->set_viewed('CHANNEL-ID-HERE', 'USER-ID-HERE', {
        # Optional parameters:
        prev_channel_id => '...',
    });

AUTHOR

Mike Jones <mike@netsplit.org.uk>

COPYRIGHT AND LICENSE

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

This is free software, licensed under:

  The MIT (X11) License