| 1 | package LINE::Bot::Audience; | ||||||||||||
| 2 | 9 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 9 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 9 | ▶ | use LINE::Bot::API::Client; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 9 | ▶ | use LINE::Bot::API::Response::Common; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 9 | ▶ | use LINE::Bot::API::Response::AudienceMultipleData; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 9 | ▶ | use LINE::Bot::API::Response::AudienceData; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 9 | ▶ | use LINE::Bot::API::Response::AudienceGroupForUploadingUserId; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 9 | ▶ | use LINE::Bot::API::Response::AudienceGroupForClickRetargeting; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 9 | ▶ | use LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 9 | ▶ | use LINE::Bot::API::Response::AudienceAuthorityLevel; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | use constant { | ||||||||||||
| 15 | 9 | DEFAULT_MESSAGING_API_ENDPOINT => 'https://api.line.me/v2/bot/', | |||||||||||
| 16 | 9 | ▶ | }; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | 9 | ▶ | use Furl; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 9 | ▶ | use Carp 'croak'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 9 | ▶ | use URI; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 9 | ▶ | use URI::QueryParam; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | |||||||||||||
| 22 | sub new { | ||||||||||||
| 23 | 9 | ▶ | my($class, %args) = @_; | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||
| 24 | |||||||||||||
| 25 | 9 | 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 | ▶ | messaging_api_endpoint => $args{messaging_api_endpoint} // DEFAULT_MESSAGING_API_ENDPOINT, | ||||||||||
|
Condition50%1/2
$args{"messaging_api_endpoint"} // "https://api.line.me/v2/bot/"
MC/DC0%0/1
$args{"messaging_api_endpoint"} // "https://api.line.me/v2/bot/"
$args{"messaging_api_endpoint"}
Truth table50%1/2
A
A= $args{"messaging_api_endpoint"}
| |||||||||||||
| 31 | }, $class; | ||||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | sub request { | ||||||||||||
| 35 | 11 | ▶ | my ($self, $method, $path, @payload) = @_; | ||||||||||
|
Subroutine
request: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 36 | |||||||||||||
| 37 | return $self->{client}->$method( | ||||||||||||
| 38 | 11 | $self->{messaging_api_endpoint} . $path, | |||||||||||
| 39 | @payload, | ||||||||||||
| 40 | ); | ||||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | sub rename_audience { | ||||||||||||
| 44 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
rename_audience: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 45 | |||||||||||||
| 46 | my $res = $self->request(post => 'audienceGroup/'. $opts->{audience_group_id} . '/updateDescription', +{ | ||||||||||||
| 47 | 'description' => $opts->{description}, | ||||||||||||
| 48 | 1 | }); | |||||||||||
| 49 | |||||||||||||
| 50 | 1 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||
| 51 | } | ||||||||||||
| 52 | |||||||||||||
| 53 | sub create_audience_for_uploading { | ||||||||||||
| 54 | 2 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
create_audience_for_uploading: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 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 | }); | |||||||||||
| 62 | 2 | LINE::Bot::API::Response::AudienceGroupForUploadingUserId->new(%{ $res }); | |||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | sub create_audience_for_click_based_retartgeting { | ||||||||||||
| 66 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
create_audience_for_click_based_retartgeting: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 67 | |||||||||||||
| 68 | my $res = $self->request(post => 'audienceGroup/click', +{ | ||||||||||||
| 69 | 'description' => $opts->{description}, | ||||||||||||
| 70 | 'requestId' => $opts->{requestId}, | ||||||||||||
| 71 | 'clickUrl' => $opts->{clickUrl}, | ||||||||||||
| 72 | 1 | }); | |||||||||||
| 73 | 1 | LINE::Bot::API::Response::AudienceGroupForClickRetargeting->new(%{ $res }); | |||||||||||
| 74 | } | ||||||||||||
| 75 | |||||||||||||
| 76 | sub create_audience_for_impression_based_retargeting { | ||||||||||||
| 77 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
create_audience_for_impression_based_retargeting: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 78 | |||||||||||||
| 79 | my $res = $self->request(post => 'audienceGroup/imp', +{ | ||||||||||||
| 80 | 'description' => $opts->{description}, | ||||||||||||
| 81 | 'requestId' => $opts->{requestId}, | ||||||||||||
| 82 | 1 | }); | |||||||||||
| 83 | 1 | LINE::Bot::API::Response::AudienceGroupForImpressionRetargeting->new(%{ $res }); | |||||||||||
| 84 | } | ||||||||||||
| 85 | |||||||||||||
| 86 | sub get_audience_data { | ||||||||||||
| 87 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
get_audience_data: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 88 | |||||||||||||
| 89 | 1 | my $res = $self->request(get => 'audienceGroup/' . $opts->{audienceGroupId}, +{}); | |||||||||||
| 90 | 1 | LINE::Bot::API::Response::AudienceData->new(%{ $res }); | |||||||||||
| 91 | } | ||||||||||||
| 92 | |||||||||||||
| 93 | sub update_authority_level { | ||||||||||||
| 94 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
update_authority_level: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 95 | |||||||||||||
| 96 | my $res = $self->request(put => 'audienceGroup/authorityLevel', +{ | ||||||||||||
| 97 | 'authorityLevel' => $opts->{authorityLevel}, | ||||||||||||
| 98 | 1 | }); | |||||||||||
| 99 | 1 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||
| 100 | } | ||||||||||||
| 101 | |||||||||||||
| 102 | sub delete_audience { | ||||||||||||
| 103 | 1 | ▶ | my ($self, $ops) = @_; | ||||||||||
|
Subroutine
delete_audience: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 104 | |||||||||||||
| 105 | 1 | my $res = $self->request(delete => 'audienceGroup/' . $ops->{audienceGroupId}, +{}); | |||||||||||
| 106 | 1 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||
| 107 | } | ||||||||||||
| 108 | |||||||||||||
| 109 | sub get_authority_level { | ||||||||||||
| 110 | 1 | ▶ | my ($self) = @_; | ||||||||||
|
Subroutine
get_authority_level: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 111 | |||||||||||||
| 112 | 1 | my $res = $self->request(get => 'audienceGroup/authorityLevel', +{}); | |||||||||||
| 113 | 1 | LINE::Bot::API::Response::AudienceAuthorityLevel->new(%{ $res }); | |||||||||||
| 114 | } | ||||||||||||
| 115 | |||||||||||||
| 116 | sub get_data_for_multiple_audience { | ||||||||||||
| 117 | 2 | ▶ | my ($self, $opts) = @_; | ||||||||||
|
Subroutine
get_data_for_multiple_audience: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||
| 118 | |||||||||||||
| 119 | 2 | my $uri = URI->new('audienceGroup/list'); | |||||||||||
| 120 | 2 | ▶ | $uri->query_param(page => $opts->{page} // 1); | ||||||||||
|
Condition50%1/2
$opts->{"page"} // 1
MC/DC0%0/1
$opts->{"page"} // 1
$opts->{"page"}
Truth table50%1/2
A
A= $opts->{"page"}
| |||||||||||||
| 121 | 2 | ▶ | $uri->query_param(description => $opts->{description} // ''); | ||||||||||
|
Condition100%2/2
$opts->{"description"} // ""
MC/DC100%1/1
$opts->{"description"} // ""
$opts->{"description"}
Truth table100%2/2
A
A= $opts->{"description"}
| |||||||||||||
| 122 | 2 | ▶ | $uri->query_param(status => $opts->{status} // ''); | ||||||||||
|
Condition100%2/2
$opts->{"status"} // ""
MC/DC100%1/1
$opts->{"status"} // ""
$opts->{"status"}
Truth table100%2/2
A
A= $opts->{"status"}
| |||||||||||||
| 123 | 2 | ▶ | $uri->query_param(size => $opts->{size} // 20); | ||||||||||
|
Condition100%2/2
$opts->{"size"} // 20
MC/DC100%1/1
$opts->{"size"} // 20
$opts->{"size"}
Truth table100%2/2
A
A= $opts->{"size"}
| |||||||||||||
| 124 | 2 | ▶ | $uri->query_param(includesExternalPublicGroups => $opts->{includesExternalPublicGroups} // ''); | ||||||||||
|
Condition100%2/2
$opts->{"includesExternalPublicGroups"} // ""
MC/DC100%1/1
$opts->{"includesExternalPublicGroups"} // ""
$opts->{"includesExternalPublicGroups"}
Truth table100%2/2
A
A= $opts->{"includesExternalPublicGroups"}
| |||||||||||||
| 125 | 2 | ▶ | $uri->query_param(createRoute => $opts->{createRoute} // ''); | ||||||||||
|
Condition100%2/2
$opts->{"createRoute"} // ""
MC/DC100%1/1
$opts->{"createRoute"} // ""
$opts->{"createRoute"}
Truth table100%2/2
A
A= $opts->{"createRoute"}
| |||||||||||||
| 126 | |||||||||||||
| 127 | 2 | my $res = $self->request(get => $uri->as_string); | |||||||||||
| 128 | 2 | LINE::Bot::API::Response::AudienceMultipleData->new(%{ $res }); | |||||||||||
| 129 | } | ||||||||||||
| 130 | |||||||||||||
| 131 | 9 | 1; | |||||||||||
| 132 | __END__ | ||||||||||||