Mattermost/V4/API/Resource/Webhook.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod n/a totaltotal 80.0% 24 / 30 CC 1 SCAR 2.5
CC
1
Cov
83%
_build_incoming
2.0
_build_outgoing
2.0
BEGIN
1.0
CRAP 1.3
« Mattermost/V4/API/Resource/User.pm ↑ Summary Mattermost/V4/API/Object/Role/CreatedAt.pm »
1 package WebService::Mattermost::V4::API::Resource::Webhook;
2  
3 # ABSTRACT: Wrapped API methods for the webhook API endpoints.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard 'InstanceOf';
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 12 ▶use WebService::Mattermost::V4::API::Resource::Webhook::Incoming;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 12 ▶use WebService::Mattermost::V4::API::Resource::Webhook::Outgoing;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 12 extends 'WebService::Mattermost::V4::API::Resource';
13  
14 ################################################################################
15  
16 12 has incoming => (is => 'ro', isa => InstanceOf[v4 'Webhook::Incoming'], lazy => 1, builder => 1);
17 12 has outgoing => (is => 'ro', isa => InstanceOf[v4 'Webhook::Incoming'], lazy => 1, builder => 1);
18  
19 ################################################################################
20  
21 sub _build_incoming {
22 0 ▶ my $self = shift;
Subroutine _build_incoming: not called CC=1 SCAR=6.9
23  
24 0 return $self->new_related_resource('webhooks', 'Webhook::Incoming');
25 }
26  
27 sub _build_outgoing {
28 0 ▶ my $self = shift;
Subroutine _build_outgoing: not called CC=1 SCAR=6.9
29  
30 0 return $self->new_related_resource('webhooks', 'Webhook::Outgoing');
31 }
32  
33 ################################################################################
34  
35 12 1;
36  
37 __END__
38  
39 =pod
40  
41 =encoding UTF-8
42  
43 =head1 NAME
44  
45 WebService::Mattermost::V4::API::Resource::Webhook - Wrapped API methods for the webhook API endpoints.
46  
47 =head1 VERSION
48  
49 version 0.28
50  
51 =head1 DESCRIPTION
52  
53 =head2 USAGE
54  
55 use WebService::Mattermost;
56  
57 my $mm = WebService::Mattermost->new({
58 authenticate => 1,
59 username => 'me@somewhere.com',
60 password => 'hunter2',
61 base_url => 'https://my.mattermost.server.com/api/v4/',
62 });
63  
64 my $resource = $mm->api->webhooks;
65  
66 =head2 ATTRIBUTES
67  
68 =over 4
69  
70 =item C<incoming>
71  
72 Contains methods for incoming webhooks. See
73 L<WebService::Mattermost::V4::API::Resource::Webhook::Incoming>.
74  
75 my $incoming = $resource->incoming;
76  
77 =item C<outgoing>
78  
79 Contains methods for outgoing webhooks. See
80 L<WebService::Mattermost::V4::API::Resource::Webhook::Outgoing>.
81  
82 my $outgoing = $resource->outgoing;
83  
84 =back
85  
86 =head1 AUTHOR
87  
88 Mike Jones <mike@netsplit.org.uk>
89  
90 =head1 COPYRIGHT AND LICENSE
91  
92 This software is Copyright (c) 2020 by Mike Jones.
93  
94 This is free software, licensed under:
95  
96 The MIT (X11) License
97  
98 =cut
« Mattermost/V4/API/Resource/User.pm ↑ Summary Mattermost/V4/API/Object/Role/CreatedAt.pm »