blib/lib/WebService/Mattermost/V4/API/Resource/Teams.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 9 | 33.3 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 3 | 33.3 |
pod | 2 | 2 | 100.0 |
total | 6 | 14 | 42.8 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package WebService::Mattermost::V4::API::Resource::Teams; 2: 3: # ABSTRACT: Wrapped API methods for the teams API endpoints. 4: 5: use Moo; 6: 7: extends 'WebService::Mattermost::V4::API::Resource'; 8: 9: ################################################################################ 10: 11: sub create { 12: my $self = shift; 13: my $args = shift; 14: 15: return $self->_single_view_post({ 16: parameters => $args, 17: required => [ qw(name display_name type) ], 18: }); 19: } 20: 21: sub list { 22: my $self = shift; 23: my $args = shift; 24: 25: return $self->_get({ 26: view => 'Team', 27: parameters => $args, 28: }); 29: } 30: 31: ################################################################################ 32: 33: 1; 34: 35: __END__ 36: 37: =pod 38: 39: =encoding UTF-8 40: 41: =head1 NAME 42: 43: WebService::Mattermost::V4::API::Resource::Teams - Wrapped API methods for the teams API endpoints. 44: 45: =head1 VERSION 46: 47: version 0.28 48: 49: =head1 DESCRIPTION 50: 51: =head2 USAGE 52: 53: use WebService::Mattermost; 54: 55: my $mm = WebService::Mattermost->new({ 56: authenticate => 1, 57: username => 'me@somewhere.com', 58: password => 'hunter2', 59: base_url => 'https://my.mattermost.server.com/api/v4/', 60: }); 61: 62: my $resource = $mm->api->teams; 63: 64: =head2 METHODS 65: 66: =over 4 67: 68: =item C<create()> 69: 70: L<Create a team|https://api.mattermost.com/#tag/teams%2Fpaths%2F~1teams%2Fpost> 71: 72: my $response = $resource->create({ 73: # Required parameters: 74: name => '...', 75: type => 'O', # O for open, I for invite only 76: display_name => '...', 77: }); 78: 79: =item C<list()> 80: 81: L<Get teams|https://api.mattermost.com/#tag/teams%2Fpaths%2F~1teams%2Fget> 82: 83: my $response = $resource->list({ 84: # Optional parameters: 85: page => 0, 86: per_page => 60, 87: }); 88: 89: =back 90: 91: =head1 AUTHOR 92: 93: Mike Jones <mike@netsplit.org.uk> 94: 95: =head1 COPYRIGHT AND LICENSE 96: 97: This software is Copyright (c) 2020 by Mike Jones. 98: 99: This is free software, licensed under: 100: 101: The MIT (X11) License 102: 103: =cut 104: |