NAME

WebService::Mattermost::V4::API::Resource::Team - Wrapped API methods for the team API endpoints.

VERSION

version 0.29

DESCRIPTION

API methods relating to a single team by ID or name.

USAGE

use WebService::Mattermost;

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

METHODS

get()

Get a team

my $response = $resource->get('TEAM-ID-HERE');
get_by_name()

Get a team by name

my $response = $resource->get_by_name('TEAM-NAME-HERE');
update()

Update a team

my $response = $resource->update('TEAM-ID-HERE', {
    # Required parameters:
    display_name    => '...',
    description     => '...',
    company_name    => '...',
    allowed_domains => '...',
    invite_id       => '...',
});
delete()

Delete a team

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

Patch a team

my $response = $resource->patch('TEAM-ID-HERE', {
    # Optional parameters:
    display_name    => '...',
    description     => '...',
    company_name    => '...',
    allowed_domains => '...',
    invite_id       => '...',
});
exists_by_name()

Check if team exists

my $response = $resource->exists_by_name('TEAM-NAME-HERE');
members()

Get team members

my $response = $resource->members('TEAM-ID-HERE');
members_by_ids()

Get team members by IDs

my $response = $resource->members_by_ids('TEAM-ID-HERE', [ qw(
    USER-ID-HERE
    USER-ID-HERE
    USER-ID-HERE
) ]);
add_member()

Add user to team

my $response = $resource->add_member('TEAM-ID-HERE', 'USER-ID-HERE');
add_members()

Add multiple users to team

my $response = $resource->add_members('TEAM-ID-HERE', [
    { user_id => 'USER-ID-HERE', roles => 'ROLES-HERE' },
    { user_id => 'USER-ID-HERE', roles => 'ROLES-HERE' },
    { user_id => 'USER-ID-HERE', roles => 'ROLES-HERE' },
]);
remove_member()

Remove user from team

my $response = $resource->remove_member('TEAM-ID-HERE', 'USER-ID-HERE');
stats()

Get a team stats

my $response = $resource->stats('TEAM-ID-HERE');
get_icon()

Get the team icon

my $response = $resource->get_icon('TEAM-ID-HERE');
set_icon()

Sets the team icon

my $response = $resource->set_icon('TEAM-ID-HERE', '/path/to/icon/here.png');
remove_icon()

Remove the team icon

my $response = $resource->remove_icon('TEAM-ID-HERE');
invite_by_emails()

Invite users to the team by email

my $response = $resource->invite_by_emails('TEAM-ID-HERE', [
    EMAIL-HERE
    EMAIL-HERE
    EMAIL-HERE
]);
import_from_existing()

Import a Team from other application

my $response = $resource->import_from_existing('TEAM-ID-HERE', {
    filename   => 'IMPORT-FILENAME',
    filesize   => 'filesize',
    importFrom => '...',
});
search_posts()

Search for team posts

my $response = $resource->search_posts('TEAM-ID-HERE', {
    # Required parameters:
    terms => '...',

    # Optional parameters
    is_or_search             => \1, # or \0 for false
    time_zone_offset         => 0,
    include_deleted_channels => \1, # or \0 for false
    page                     => 0,
    per_page                 => 60,
});

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