line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::Audience; |
2
|
9
|
|
|
9
|
|
1107061
|
use strict; |
|
9
|
|
|
|
|
105
|
|
|
9
|
|
|
|
|
244
|
|
3
|
9
|
|
|
9
|
|
45
|
use warnings; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
235
|
|
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
3520
|
use LINE::Bot::API::Client; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
307
|
|
6
|
9
|
|
|
9
|
|
3444
|
use LINE::Bot::API::Response::Common; |
|
9
|
|
|
|
|
32
|
|
|
9
|
|
|
|
|
207
|
|
7
|
9
|
|
|
9
|
|
3433
|
use LINE::Bot::API::Response::AudienceMultipleData; |
|
9
|
|
|
|
|
35
|
|
|
9
|
|
|
|
|
242
|
|
8
|
9
|
|
|
9
|
|
3459
|
use LINE::Bot::API::Response::AudienceData; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
240
|
|
9
|
9
|
|
|
9
|
|
3484
|
use LINE::Bot::API::Response::AudienceGroupForUploadingUserId; |
|
9
|
|
|
|
|
33
|
|
|
9
|
|
|
|
|
248
|
|
10
|
9
|
|
|
9
|
|
3444
|
use LINE::Bot::API::Response::AudienceGroupForClickRetargeting; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
244
|
|
11
|
9
|
|
|
9
|
|
3403
|
use LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
240
|
|
12
|
9
|
|
|
9
|
|
3336
|
use LINE::Bot::API::Response::AudienceAuthorityLevel; |
|
9
|
|
|
|
|
34
|
|
|
9
|
|
|
|
|
263
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant { |
15
|
9
|
|
|
|
|
505
|
DEFAULT_MESSAGING_API_ENDPOINT => 'https://api.line.me/v2/bot/', |
16
|
9
|
|
|
9
|
|
60
|
}; |
|
9
|
|
|
|
|
20
|
|
17
|
9
|
|
|
9
|
|
3673
|
use Furl; |
|
9
|
|
|
|
|
34109
|
|
|
9
|
|
|
|
|
258
|
|
18
|
9
|
|
|
9
|
|
55
|
use Carp 'croak'; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
364
|
|
19
|
9
|
|
|
9
|
|
4388
|
use URI; |
|
9
|
|
|
|
|
38187
|
|
|
9
|
|
|
|
|
308
|
|
20
|
9
|
|
|
9
|
|
3464
|
use URI::QueryParam; |
|
9
|
|
|
|
|
6596
|
|
|
9
|
|
|
|
|
6208
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
9
|
|
|
9
|
0
|
1046
|
my($class, %args) = @_; |
24
|
|
|
|
|
|
|
|
25
|
9
|
|
|
|
|
79
|
my $client = LINE::Bot::API::Client->new(%args); |
26
|
|
|
|
|
|
|
bless { |
27
|
|
|
|
|
|
|
client => $client, |
28
|
|
|
|
|
|
|
channel_secret => $args{channel_secret}, |
29
|
|
|
|
|
|
|
channel_access_token => $args{channel_access_token}, |
30
|
9
|
|
50
|
|
|
572
|
messaging_api_endpoint => $args{messaging_api_endpoint} // DEFAULT_MESSAGING_API_ENDPOINT, |
31
|
|
|
|
|
|
|
}, $class; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub request { |
35
|
11
|
|
|
11
|
0
|
55
|
my ($self, $method, $path, @payload) = @_; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return $self->{client}->$method( |
38
|
11
|
|
|
|
|
143
|
$self->{messaging_api_endpoint} . $path, |
39
|
|
|
|
|
|
|
@payload, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub rename_audience { |
44
|
1
|
|
|
1
|
0
|
1814
|
my ($self, $opts) = @_; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/'. $opts->{audience_group_id} . '/updateDescription', +{ |
47
|
|
|
|
|
|
|
'description' => $opts->{description}, |
48
|
1
|
|
|
|
|
14
|
}); |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::Common->new(%{ $res }); |
|
1
|
|
|
|
|
7
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub create_audience_for_uploading { |
54
|
2
|
|
|
2
|
0
|
8806
|
my ($self, $opts) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/upload', +{ |
57
|
|
|
|
|
|
|
'description' => $opts->{description}, |
58
|
|
|
|
|
|
|
'isIfaAudience' => $opts->{isIfaAudience}, |
59
|
|
|
|
|
|
|
'uploadDescription' => $opts->{uploadDescription}, |
60
|
|
|
|
|
|
|
'audiences' => $opts->{audiences}, |
61
|
2
|
|
|
|
|
18
|
}); |
62
|
2
|
|
|
|
|
9
|
LINE::Bot::API::Response::AudienceGroupForUploadingUserId->new(%{ $res }); |
|
2
|
|
|
|
|
29
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub create_audience_for_click_based_retartgeting { |
66
|
1
|
|
|
1
|
0
|
1587
|
my ($self, $opts) = @_; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/click', +{ |
69
|
|
|
|
|
|
|
'description' => $opts->{description}, |
70
|
|
|
|
|
|
|
'requestId' => $opts->{requestId}, |
71
|
|
|
|
|
|
|
'clickUrl' => $opts->{clickUrl}, |
72
|
1
|
|
|
|
|
7
|
}); |
73
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::AudienceGroupForClickRetargeting->new(%{ $res }); |
|
1
|
|
|
|
|
21
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub create_audience_for_impression_based_retargeting { |
77
|
1
|
|
|
1
|
0
|
1602
|
my ($self, $opts) = @_; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/imp', +{ |
80
|
|
|
|
|
|
|
'description' => $opts->{description}, |
81
|
|
|
|
|
|
|
'requestId' => $opts->{requestId}, |
82
|
1
|
|
|
|
|
8
|
}); |
83
|
1
|
|
|
|
|
5
|
LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting->new(%{ $res }); |
|
1
|
|
|
|
|
22
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub get_audience_data { |
87
|
1
|
|
|
1
|
0
|
1415
|
my ($self, $opts) = @_; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
7
|
my $res = $self->request(get => 'audienceGroup/' . $opts->{audienceGroupId}, +{}); |
90
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::AudienceData->new(%{ $res }); |
|
1
|
|
|
|
|
24
|
|
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub update_authority_level { |
94
|
1
|
|
|
1
|
0
|
2035
|
my ($self, $opts) = @_; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
my $res = $self->request(put => 'audienceGroup/authorityLevel', +{ |
97
|
|
|
|
|
|
|
'authorityLevel' => $opts->{authorityLevel}, |
98
|
1
|
|
|
|
|
17
|
}); |
99
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::Common->new(%{ $res }); |
|
1
|
|
|
|
|
8
|
|
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub delete_audience { |
103
|
1
|
|
|
1
|
0
|
1356
|
my ($self, $ops) = @_; |
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
|
|
8
|
my $res = $self->request(delete => 'audienceGroup/' . $ops->{audienceGroupId}, +{}); |
106
|
1
|
|
|
|
|
2
|
LINE::Bot::API::Response::Common->new(%{ $res }); |
|
1
|
|
|
|
|
6
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub get_authority_level { |
110
|
1
|
|
|
1
|
0
|
1323
|
my ($self) = @_; |
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
|
|
5
|
my $res = $self->request(get => 'audienceGroup/authorityLevel', +{}); |
113
|
1
|
|
|
|
|
2
|
LINE::Bot::API::Response::AudienceAuthorityLevel->new(%{ $res }); |
|
1
|
|
|
|
|
12
|
|
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub get_data_for_multiple_audience { |
117
|
2
|
|
|
2
|
0
|
7501
|
my ($self, $opts) = @_; |
118
|
|
|
|
|
|
|
|
119
|
2
|
|
|
|
|
15
|
my $uri = URI->new('audienceGroup/list'); |
120
|
2
|
|
50
|
|
|
4394
|
$uri->query_param(page => $opts->{page} // 1); |
121
|
2
|
|
100
|
|
|
342
|
$uri->query_param(description => $opts->{description} // ''); |
122
|
2
|
|
100
|
|
|
274
|
$uri->query_param(status => $opts->{status} // ''); |
123
|
2
|
|
100
|
|
|
294
|
$uri->query_param(size => $opts->{size} // 20); |
124
|
2
|
|
100
|
|
|
356
|
$uri->query_param(includesExternalPublicGroups => $opts->{includesExternalPublicGroups} // ''); |
125
|
2
|
|
100
|
|
|
383
|
$uri->query_param(createRoute => $opts->{createRoute} // ''); |
126
|
|
|
|
|
|
|
|
127
|
2
|
|
|
|
|
433
|
my $res = $self->request(get => $uri->as_string); |
128
|
2
|
|
|
|
|
5
|
LINE::Bot::API::Response::AudienceMultipleData->new(%{ $res }); |
|
2
|
|
|
|
|
24
|
|
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |
132
|
|
|
|
|
|
|
__END__ |