line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Slack::WebApi::Chat; |
2
|
3
|
|
|
3
|
|
2358
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
94
|
|
3
|
3
|
|
|
3
|
|
22
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
77
|
|
4
|
3
|
|
|
3
|
|
15
|
use utf8; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
20
|
|
5
|
3
|
|
|
3
|
|
101
|
use feature qw/state/; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
235
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
20
|
use parent 'WebService::Slack::WebApi::Base'; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
23
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
188
|
use JSON; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
28
|
|
10
|
|
|
|
|
|
|
use WebService::Slack::WebApi::Generator ( |
11
|
3
|
|
|
|
|
71
|
delete => { |
12
|
|
|
|
|
|
|
channel => 'Str', |
13
|
|
|
|
|
|
|
ts => 'Str', |
14
|
|
|
|
|
|
|
as_user => { isa => 'Bool', optional => 1 }, |
15
|
|
|
|
|
|
|
}, |
16
|
|
|
|
|
|
|
me_message => { |
17
|
|
|
|
|
|
|
channel => 'Str', |
18
|
|
|
|
|
|
|
text => 'Str', |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
unfurl => { |
21
|
|
|
|
|
|
|
channel => 'Str', |
22
|
|
|
|
|
|
|
ts => 'Str', |
23
|
|
|
|
|
|
|
unfurls => 'Str', |
24
|
|
|
|
|
|
|
user_auth_message => { isa => 'Str', optional => 1 }, |
25
|
|
|
|
|
|
|
user_auth_required => { isa => 'Bool', optional => 1 }, |
26
|
|
|
|
|
|
|
user_auth_url => { isa => 'Str', optional => 1 }, |
27
|
|
|
|
|
|
|
}, |
28
|
3
|
|
|
3
|
|
628
|
); |
|
3
|
|
|
|
|
8
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub post_ephemeral { |
31
|
1
|
|
|
1
|
0
|
461
|
state $rule = Data::Validator->new( |
32
|
|
|
|
|
|
|
channel => 'Str', |
33
|
|
|
|
|
|
|
text => { isa => 'Str', optional => 1 }, |
34
|
|
|
|
|
|
|
user => 'Str', |
35
|
|
|
|
|
|
|
as_user => { isa => 'Bool', optional => 1 }, |
36
|
|
|
|
|
|
|
attachments => { isa => 'ArrayRef', optional => 1 }, |
37
|
|
|
|
|
|
|
link_names => { isa => 'Bool', optional => 1 }, |
38
|
|
|
|
|
|
|
parse => { isa => 'Str', optional => 1 }, |
39
|
|
|
|
|
|
|
)->with('Method', 'AllowExtra'); |
40
|
1
|
|
|
|
|
1952
|
my ($self, $args, %extra) = $rule->validate(@_); |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
173
|
$args->{attachments} = encode_json $args->{attachments} if exists $args->{attachments}; |
43
|
1
|
|
|
|
|
8
|
return $self->request('postEphemeral', {%$args, %extra}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub post_message { |
47
|
1
|
|
|
1
|
0
|
494
|
state $rule = Data::Validator->new( |
48
|
|
|
|
|
|
|
channel => 'Str', |
49
|
|
|
|
|
|
|
text => { isa => 'Str', optional => 1 }, |
50
|
|
|
|
|
|
|
as_user => { isa => 'Bool', optional => 1 }, |
51
|
|
|
|
|
|
|
attachments => { isa => 'ArrayRef', optional => 1 }, |
52
|
|
|
|
|
|
|
icon_emoji => { isa => 'Str', optional => 1 }, |
53
|
|
|
|
|
|
|
icon_url => { isa => 'Str', optional => 1 }, |
54
|
|
|
|
|
|
|
link_names => { isa => 'Bool', optional => 1 }, |
55
|
|
|
|
|
|
|
parse => { isa => 'Str', optional => 1 }, |
56
|
|
|
|
|
|
|
reply_broadcast => { isa => 'Bool', optional => 1 }, |
57
|
|
|
|
|
|
|
thread_ts => { isa => 'Str', optional => 1 }, |
58
|
|
|
|
|
|
|
unfurl_links => { isa => 'Bool', optional => 1 }, |
59
|
|
|
|
|
|
|
unfurl_media => { isa => 'Bool', optional => 1 }, |
60
|
|
|
|
|
|
|
username => { isa => 'Str', optional => 1 }, |
61
|
|
|
|
|
|
|
)->with('Method', 'AllowExtra'); |
62
|
1
|
|
|
|
|
2251
|
my ($self, $args, %extra) = $rule->validate(@_); |
63
|
|
|
|
|
|
|
|
64
|
1
|
50
|
|
|
|
297
|
$args->{attachments} = encode_json $args->{attachments} if exists $args->{attachments}; |
65
|
1
|
|
|
|
|
12
|
return $self->request('postMessage', {%$args, %extra}); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub update { |
69
|
1
|
|
|
1
|
0
|
462
|
state $rule = Data::Validator->new( |
70
|
|
|
|
|
|
|
channel => 'Str', |
71
|
|
|
|
|
|
|
text => { isa => 'Str', optional => 1 }, |
72
|
|
|
|
|
|
|
ts => 'Str', |
73
|
|
|
|
|
|
|
as_user => { isa => 'Bool', optional => 1 }, |
74
|
|
|
|
|
|
|
attachments => { isa => 'ArrayRef', optional => 1 }, |
75
|
|
|
|
|
|
|
link_names => { isa => 'Bool', optional => 1 }, |
76
|
|
|
|
|
|
|
parse => { isa => 'Str', optional => 1 }, |
77
|
|
|
|
|
|
|
)->with('Method', 'AllowExtra'); |
78
|
1
|
|
|
|
|
1876
|
my ($self, $args, %extra) = $rule->validate(@_); |
79
|
|
|
|
|
|
|
|
80
|
1
|
50
|
|
|
|
203
|
$args->{attachments} = encode_json $args->{attachments} if exists $args->{attachments}; |
81
|
1
|
|
|
|
|
9
|
return $self->request('update', {%$args, %extra}); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|