| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package LINE::Bot::Audience; |
|
2
|
9
|
|
|
9
|
|
1261504
|
use strict; |
|
|
9
|
|
|
|
|
118
|
|
|
|
9
|
|
|
|
|
275
|
|
|
3
|
9
|
|
|
9
|
|
48
|
use warnings; |
|
|
9
|
|
|
|
|
22
|
|
|
|
9
|
|
|
|
|
233
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
4254
|
use LINE::Bot::API::Client; |
|
|
9
|
|
|
|
|
26
|
|
|
|
9
|
|
|
|
|
279
|
|
|
6
|
9
|
|
|
9
|
|
4282
|
use LINE::Bot::API::Response::Common; |
|
|
9
|
|
|
|
|
23
|
|
|
|
9
|
|
|
|
|
232
|
|
|
7
|
9
|
|
|
9
|
|
4109
|
use LINE::Bot::API::Response::AudienceMultipleData; |
|
|
9
|
|
|
|
|
27
|
|
|
|
9
|
|
|
|
|
270
|
|
|
8
|
9
|
|
|
9
|
|
4509
|
use LINE::Bot::API::Response::AudienceData; |
|
|
9
|
|
|
|
|
27
|
|
|
|
9
|
|
|
|
|
283
|
|
|
9
|
9
|
|
|
9
|
|
4264
|
use LINE::Bot::API::Response::AudienceGroupForUploadingUserId; |
|
|
9
|
|
|
|
|
26
|
|
|
|
9
|
|
|
|
|
293
|
|
|
10
|
9
|
|
|
9
|
|
4276
|
use LINE::Bot::API::Response::AudienceGroupForClickRetargeting; |
|
|
9
|
|
|
|
|
27
|
|
|
|
9
|
|
|
|
|
258
|
|
|
11
|
9
|
|
|
9
|
|
4199
|
use LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting; |
|
|
9
|
|
|
|
|
28
|
|
|
|
9
|
|
|
|
|
260
|
|
|
12
|
9
|
|
|
9
|
|
4113
|
use LINE::Bot::API::Response::AudienceAuthorityLevel; |
|
|
9
|
|
|
|
|
27
|
|
|
|
9
|
|
|
|
|
305
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use constant { |
|
15
|
9
|
|
|
|
|
553
|
DEFAULT_MESSAGING_API_ENDPOINT => 'https://api.line.me/v2/bot/', |
|
16
|
9
|
|
|
9
|
|
59
|
}; |
|
|
9
|
|
|
|
|
18
|
|
|
17
|
9
|
|
|
9
|
|
4318
|
use Furl; |
|
|
9
|
|
|
|
|
39055
|
|
|
|
9
|
|
|
|
|
317
|
|
|
18
|
9
|
|
|
9
|
|
69
|
use Carp 'croak'; |
|
|
9
|
|
|
|
|
23
|
|
|
|
9
|
|
|
|
|
427
|
|
|
19
|
9
|
|
|
9
|
|
5395
|
use URI; |
|
|
9
|
|
|
|
|
43737
|
|
|
|
9
|
|
|
|
|
314
|
|
|
20
|
9
|
|
|
9
|
|
4334
|
use URI::QueryParam; |
|
|
9
|
|
|
|
|
7355
|
|
|
|
9
|
|
|
|
|
7115
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
|
23
|
9
|
|
|
9
|
0
|
1157
|
my($class, %args) = @_; |
|
24
|
|
|
|
|
|
|
|
|
25
|
9
|
|
|
|
|
92
|
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
|
|
|
634
|
messaging_api_endpoint => $args{messaging_api_endpoint} // DEFAULT_MESSAGING_API_ENDPOINT, |
|
31
|
|
|
|
|
|
|
}, $class; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub request { |
|
35
|
11
|
|
|
11
|
0
|
76
|
my ($self, $method, $path, @payload) = @_; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return $self->{client}->$method( |
|
38
|
11
|
|
|
|
|
116
|
$self->{messaging_api_endpoint} . $path, |
|
39
|
|
|
|
|
|
|
@payload, |
|
40
|
|
|
|
|
|
|
); |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub rename_audience { |
|
44
|
1
|
|
|
1
|
0
|
1552
|
my ($self, $opts) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/'. $opts->{audience_group_id} . '/updateDescription', +{ |
|
47
|
|
|
|
|
|
|
'description' => $opts->{description}, |
|
48
|
1
|
|
|
|
|
8
|
}); |
|
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
|
7336
|
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
|
|
|
|
|
13
|
}); |
|
62
|
2
|
|
|
|
|
6
|
LINE::Bot::API::Response::AudienceGroupForUploadingUserId->new(%{ $res }); |
|
|
2
|
|
|
|
|
18
|
|
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub create_audience_for_click_based_retartgeting { |
|
66
|
1
|
|
|
1
|
0
|
1820
|
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
|
|
|
|
|
17
|
}); |
|
73
|
1
|
|
|
|
|
5
|
LINE::Bot::API::Response::AudienceGroupForClickRetargeting->new(%{ $res }); |
|
|
1
|
|
|
|
|
23
|
|
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub create_audience_for_impression_based_retargeting { |
|
77
|
1
|
|
|
1
|
0
|
1621
|
my ($self, $opts) = @_; |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my $res = $self->request(post => 'audienceGroup/imp', +{ |
|
80
|
|
|
|
|
|
|
'description' => $opts->{description}, |
|
81
|
|
|
|
|
|
|
'requestId' => $opts->{requestId}, |
|
82
|
1
|
|
|
|
|
7
|
}); |
|
83
|
1
|
|
|
|
|
2
|
LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting->new(%{ $res }); |
|
|
1
|
|
|
|
|
18
|
|
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub get_audience_data { |
|
87
|
1
|
|
|
1
|
0
|
1852
|
my ($self, $opts) = @_; |
|
88
|
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
10
|
my $res = $self->request(get => 'audienceGroup/' . $opts->{audienceGroupId}, +{}); |
|
90
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::AudienceData->new(%{ $res }); |
|
|
1
|
|
|
|
|
22
|
|
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub update_authority_level { |
|
94
|
1
|
|
|
1
|
0
|
1582
|
my ($self, $opts) = @_; |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
my $res = $self->request(put => 'audienceGroup/authorityLevel', +{ |
|
97
|
|
|
|
|
|
|
'authorityLevel' => $opts->{authorityLevel}, |
|
98
|
1
|
|
|
|
|
5
|
}); |
|
99
|
1
|
|
|
|
|
2
|
LINE::Bot::API::Response::Common->new(%{ $res }); |
|
|
1
|
|
|
|
|
18
|
|
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub delete_audience { |
|
103
|
1
|
|
|
1
|
0
|
1728
|
my ($self, $ops) = @_; |
|
104
|
|
|
|
|
|
|
|
|
105
|
1
|
|
|
|
|
9
|
my $res = $self->request(delete => 'audienceGroup/' . $ops->{audienceGroupId}, +{}); |
|
106
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::Common->new(%{ $res }); |
|
|
1
|
|
|
|
|
8
|
|
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub get_authority_level { |
|
110
|
1
|
|
|
1
|
0
|
1633
|
my ($self) = @_; |
|
111
|
|
|
|
|
|
|
|
|
112
|
1
|
|
|
|
|
6
|
my $res = $self->request(get => 'audienceGroup/authorityLevel', +{}); |
|
113
|
1
|
|
|
|
|
3
|
LINE::Bot::API::Response::AudienceAuthorityLevel->new(%{ $res }); |
|
|
1
|
|
|
|
|
15
|
|
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub get_data_for_multiple_audience { |
|
117
|
2
|
|
|
2
|
0
|
8504
|
my ($self, $opts) = @_; |
|
118
|
|
|
|
|
|
|
|
|
119
|
2
|
|
|
|
|
15
|
my $uri = URI->new('audienceGroup/list'); |
|
120
|
2
|
|
50
|
|
|
4992
|
$uri->query_param(page => $opts->{page} // 1); |
|
121
|
2
|
|
100
|
|
|
348
|
$uri->query_param(description => $opts->{description} // ''); |
|
122
|
2
|
|
100
|
|
|
325
|
$uri->query_param(status => $opts->{status} // ''); |
|
123
|
2
|
|
100
|
|
|
371
|
$uri->query_param(size => $opts->{size} // 20); |
|
124
|
2
|
|
100
|
|
|
421
|
$uri->query_param(includesExternalPublicGroups => $opts->{includesExternalPublicGroups} // ''); |
|
125
|
2
|
|
100
|
|
|
480
|
$uri->query_param(createRoute => $opts->{createRoute} // ''); |
|
126
|
|
|
|
|
|
|
|
|
127
|
2
|
|
|
|
|
538
|
my $res = $self->request(get => $uri->as_string); |
|
128
|
2
|
|
|
|
|
5
|
LINE::Bot::API::Response::AudienceMultipleData->new(%{ $res }); |
|
|
2
|
|
|
|
|
80
|
|
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |
|
132
|
|
|
|
|
|
|
__END__ |