Mattermost/V4/API/Object/Team.pm

filter: Statementstmt 81.8% 27 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 1 totaltotal 65.3% 32 / 49 CC 3 SCAR 10.5
CC
3
Cov
73%
_build_is_invite_only
6.0
_build_open_invite
6.0
_build_company_name
2.0
CRAP 2.8
« Mattermost/V4/API/Object/User/Session.pm ↑ Summary Mattermost/V4/API/Object/Role/BelongingToChannel.pm »
1 package WebService::Mattermost::V4::API::Object::Team;
2  
3 # ABSTRACT: A team item.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard qw(Bool InstanceOf Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 ▶use WebService::Mattermost::Helper::Alias 'v4';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 extends 'WebService::Mattermost::V4::API::Object';
11 12 with qw(
12 WebService::Mattermost::V4::API::Object::Role::APIMethods
13 WebService::Mattermost::V4::API::Object::Role::Name
14 WebService::Mattermost::V4::API::Object::Role::Description
15 WebService::Mattermost::V4::API::Object::Role::ID
16 WebService::Mattermost::V4::API::Object::Role::Timestamps
17 );
18  
19 ################################################################################
20  
21 12 has channels => (is => 'lazy', isa => InstanceOf[v4 'Team::Channels']);
22 12 has company_name => (is => 'lazy', isa => Str);
23 12 has display_name => (is => 'lazy', isa => Str);
24 12 has email => (is => 'lazy', isa => Str);
25 12 has invite_id => (is => 'lazy', isa => Str);
26 12 has is_invite_only => (is => 'lazy', isa => Bool);
27 12 has open_invite => (is => 'lazy', isa => Bool);
28  
29 ################################################################################
30  
31 sub BUILD {
32 1 ▶ my $self = shift;
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
33  
34 1 $self->api_resource_name('team');
35 1 $self->set_available_api_methods([ qw(
36 add_member
37 add_members
38 channels.public
39 delete
40 get_icon
41 invite_by_emails
42 members
43 members_by_ids
44 patch
45 remove_icon
46 search_posts
47 set_icon
48 set_scheme
49 stats
50 update
51 ) ]);
52  
53 1 return 1;
54 }
55  
56 ################################################################################
57  
58 sub _build_channels {
59 1 ▶ my $self = shift;
Subroutine _build_channels: called CC=1 SCAR=0.0
60  
61 1 my $team_channels = $self->new_related_resource('teams', 'Team::Channels');
62  
63 1 $team_channels->id($self->id);
64  
65 1 return $team_channels;
66 }
67  
68 0 ▶sub _build_company_name { shift->raw_data->{company_name} }
Subroutine _build_company_name: not called CC=1 SCAR=6.9
69 0 ▶sub _build_display_name { shift->raw_data->{display_name} }
Subroutine _build_display_name: not called CC=1 SCAR=6.9
70 0 ▶sub _build_email { shift->raw_data->{email} }
Subroutine _build_email: not called CC=1 SCAR=6.9
71 0 ▶sub _build_invite_id { shift->raw_data->{invite_id} }
Subroutine _build_invite_id: not called CC=1 SCAR=6.9
72 0 ▶sub _build_is_invite_only { shift->raw_data->{type} eq 'I' ? 1 : 0 }
Subroutine _build_is_invite_only: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->raw_data->{'type'} eq 'I' ? : 0 0 0
73 0 ▶sub _build_open_invite { shift->raw_data->{open_invite} ? 1 : 0 }
Subroutine _build_open_invite: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->raw_data->{'open_invite'} ? : 0 0 0
74  
75 ################################################################################
76  
77 12 1;
78  
79 __END__
80  
81 =pod
82  
83 =encoding UTF-8
84  
85 =head1 NAME
86  
87 WebService::Mattermost::V4::API::Object::Team - A team item.
88  
89 =head1 VERSION
90  
91 version 0.28
92  
93 =head1 DESCRIPTION
94  
95 Object version of a Mattermost team.
96  
97 =head2 METHODS
98  
99 See matching methods in L<WebService::Mattermost::V4::API::Resource::Team>
100 for full documentation.
101  
102 ID parameters are not required:
103  
104 my $response = $mattermost->api->team->get('ID-HERE')->item->delete();
105  
106 Is the same as:
107  
108 my $response = $mattermost->api->team->delete('ID-HERE');
109  
110 =over 4
111  
112 =item C<add_member()>
113  
114 =item C<add_members()>
115  
116 =item C<delete()>
117  
118 =item C<get_icon()>
119  
120 =item C<invite_by_emails()>
121  
122 =item C<members()>
123  
124 =item C<members_by_ids()>
125  
126 =item C<patch()>
127  
128 =item C<remove_icon()>
129  
130 =item C<search_posts()>
131  
132 =item C<set_icon()>
133  
134 =item C<set_scheme()>
135  
136 =item C<stats()>
137  
138 =item C<update()>
139  
140 =back
141  
142 =head2 ATTRIBUTES
143  
144 =over 4
145  
146 =item C<id>
147  
148 The team's ID.
149  
150 =item C<name>
151  
152 The team's name.
153  
154 =item C<display_name>
155  
156 =item C<email>
157  
158 Contact address for the team.
159  
160 =item C<invite_id>
161  
162 =item C<is_invite_only>
163  
164 Boolean.
165  
166 =item C<open_invite>
167  
168 Boolean.
169  
170 =back
171  
172 =head1 SEE ALSO
173  
174 =over 4
175  
176 =item L<WebService::Mattermost::V4::API::Resource::Team>
177  
178 =item L<WebService::Mattermost::V4::API::Resource::Teams>
179  
180 =item L<WebService::Mattermost::V4::API::Object::Role::Name>
181  
182 =item L<WebService::Mattermost::V4::API::Object::Role::Description>
183  
184 =item L<WebService::Mattermost::V4::API::Object::Role::ID>
185  
186 =item L<WebService::Mattermost::V4::API::Object::Role::Timestamps>
187  
188 =back
189  
190 =head1 AUTHOR
191  
192 Mike Jones <mike@netsplit.org.uk>
193  
194 =head1 COPYRIGHT AND LICENSE
195  
196 This software is Copyright (c) 2020 by Mike Jones.
197  
198 This is free software, licensed under:
199  
200 The MIT (X11) License
201  
202 =cut
« Mattermost/V4/API/Object/User/Session.pm ↑ Summary Mattermost/V4/API/Object/Role/BelongingToChannel.pm »