line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Slack::WebApi::Chat; |
2
|
3
|
|
|
3
|
|
2359
|
use strict; |
|
3
|
|
|
|
|
22
|
|
|
3
|
|
|
|
|
105
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
80
|
|
4
|
3
|
|
|
3
|
|
16
|
use utf8; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
17
|
|
5
|
3
|
|
|
3
|
|
90
|
use feature qw/state/; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
232
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
20
|
use parent 'WebService::Slack::WebApi::Base'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
26
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
202
|
use JSON::XS; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
419
|
|
10
|
|
|
|
|
|
|
use WebService::Slack::WebApi::Generator ( |
11
|
3
|
|
|
|
|
61
|
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
|
|
22
|
); |
|
3
|
|
|
|
|
7
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub post_ephemeral { |
31
|
1
|
|
|
1
|
0
|
581
|
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
|
|
|
|
|
1899
|
my ($self, $args, %extra) = $rule->validate(@_); |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
206
|
$args->{attachments} = encode_json $args->{attachments} if exists $args->{attachments}; |
43
|
1
|
|
|
|
|
9
|
return $self->request('postEphemeral', {%$args, %extra}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub post_message { |
47
|
1
|
|
|
1
|
0
|
589
|
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
|
|
|
|
|
2192
|
my ($self, $args, %extra) = $rule->validate(@_); |
63
|
|
|
|
|
|
|
|
64
|
1
|
50
|
|
|
|
383
|
$args->{attachments} = encode_json $args->{attachments} if exists $args->{attachments}; |
65
|
1
|
|
|
|
|
29
|
return $self->request('postMessage', {%$args, %extra}); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub update { |
69
|
1
|
|
|
1
|
0
|
569
|
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
|
|
|
|
|
1908
|
my ($self, $args, %extra) = $rule->validate(@_); |
79
|
|
|
|
|
|
|
|
80
|
1
|
50
|
|
|
|
191
|
$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
|
|
|
|
|
|
|
|