| 1 | package LINE::Bot::API; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 46 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 46 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 46 | our $VERSION = '1.19'; | |||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 46 | ▶ | use LINE::Bot::API::Builder::SendMessage; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 46 | ▶ | use LINE::Bot::API::Client; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 46 | ▶ | use LINE::Bot::API::Event; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 46 | ▶ | use LINE::Bot::API::Response::Common; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 46 | ▶ | use LINE::Bot::API::Response::Content; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 46 | ▶ | use LINE::Bot::API::Response::Count; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 46 | ▶ | use LINE::Bot::API::Response::FriendDemographics; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 46 | ▶ | use LINE::Bot::API::Response::NumberOfSentMessages; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 46 | ▶ | use LINE::Bot::API::Response::NumberOfMessageDeliveries; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 46 | ▶ | use LINE::Bot::API::Response::Profile; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 46 | ▶ | use LINE::Bot::API::Response::GroupMemberProfile; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 46 | ▶ | use LINE::Bot::API::Response::GroupSummary; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 46 | ▶ | use LINE::Bot::API::Response::RoomMemberProfile; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 46 | ▶ | use LINE::Bot::API::Response::IssueLinkToken; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 46 | ▶ | use LINE::Bot::API::Response::RichMenu; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 46 | ▶ | use LINE::Bot::API::Response::RichMenuList; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 46 | ▶ | use LINE::Bot::API::Response::TargetLimit; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 46 | ▶ | use LINE::Bot::API::Response::TotalUsage; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 46 | ▶ | use LINE::Bot::API::Response::Token; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 46 | ▶ | use LINE::Bot::API::Response::NumberOfFollowers; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 46 | ▶ | use LINE::Bot::API::Response::UserInteractionStatistics; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | use constant { | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 46 | DEFAULT_MESSAGING_API_ENDPOINT => 'https://api.line.me/v2/bot/', | |||||||||||||||||||||||||||||||||||||||||
| 30 | DEFAULT_SOCIAL_API_ENDPOINT => 'https://api.line.me/v2/oauth/', | ||||||||||||||||||||||||||||||||||||||||||
| 31 | DEFAULT_CONTENT_API_ENDPOINT => 'https://api-data.line.me/v2/bot/', | ||||||||||||||||||||||||||||||||||||||||||
| 32 | DEFAULT_OAUTH2_API_ENDPOINT => 'https://api.line.me/oauth2/v2.1/', | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 46 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 46 | ▶ | use Furl; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 46 | ▶ | use Carp 'croak'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 46 | ▶ | use URI::Escape; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 34 | ▶ | my($class, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=18.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 34 | my $client = LINE::Bot::API::Client->new(%args); | |||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | bless { | ||||||||||||||||||||||||||||||||||||||||||
| 44 | client => $client, | ||||||||||||||||||||||||||||||||||||||||||
| 45 | channel_secret => $args{channel_secret}, | ||||||||||||||||||||||||||||||||||||||||||
| 46 | channel_access_token => $args{channel_access_token}, | ||||||||||||||||||||||||||||||||||||||||||
| 47 | messaging_api_endpoint => $args{messaging_api_endpoint} // DEFAULT_MESSAGING_API_ENDPOINT, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | social_api_endpoint => $args{social_api_endpoint} // DEFAULT_SOCIAL_API_ENDPOINT, | ||||||||||||||||||||||||||||||||||||||||||
| 49 | content_api_endpoint => $args{content_api_endpoint} // DEFAULT_CONTENT_API_ENDPOINT, | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 34 | ▶ | oauth_api_endpoint => $args{oauth_api_endpoint} // DEFAULT_OAUTH2_API_ENDPOINT, | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%4/8
$args{"messaging_api_endpoint"} // "https://api.line.me/v2/bot/"
$args{"social_api_endpoint"} // "https://api.line.me/v2/oauth/"
$args{"content_api_endpoint"} // "https://api-data.line.me/v2/bot/"
$args{"oauth_api_endpoint"} // "https://api.line.me/oauth2/v2.1/"
MC/DC0%0/1
$args{"messaging_api_endpoint"} // "https://api.line.me/v2/bot/"
$args{"messaging_api_endpoint"}
MC/DC0%0/1
$args{"social_api_endpoint"} // "https://api.line.me/v2/oauth/"
$args{"social_api_endpoint"}
MC/DC0%0/1
$args{"content_api_endpoint"} // "https://api-data.line.me/v2/bot/"
$args{"content_api_endpoint"}
MC/DC0%0/1
$args{"oauth_api_endpoint"} // "https://api.line.me/oauth2/v2.1/"
$args{"oauth_api_endpoint"}
Truth table50%1/2
A
A= $args{"messaging_api_endpoint"}
Truth table50%1/2
A
A= $args{"social_api_endpoint"}
Truth table50%1/2
A
A= $args{"content_api_endpoint"}
Truth table50%1/2
A
A= $args{"oauth_api_endpoint"}
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | sub request { | ||||||||||||||||||||||||||||||||||||||||||
| 55 | 68 | ▶ | my ($self, $method, $path, @payload) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | return $self->{client}->$method( | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 68 | $self->{messaging_api_endpoint} . $path, | |||||||||||||||||||||||||||||||||||||||||
| 59 | @payload, | ||||||||||||||||||||||||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | sub request_content { | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | my ($self, $method, $path, @payload) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
request_content: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | return $self->{client}->$method( | ||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | $self->{content_api_endpoint} . $path, | |||||||||||||||||||||||||||||||||||||||||
| 68 | @payload, | ||||||||||||||||||||||||||||||||||||||||||
| 69 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | sub reply_message { | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 11 | ▶ | my($self, $reply_token, $messages) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reply_message: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | 11 | my $res = $self->request( | |||||||||||||||||||||||||||||||||||||||||
| 76 | post => 'message/reply', | ||||||||||||||||||||||||||||||||||||||||||
| 77 | +{ | ||||||||||||||||||||||||||||||||||||||||||
| 78 | replyToken => $reply_token, | ||||||||||||||||||||||||||||||||||||||||||
| 79 | messages => $messages, | ||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 11 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | sub push_message { | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 25 | ▶ | my($self, $to_id, $messages, $options) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
push_message: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | 25 | my @headers = (); | |||||||||||||||||||||||||||||||||||||||||
| 90 | 25 | ▶ | if ($options && defined($options->{'retry_key'})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$options and defined $options->{"retry_key"}
MC/DC50%1/2
$options and defined $options->{"retry_key"}
$options
defined $options->{"retry_key"}
Truth table66%2/3
A and B
A= $optionsB= defined $options->{"retry_key"}
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 1 | push @headers, 'X-Line-Retry-Key' => $options->{'retry_key'}; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 25 | my $res = $self->request( | |||||||||||||||||||||||||||||||||||||||||
| 95 | post => 'message/push', | ||||||||||||||||||||||||||||||||||||||||||
| 96 | \@headers, | ||||||||||||||||||||||||||||||||||||||||||
| 97 | +{ | ||||||||||||||||||||||||||||||||||||||||||
| 98 | to => $to_id, | ||||||||||||||||||||||||||||||||||||||||||
| 99 | messages => $messages, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 102 | 25 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | sub multicast { | ||||||||||||||||||||||||||||||||||||||||||
| 106 | 1 | ▶ | my($self, $to_ids, $messages, $options) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
multicast: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | my @headers = (); | |||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | ▶ | if ($options && defined($options->{'retry_key'})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$options and defined $options->{"retry_key"}
MC/DC0%0/2
$options and defined $options->{"retry_key"}
$options
defined $options->{"retry_key"}
Truth table33%1/3
A and B
A= $optionsB= defined $options->{"retry_key"}
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | push @headers, 'X-Line-Retry-Key' => $options->{'retry_key'}; | |||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | my $res = $self->request( | |||||||||||||||||||||||||||||||||||||||||
| 114 | post => 'message/multicast', | ||||||||||||||||||||||||||||||||||||||||||
| 115 | \@headers, | ||||||||||||||||||||||||||||||||||||||||||
| 116 | +{ | ||||||||||||||||||||||||||||||||||||||||||
| 117 | to => $to_ids, | ||||||||||||||||||||||||||||||||||||||||||
| 118 | messages => $messages, | ||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||
| 120 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 1 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | sub broadcast { | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 2 | ▶ | my($self, $messages, $options) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
broadcast: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 2 | my @headers = (); | |||||||||||||||||||||||||||||||||||||||||
| 128 | 2 | ▶ | if (defined($options->{'retry_key'})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 1 | push @headers, 'X-Line-Retry-Key' => $options->{'retry_key'}; | |||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 2 | my $res = $self->request( | |||||||||||||||||||||||||||||||||||||||||
| 133 | post => 'message/broadcast', | ||||||||||||||||||||||||||||||||||||||||||
| 134 | \@headers, | ||||||||||||||||||||||||||||||||||||||||||
| 135 | +{ | ||||||||||||||||||||||||||||||||||||||||||
| 136 | messages => $messages, | ||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 2 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | sub get_message_content { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | my($self, $message_id, %options) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_message_content: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $res = $self->request_content( | |||||||||||||||||||||||||||||||||||||||||
| 145 | 'contents_download' => "message/$message_id/content", | ||||||||||||||||||||||||||||||||||||||||||
| 146 | %options | ||||||||||||||||||||||||||||||||||||||||||
| 147 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | LINE::Bot::API::Response::Content->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | sub get_profile { | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 1 | ▶ | my($self, $user_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_profile: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 1 | my $res = $self->request(get => "profile/$user_id"); | |||||||||||||||||||||||||||||||||||||||||
| 154 | 1 | LINE::Bot::API::Response::Profile->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | sub get_group_member_profile { | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | ▶ | my($self, $group_id, $user_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_group_member_profile: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | my $res = $self->request(get => "group/$group_id/member/$user_id"); | |||||||||||||||||||||||||||||||||||||||||
| 160 | 1 | LINE::Bot::API::Response::GroupMemberProfile->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | sub get_room_member_profile { | ||||||||||||||||||||||||||||||||||||||||||
| 164 | 1 | ▶ | my($self, $room_id, $user_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_room_member_profile: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | my $res = $self->request(get => "room/$room_id/member/$user_id"); | |||||||||||||||||||||||||||||||||||||||||
| 166 | 1 | LINE::Bot::API::Response::RoomMemberProfile->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | sub leave_room { | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | my($self, $room_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
leave_room: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | my $res = $self->request(post => "room/$room_id/leave", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | sub leave_group { | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | my($self, $group_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
leave_group: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my $res = $self->request(post => "group/$group_id/leave", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||
| 181 | sub get_friend_demographics { | ||||||||||||||||||||||||||||||||||||||||||
| 182 | 1 | ▶ | my($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_friend_demographics: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | 1 | my $res = $self->request(get => "insight/demographic"); | |||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | LINE::Bot::API::Response::FriendDemographics->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | sub get_target_limit_for_additional_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 188 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_target_limit_for_additional_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | my $res = $self->request(get => "message/quota"); | |||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | LINE::Bot::API::Response::TargetLimit->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | sub get_number_of_messages_sent_this_month { | ||||||||||||||||||||||||||||||||||||||||||
| 194 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_messages_sent_this_month: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 195 | 1 | my $res = $self->request(get => "message/quota/consumption"); | |||||||||||||||||||||||||||||||||||||||||
| 196 | 1 | LINE::Bot::API::Response::TotalUsage->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | sub get_number_of_sent_reply_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 200 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_sent_reply_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 1 | my $res = $self->request(get => "message/delivery/reply?date=${date}"); | |||||||||||||||||||||||||||||||||||||||||
| 202 | 1 | LINE::Bot::API::Response::NumberOfSentMessages->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||
| 205 | sub get_number_of_sent_push_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_sent_push_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | my $res = $self->request(get => "message/delivery/push?date=${date}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 208 | 1 | LINE::Bot::API::Response::NumberOfSentMessages->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | sub get_number_of_sent_multicast_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_sent_multicast_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 1 | my $res = $self->request(get => "message/delivery/multicast?date=${date}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 214 | 1 | LINE::Bot::API::Response::NumberOfSentMessages->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | sub get_number_of_send_broadcast_messages { | ||||||||||||||||||||||||||||||||||||||||||
| 218 | 1 | ▶ | my($self, $date) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_send_broadcast_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | 1 | my $res = $self->request(get => "message/delivery/broadcast?date=${date}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 220 | 1 | LINE::Bot::API::Response::NumberOfSentMessages->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | sub get_number_of_message_deliveries { | ||||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | ▶ | my($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_message_deliveries: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | 1 | ▶ | my $date = $opts->{date} or croak "get_number_of_message_deliveries: Missing a `date` parameter."; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 1 | my $res = $self->request(get => "insight/message/delivery?date=${date}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 228 | 1 | LINE::Bot::API::Response::NumberOfMessageDeliveries->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | sub get_member_in_room_count { | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 1 | ▶ | my ($self, $room_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_member_in_room_count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | 1 | my $res = $self->request(get => "room/${room_id}/members/count", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 235 | 1 | LINE::Bot::API::Response::Count->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||
| 238 | sub get_member_in_group_count { | ||||||||||||||||||||||||||||||||||||||||||
| 239 | 1 | ▶ | my ($self, $group_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_member_in_group_count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | 1 | my $res = $self->request(get => "group/${group_id}/members/count", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 242 | 1 | LINE::Bot::API::Response::Count->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | sub get_group_summary { | ||||||||||||||||||||||||||||||||||||||||||
| 246 | 1 | ▶ | my ($self, $group_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_group_summary: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 1 | my $res = $self->request(get => "group/${group_id}/summary", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 249 | 1 | LINE::Bot::API::Response::GroupSummary->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||
| 252 | sub validate_signature { | ||||||||||||||||||||||||||||||||||||||||||
| 253 | 2 | ▶ | my($self, $json, $signature) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate_signature: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 2 | LINE::Bot::API::Event->validate_signature($json, $self->{channel_secret}, $signature); | |||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | sub parse_events_from_json { | ||||||||||||||||||||||||||||||||||||||||||
| 258 | 1 | ▶ | my($self, $json) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_events_from_json: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | LINE::Bot::API::Event->parse_events_json($json); | |||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||
| 262 | sub issue_link_token { | ||||||||||||||||||||||||||||||||||||||||||
| 263 | 1 | ▶ | my($self, $user_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
issue_link_token: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 264 | 1 | my $res = $self->request(post => "user/${user_id}/linkToken", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 265 | 1 | LINE::Bot::API::Response::IssueLinkToken->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | sub create_rich_menu { | ||||||||||||||||||||||||||||||||||||||||||
| 269 | 1 | ▶ | my ($self, $rich_menu) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_rich_menu: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 270 | 1 | my $res = $self->request(post => "richmenu", $rich_menu); | |||||||||||||||||||||||||||||||||||||||||
| 271 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||
| 274 | sub get_rich_menu { | ||||||||||||||||||||||||||||||||||||||||||
| 275 | 1 | ▶ | my ($self, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_rich_menu: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 276 | 1 | my $res = $self->request(get => "richmenu/${rich_menu_id}"); | |||||||||||||||||||||||||||||||||||||||||
| 277 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||
| 280 | sub delete_rich_menu { | ||||||||||||||||||||||||||||||||||||||||||
| 281 | 1 | ▶ | my ($self, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete_rich_menu: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 282 | 1 | my $res = $self->request(delete => "richmenu/${rich_menu_id}"); | |||||||||||||||||||||||||||||||||||||||||
| 283 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||
| 286 | sub get_rich_menu_list { | ||||||||||||||||||||||||||||||||||||||||||
| 287 | 1 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_rich_menu_list: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 1 | my $res = $self->request(get => "richmenu/list"); | |||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | LINE::Bot::API::Response::RichMenuList->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||
| 292 | sub set_default_rich_menu { | ||||||||||||||||||||||||||||||||||||||||||
| 293 | 1 | ▶ | my ($self, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_default_rich_menu: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 294 | 1 | my $res = $self->request(post => "user/all/richmenu/${rich_menu_id}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 295 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | sub get_default_rich_menu_id { | ||||||||||||||||||||||||||||||||||||||||||
| 299 | 1 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_default_rich_menu_id: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 300 | 1 | my $res = $self->request(get => "user/all/richmenu"); | |||||||||||||||||||||||||||||||||||||||||
| 301 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||
| 304 | sub cancel_default_rich_menu { | ||||||||||||||||||||||||||||||||||||||||||
| 305 | 1 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cancel_default_rich_menu: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 1 | my $res = $self->request(delete => "user/all/richmenu"); | |||||||||||||||||||||||||||||||||||||||||
| 307 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||
| 310 | sub link_rich_menu_to_user { | ||||||||||||||||||||||||||||||||||||||||||
| 311 | 1 | ▶ | my ($self, $user_id, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
link_rich_menu_to_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 312 | 1 | my $res = $self->request(post => "user/${user_id}/richmenu/${rich_menu_id}", +{}); | |||||||||||||||||||||||||||||||||||||||||
| 313 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||
| 316 | sub link_rich_menu_to_multiple_users { | ||||||||||||||||||||||||||||||||||||||||||
| 317 | 1 | ▶ | my ($self, $user_ids, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
link_rich_menu_to_multiple_users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | 1 | my $res = $self->request(post => "richmenu/bulk/link", +{ | |||||||||||||||||||||||||||||||||||||||||
| 319 | richMenuId => $rich_menu_id, | ||||||||||||||||||||||||||||||||||||||||||
| 320 | userIds => $user_ids, | ||||||||||||||||||||||||||||||||||||||||||
| 321 | }); | ||||||||||||||||||||||||||||||||||||||||||
| 322 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | sub get_rich_menu_id_of_user { | ||||||||||||||||||||||||||||||||||||||||||
| 326 | 1 | ▶ | my ($self, $user_id, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_rich_menu_id_of_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 1 | my $res = $self->request(get => "user/${user_id}/richmenu"); | |||||||||||||||||||||||||||||||||||||||||
| 328 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||
| 331 | sub unlink_rich_menu_from_user { | ||||||||||||||||||||||||||||||||||||||||||
| 332 | 1 | ▶ | my ($self, $user_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unlink_rich_menu_from_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 333 | 1 | my $res = $self->request(delete => "user/${user_id}/richmenu"); | |||||||||||||||||||||||||||||||||||||||||
| 334 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||
| 337 | sub unlink_rich_menu_from_multiple_users { | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 1 | ▶ | my ($self, $user_ids) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unlink_rich_menu_from_multiple_users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | 1 | my $res = $self->request(post => "richmenu/bulk/unlink", +{ | |||||||||||||||||||||||||||||||||||||||||
| 340 | userIds => $user_ids, | ||||||||||||||||||||||||||||||||||||||||||
| 341 | }); | ||||||||||||||||||||||||||||||||||||||||||
| 342 | 1 | LINE::Bot::API::Response::RichMenu->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | sub upload_rich_menu_image { | ||||||||||||||||||||||||||||||||||||||||||
| 346 | 1 | ▶ | my ($self, $rich_menu_id, $content_type, $file_path) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
upload_rich_menu_image: called CC=3 SCAR=12.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||
| 348 | 1 | ▶ | if (!$content_type) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | croak 'Need content_type'; | |||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||
| 352 | my $res = $self->{client}->post_image( | ||||||||||||||||||||||||||||||||||||||||||
| 353 | 1 | $self->{content_api_endpoint} . "richmenu/$rich_menu_id/content", | |||||||||||||||||||||||||||||||||||||||||
| 354 | [ | ||||||||||||||||||||||||||||||||||||||||||
| 355 | 'Content-Type' => $content_type, | ||||||||||||||||||||||||||||||||||||||||||
| 356 | ], | ||||||||||||||||||||||||||||||||||||||||||
| 357 | $file_path | ||||||||||||||||||||||||||||||||||||||||||
| 358 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||||||
| 360 | 1 | ▶ | if ($res->{http_status} eq '200') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 361 | 1 | return LINE::Bot::API::Response::Token->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 362 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | return LINE::Bot::API::Response::Error->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||
| 368 | sub download_rich_menu_image { | ||||||||||||||||||||||||||||||||||||||||||
| 369 | 1 | ▶ | my ($self, $rich_menu_id) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
download_rich_menu_image: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | return $self->{client}->get_content( | ||||||||||||||||||||||||||||||||||||||||||
| 372 | 1 | $self->{content_api_endpoint} . "richmenu/$rich_menu_id/content" | |||||||||||||||||||||||||||||||||||||||||
| 373 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||
| 376 | sub issue_channel_access_token { | ||||||||||||||||||||||||||||||||||||||||||
| 377 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
issue_channel_access_token: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||
| 379 | my $res = $self->{client}->post_form( | ||||||||||||||||||||||||||||||||||||||||||
| 380 | $self->{social_api_endpoint} . 'accessToken', | ||||||||||||||||||||||||||||||||||||||||||
| 381 | [ | ||||||||||||||||||||||||||||||||||||||||||
| 382 | grant_type => 'client_credentials', | ||||||||||||||||||||||||||||||||||||||||||
| 383 | client_id => $opts->{client_id}, | ||||||||||||||||||||||||||||||||||||||||||
| 384 | client_secret => $opts->{client_secret}, | ||||||||||||||||||||||||||||||||||||||||||
| 385 | 1 | ] | |||||||||||||||||||||||||||||||||||||||||
| 386 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||
| 388 | 1 | ▶ | if ($res->{http_status} eq '200') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 389 | 1 | return LINE::Bot::API::Response::Token->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 390 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | return LINE::Bot::API::Response::Error->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||||||||||||
| 395 | sub issue_channel_access_token_v2_1 { | ||||||||||||||||||||||||||||||||||||||||||
| 396 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
issue_channel_access_token_v2_1: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||
| 398 | my $res = $self->{client}->post_form( | ||||||||||||||||||||||||||||||||||||||||||
| 399 | $self->{oauth_api_endpoint} . 'token', | ||||||||||||||||||||||||||||||||||||||||||
| 400 | undef, | ||||||||||||||||||||||||||||||||||||||||||
| 401 | [ | ||||||||||||||||||||||||||||||||||||||||||
| 402 | grant_type => 'client_credentials', | ||||||||||||||||||||||||||||||||||||||||||
| 403 | client_assertion_type => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', | ||||||||||||||||||||||||||||||||||||||||||
| 404 | client_assertion => $opts->{jwt}, | ||||||||||||||||||||||||||||||||||||||||||
| 405 | 1 | ] | |||||||||||||||||||||||||||||||||||||||||
| 406 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||
| 408 | 1 | ▶ | if ($res->{http_status} eq '200') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 409 | 1 | return LINE::Bot::API::Response::Token->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 410 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | return LINE::Bot::API::Response::Error->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||
| 413 | } | ||||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||
| 415 | sub get_valid_channel_access_token_v2_1 { | ||||||||||||||||||||||||||||||||||||||||||
| 416 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_valid_channel_access_token_v2_1: called CC=2 SCAR=7.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||
| 418 | 1 | my $jwt = uri_escape($opts->{jwt}); | |||||||||||||||||||||||||||||||||||||||||
| 419 | 1 | my $assertion_type = uri_escape('urn:ietf:params:oauth:client-assertion-type:jwt-bearer'); | |||||||||||||||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||||||||||||||
| 421 | my $res = $self->{client}->get( | ||||||||||||||||||||||||||||||||||||||||||
| 422 | 1 | $self->{oauth_api_endpoint} . 'tokens/kid' . "?client_assertion_type=$assertion_type&client_assertion=$jwt", | |||||||||||||||||||||||||||||||||||||||||
| 423 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 424 | |||||||||||||||||||||||||||||||||||||||||||
| 425 | 1 | ▶ | if ($res->{http_status} eq '200') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 426 | 1 | return LINE::Bot::API::Response::Token->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 427 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | return LINE::Bot::API::Response::Error->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||
| 430 | } | ||||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||
| 432 | sub revoke_channel_access_token { | ||||||||||||||||||||||||||||||||||||||||||
| 433 | 2 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
revoke_channel_access_token: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||||||||||||||||
| 435 | my $res = $self->{client}->post_form( | ||||||||||||||||||||||||||||||||||||||||||
| 436 | $self->{social_api_endpoint} . 'revoke', | ||||||||||||||||||||||||||||||||||||||||||
| 437 | [ | ||||||||||||||||||||||||||||||||||||||||||
| 438 | access_token => $opts->{access_token}, | ||||||||||||||||||||||||||||||||||||||||||
| 439 | 2 | ] | |||||||||||||||||||||||||||||||||||||||||
| 440 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||||||||||
| 442 | 2 | ▶ | if ($res->{http_status} eq '200') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 443 | 1 | return LINE::Bot::API::Response::Common->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 444 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 445 | 1 | return LINE::Bot::API::Response::Error->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||||||||||||||
| 449 | sub get_number_of_followers { | ||||||||||||||||||||||||||||||||||||||||||
| 450 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_number_of_followers: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 451 | 1 | ▶ | my $date = $opts->{date} or croak "get_number_of_followers: Missing a `date` parameter."; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||||||||||||
| 453 | 1 | my $res = $self->request(get => "insight/followers?date=${date}"); | |||||||||||||||||||||||||||||||||||||||||
| 454 | 1 | LINE::Bot::API::Response::NumberOfFollowers->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 455 | } | ||||||||||||||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||||||||||||
| 457 | sub get_user_interaction_statistics { | ||||||||||||||||||||||||||||||||||||||||||
| 458 | 1 | ▶ | my ($self, $opts) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_user_interaction_statistics: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 459 | 1 | ▶ | my $requestId = $opts->{requestId} or croak "get_user_interaction_statistics: Missing a `requestId` parameter."; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||||||||||||||||
| 461 | 1 | my $res = $self->request(get => "insight/message/event?requestId=${requestId}"); | |||||||||||||||||||||||||||||||||||||||||
| 462 | 1 | LINE::Bot::API::Response::UserInteractionStatistics->new(%{ $res }); | |||||||||||||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||||||||||||||
| 465 | 46 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 466 | __END__ | ||||||||||||||||||||||||||||||||||||||||||