| 1 | package LINE::Bot::API::Event::Base; | ||||||||||
| 2 | 53 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 53 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 53 | ▶ | use Carp 'croak'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 20 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 8 | 20 | my($class, %args) = @_; | |||||||||
| 9 | 20 | bless { %args }, $class; | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | # Accessors for Event-level properties. https://developers.line.biz/en/reference/messaging-api/#common-properties | ||||||||||
| 13 | 1 | ▶ | sub type { $_[0]->{type} } | ||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 14 | 19 | ▶ | sub mode { $_[0]->{mode} } | ||||||||
|
Subroutine
mode: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 2 | ▶ | sub timestamp { $_[0]->{timestamp} } | ||||||||
|
Subroutine
timestamp: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 20 | ▶ | sub webhook_event_id { $_[0]->{webhookEventId} } | ||||||||
|
Subroutine
webhook_event_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 17 | |||||||||||
| 18 | # Whether the webhook event is a redelivered one or not. | ||||||||||
| 19 | # https://developers.line.biz/en/docs/messaging-api/receiving-messages/#redelivered-webhooks | ||||||||||
| 20 | 20 | ▶ | sub is_redelivery { $_[0]->{deliveryContext}{isRedelivery} } | ||||||||
|
Subroutine
is_redelivery: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | # Unfollow and Leave events don't have this | ||||||||||
| 23 | 18 | ▶ | sub reply_token { $_[0]->{replyToken} } | ||||||||
|
Subroutine
reply_token: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | # type | ||||||||||
| 26 | 0 | ▶ | sub is_message_event { 0 } | ||||||||
|
Subroutine
is_message_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 27 | 0 | ▶ | sub is_follow_event { 0 } | ||||||||
|
Subroutine
is_follow_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | 0 | ▶ | sub is_unfollow_event { 0 } | ||||||||
|
Subroutine
is_unfollow_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | ▶ | sub is_join_event { 0 } | ||||||||
|
Subroutine
is_join_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 30 | 0 | ▶ | sub is_leave_event { 0 } | ||||||||
|
Subroutine
is_leave_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 31 | 0 | ▶ | sub is_member_join_event { 0 } | ||||||||
|
Subroutine
is_member_join_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | ▶ | sub is_member_leave_event { 0 } | ||||||||
|
Subroutine
is_member_leave_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 33 | 0 | ▶ | sub is_postback_event { 0 } | ||||||||
|
Subroutine
is_postback_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 34 | 0 | ▶ | sub is_beacon_detection_event { 0 } | ||||||||
|
Subroutine
is_beacon_detection_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 35 | 0 | ▶ | sub is_device_link_event { 0 } | ||||||||
|
Subroutine
is_device_link_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | ▶ | sub is_device_unlink_event { 0 } | ||||||||
|
Subroutine
is_device_unlink_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 37 | 0 | ▶ | sub is_account_link_event { 0 } | ||||||||
|
Subroutine
is_account_link_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 38 | 0 | ▶ | sub is_unsend_event { 0 } | ||||||||
|
Subroutine
is_unsend_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 39 | 0 | ▶ | sub is_video_viewing_complete_event { 0 } | ||||||||
|
Subroutine
is_video_viewing_complete_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 40 | 0 | ▶ | sub is_unknown_event { 0 } | ||||||||
|
Subroutine
is_unknown_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 41 | |||||||||||
| 42 | # source field | ||||||||||
| 43 | 1 | ▶ | sub is_user_event { $_[0]->{source}{type} eq 'user' } | ||||||||
|
Subroutine
is_user_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 44 | 4 | ▶ | sub is_group_event { $_[0]->{source}{type} eq 'group' } | ||||||||
|
Subroutine
is_group_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 45 | 4 | ▶ | sub is_room_event { $_[0]->{source}{type} eq 'room' } | ||||||||
|
Subroutine
is_room_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 46 | |||||||||||
| 47 | 3 | ▶ | sub user_id { $_[0]->{source}{userId} } | ||||||||
|
Subroutine
user_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 48 | |||||||||||
| 49 | 2 | ▶ | sub group_id { | ||||||||
|
Subroutine
group_id: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 50 | 2 | my $self = shift; | |||||||||
| 51 | 2 | ▶ | croak 'This event source is not a group type.' unless $self->is_group_event; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 2 | $self->{source}{groupId}; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 2 | ▶ | sub room_id { | ||||||||
|
Subroutine
room_id: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 56 | 2 | my $self = shift; | |||||||||
| 57 | 2 | ▶ | croak 'This event source is not a room type.' unless $self->is_room_event; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | 2 | $self->{source}{roomId}; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 53 | 1; | |||||||||