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