Branch Coverage

lib/WebService/Intercom.pm
Criterion Covered Total %
branch 0 552 0.0


line true false branch
113 0 0 @_ ? :
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'user_id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($user_id) ? :
0 0 if (exists $_{'user_id'})
0 0 exists $_{'email'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($email) ? :
0 0 if (exists $_{'email'})
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($id) ? :
0 0 if (exists $_{'id'})
115 0 0 unless (defined $user_id xor defined $email xor defined $id)
120 0 0 if (defined $id) { }
0 0 elsif (defined $user_id) { }
0 0 elsif (defined $email) { }
160 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC6($user) ? :
0 0 if ($#_ >= 0)
0 0 unless ($____nobble_checks)
185 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'user_id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($user_id) ? :
0 0 if (exists $_{'user_id'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'email'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($email) ? :
0 0 if (exists $_{'email'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($id) ? :
0 0 if (exists $_{'id'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'signed_up_at'} ? :
0 0 Type::Tiny::XS::AUTO::TC4($signed_up_at) ? :
0 0 if (exists $_{'signed_up_at'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'name'} ? :
0 0 Type::Tiny::XS::Str($name) ? :
0 0 if (exists $_{'name'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'last_seen_ip'} ? :
0 0 if not ref $last_seen_ip
0 0 unless (not defined $last_seen_ip)
0 0 do { unless (not defined $last_seen_ip) { $last_seen_ip =~ /$Types::Standard::_StrMatch{'(?^u:^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$)'}/u if not ref $last_seen_ip; } } ? :
0 0 if (exists $_{'last_seen_ip'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'custom_attributes'} ? :
0 0 unless Type::Tiny::XS::AUTO::TC2($v)
0 0 if not ref $k
0 0 unless do { $k =~ /$Types::Standard::_StrMatch{'(?^u:^[^[.\\$]+$)'}/u if not ref $k }
0 0 if (ref $custom_attributes eq 'HASH')
0 0 do { if (ref $custom_attributes eq 'HASH') { my $ok = 1; foreach my $v (values %{$custom_attributes;}) { $ok = 0, last unless Type::Tiny::XS::AUTO::TC2($v); } ; foreach my $k (keys %{$custom_attributes;}) { $ok = 0, last unless do { $k =~ /$Types::Standard::_StrMatch{'(?^u:^[^[.\\$]+$)'}/u if not ref $k }; } ; $ok; } } ? :
0 0 if (exists $_{'custom_attributes'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'last_seen_user_agent'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($last_seen_user_agent) ? :
0 0 if (exists $_{'last_seen_user_agent'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'companies'} ? :
0 0 ref $companies eq 'HASH' ? :
0 0 if (exists $_{'companies'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'last_request_at'} ? :
0 0 Type::Tiny::XS::AUTO::TC4($last_request_at) ? :
0 0 if (exists $_{'last_request_at'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'unsubscribed_from_emails'} ? :
0 0 Type::Tiny::XS::AUTO::TC7($unsubscribed_from_emails) ? :
0 0 if (exists $_{'unsubscribed_from_emails'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'update_last_request_at'} ? :
0 0 Type::Tiny::XS::AUTO::TC7($update_last_request_at) ? :
0 0 if (exists $_{'update_last_request_at'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'new_session'} ? :
0 0 Type::Tiny::XS::AUTO::TC7($new_session) ? :
0 0 if (exists $_{'new_session'})
0 0 unless ($____nobble_checks)
201 0 0 if (defined $user_id)
204 0 0 if (defined $email)
207 0 0 if (defined $id)
241 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC6($user) ? :
0 0 if ($#_ >= 0)
0 0 unless ($____nobble_checks)
249 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'user_id'} ? :
0 0 Type::Tiny::XS::Str($user_id) ? :
0 0 if (exists $_{'user_id'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::Str($id) ? :
0 0 if (exists $_{'id'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'email'} ? :
0 0 Type::Tiny::XS::Str($email) ? :
0 0 if (exists $_{'email'})
0 0 unless ($____nobble_checks)
251 0 0 if (defined $id) { }
0 0 elsif (defined $user_id) { }
0 0 elsif (defined $email) { }
278 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC3($tag) ? :
0 0 if ($#_ >= 0)
0 0 unless ($____nobble_checks)
284 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'name'} ? :
0 0 Type::Tiny::XS::Str($name) ? :
0 0 if (exists $_{'name'})
0 0 unless ($____nobble_checks)
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($id) ? :
0 0 if (exists $_{'id'})
0 0 unless ($____nobble_checks)
288 0 0 if (defined $id)
315 0 0 @_ ? :
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'name'} ? :
0 0 Type::Tiny::XS::Str($name) ? :
0 0 if (exists $_{'name'})
0 0 exists $_{'users'} ? :
0 0 if ref $i eq 'HASH' and not grep((!/\A(?:email|id|untag|user_id)\z/u), keys %{$i;}) and !exists($$i{'email'}) || do { do { Type::Tiny::XS::Str($$i{'email'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } } and !exists($$i{'untag'}) || do { do { Type::Tiny::XS::Bool($$i{'untag'}) } }
0 0 unless do { not exists $$i{'user_id'} or do { do { Type::Tiny::XS::Str($$i{'user_id'}) } } if ref $i eq 'HASH' and not grep((!/\A(?:email|id|untag|user_id)\z/u), keys %{$i;}) and !exists($$i{'email'}) || do { do { Type::Tiny::XS::Str($$i{'email'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } } and !exists($$i{'untag'}) || do { do { Type::Tiny::XS::Bool($$i{'untag'}) } } }
0 0 if (ref $users eq 'ARRAY')
0 0 do { if (ref $users eq 'ARRAY') { my $ok = 1; foreach my $i (@{$users;}) { $ok = 0, last unless do { not exists $$i{'user_id'} or do { do { Type::Tiny::XS::Str($$i{'user_id'}) } } if ref $i eq 'HASH' and not grep((!/\A(?:email|id|untag|user_id)\z/u), keys %{$i;}) and !exists($$i{'email'}) || do { do { Type::Tiny::XS::Str($$i{'email'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } } and !exists($$i{'untag'}) || do { do { Type::Tiny::XS::Bool($$i{'untag'}) } } }; } ; $ok; } } ? :
0 0 if (exists $_{'users'})
0 0 exists $_{'companies'} ? :
0 0 if ref $i eq 'HASH' and not grep((!/\A(?:company_id|id|untag)\z/u), keys %{$i;}) and !exists($$i{'company_id'}) || do { do { Type::Tiny::XS::Str($$i{'company_id'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } }
0 0 unless do { not exists $$i{'untag'} or do { do { Type::Tiny::XS::Bool($$i{'untag'}) } } if ref $i eq 'HASH' and not grep((!/\A(?:company_id|id|untag)\z/u), keys %{$i;}) and !exists($$i{'company_id'}) || do { do { Type::Tiny::XS::Str($$i{'company_id'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } } }
0 0 if (ref $companies eq 'ARRAY')
0 0 do { if (ref $companies eq 'ARRAY') { my $ok = 1; foreach my $i (@{$companies;}) { $ok = 0, last unless do { not exists $$i{'untag'} or do { do { Type::Tiny::XS::Bool($$i{'untag'}) } } if ref $i eq 'HASH' and not grep((!/\A(?:company_id|id|untag)\z/u), keys %{$i;}) and !exists($$i{'company_id'}) || do { do { Type::Tiny::XS::Str($$i{'company_id'}) } } and !exists($$i{'id'}) || do { do { Type::Tiny::XS::Str($$i{'id'}) } } }; } ; $ok; } } ? :
0 0 if (exists $_{'companies'})
321 0 0 unless (defined $users xor defined $companies)
325 0 0 if (defined $users) { }
0 0 elsif (defined $companies) { }
357 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::Str($id) ? :
0 0 if (exists $_{'id'})
0 0 unless ($____nobble_checks)
361 0 0 ref $_[0] eq 'Kavorka::Signature::NOBBLE' ? :
0 0 @_ ? :
0 0 unless ($____nobble_checks)
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC3($tag) ? :
0 0 if ($#_ >= 0)
0 0 unless ($____nobble_checks)
387 0 0 @_ ? :
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'user_id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($user_id) ? :
0 0 if (exists $_{'user_id'})
0 0 exists $_{'email'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($email) ? :
0 0 if (exists $_{'email'})
0 0 exists $_{'id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($id) ? :
0 0 if (exists $_{'id'})
0 0 exists $_{'admin_id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($admin_id) ? :
0 0 if (exists $_{'admin_id'})
0 0 exists $_{'body'} ? :
0 0 Type::Tiny::XS::Str($body) ? :
0 0 if (exists $_{'body'})
388 0 0 unless (defined $user_id xor defined $email xor defined $id)
396 0 0 if (defined $user_id) { }
0 0 elsif (defined $email) { }
0 0 elsif (defined $id) { }
432 0 0 @_ ? :
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'user_id'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($user_id) ? :
0 0 if (exists $_{'user_id'})
0 0 exists $_{'email'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($email) ? :
0 0 if (exists $_{'email'})
0 0 exists $_{'event_name'} ? :
0 0 if not ref $event_name
0 0 do { $event_name =~ /$Types::Standard::_StrMatch{'(?^u:^[^[.\\$]+$)'}/u if not ref $event_name } ? :
0 0 if (exists $_{'event_name'})
0 0 exists $_{'created_at'} ? :
0 0 Type::Tiny::XS::AUTO::TC4($created_at) ? :
0 0 if (exists $_{'created_at'})
0 0 exists $_{'metadata'} ? :
0 0 if ref $v eq 'HASH' and not grep((!/\A(?:url|value)\z/u), keys %{$v;}) and exists $$v{'url'} and do { Type::Tiny::XS::Str($$v{'url'}) }
0 0 if defined $$v{'amount'}
0 0 if (ref $v eq 'HASH' and not grep((!/\A(?:amount|currency)\z/u), keys %{$v;}) and exists $$v{'amount'} and do { $$v{'amount'} =~ /\A-?[0-9]+\z/u if defined $$v{'amount'} } and exists $$v{'currency'})
0 0 unless defined $v and not ref $v or do { not exists $$v{'value'} or do { do { Type::Tiny::XS::Str($$v{'value'}) } } if ref $v eq 'HASH' and not grep((!/\A(?:url|value)\z/u), keys %{$v;}) and exists $$v{'url'} and do { Type::Tiny::XS::Str($$v{'url'}) } } or do { if (ref $v eq 'HASH' and not grep((!/\A(?:amount|currency)\z/u), keys %{$v;}) and exists $$v{'amount'} and do { $$v{'amount'} =~ /\A-?[0-9]+\z/u if defined $$v{'amount'} } and exists $$v{'currency'}) { Type::Tiny::XS::Str($$v{'currency'}); } }
0 0 unless Type::Tiny::XS::Str($k)
0 0 if (ref $metadata eq 'HASH')
0 0 unless (not defined $metadata)
0 0 do { unless (not defined $metadata) { if (ref $metadata eq 'HASH') { my $ok = 1; foreach my $v (values %{$metadata;}) { $ok = 0, last unless defined $v and not ref $v or do { not exists $$v{'value'} or do { do { Type::Tiny::XS::Str($$v{'value'}) } } if ref $v eq 'HASH' and not grep((!/\A(?:url|value)\z/u), keys %{$v;}) and exists $$v{'url'} and do { Type::Tiny::XS::Str($$v{'url'}) } } or do { if (ref $v eq 'HASH' and not grep((!/\A(?:amount|currency)\z/u), keys %{$v;}) and exists $$v{'amount'} and do { $$v{'amount'} =~ /\A-?[0-9]+\z/u if defined $$v{'amount'} } and exists $$v{'currency'}) { Type::Tiny::XS::Str($$v{'currency'}); } }; } ; foreach my $k (keys %{$metadata;}) { $ok = 0, last unless Type::Tiny::XS::Str($k); } ; $ok; } ; } } ? :
0 0 unless do { local $_ = $metadata; $Kavorka::Parameter::PARAMS[66]{'constraints'}[0]() }
0 0 if (exists $_{'metadata'})
434 0 0 unless (defined $user_id or defined $email)
443 0 0 if (defined $user_id) { }
0 0 elsif (defined $email) { }
449 0 0 if (defined $metadata)
484 0 0 @_ ? :
0 0 $#_ == 0 && ref $_[0] eq 'HASH' ? :
0 0 exists $_{'from'} ? :
0 0 if not ref $$from{'type'}
0 0 if ref $from eq 'HASH' and not grep((!/\A(?:email|id|type|user_id)\z/u), keys %{$from;}) and !exists($$from{'email'}) || do { do { Type::Tiny::XS::Str($$from{'email'}) } } and !exists($$from{'id'}) || do { do { Type::Tiny::XS::Str($$from{'id'}) } } and exists $$from{'type'} and do { $$from{'type'} =~ /$Types::Standard::_StrMatch{'(?^u:^(admin|user)$)'}/u if not ref $$from{'type'} }
0 0 do { not exists $$from{'user_id'} or do { do { Type::Tiny::XS::Str($$from{'user_id'}) } } if ref $from eq 'HASH' and not grep((!/\A(?:email|id|type|user_id)\z/u), keys %{$from;}) and !exists($$from{'email'}) || do { do { Type::Tiny::XS::Str($$from{'email'}) } } and !exists($$from{'id'}) || do { do { Type::Tiny::XS::Str($$from{'id'}) } } and exists $$from{'type'} and do { $$from{'type'} =~ /$Types::Standard::_StrMatch{'(?^u:^(admin|user)$)'}/u if not ref $$from{'type'} } } ? :
0 0 if (exists $_{'from'})
0 0 exists $_{'to'} ? :
0 0 if not ref $$to{'type'}
0 0 if ref $to eq 'HASH' and not grep((!/\A(?:email|id|type|user_id)\z/u), keys %{$to;}) and !exists($$to{'email'}) || do { do { Type::Tiny::XS::Str($$to{'email'}) } } and !exists($$to{'id'}) || do { do { Type::Tiny::XS::Str($$to{'id'}) } } and exists $$to{'type'} and do { $$to{'type'} =~ /$Types::Standard::_StrMatch{'(?^u:^(admin|user)$)'}/u if not ref $$to{'type'} }
0 0 unless (not defined $to)
0 0 do { unless (not defined $to) { not exists $$to{'user_id'} or do { do { Type::Tiny::XS::Str($$to{'user_id'}) } } if ref $to eq 'HASH' and not grep((!/\A(?:email|id|type|user_id)\z/u), keys %{$to;}) and !exists($$to{'email'}) || do { do { Type::Tiny::XS::Str($$to{'email'}) } } and !exists($$to{'id'}) || do { do { Type::Tiny::XS::Str($$to{'id'}) } } and exists $$to{'type'} and do { $$to{'type'} =~ /$Types::Standard::_StrMatch{'(?^u:^(admin|user)$)'}/u if not ref $$to{'type'} }; } } ? :
0 0 if (exists $_{'to'})
0 0 exists $_{'body'} ? :
0 0 Type::Tiny::XS::Str($body) ? :
0 0 if (exists $_{'body'})
0 0 exists $_{'subject'} ? :
0 0 Type::Tiny::XS::AUTO::TC1($subject) ? :
0 0 if (exists $_{'subject'})
0 0 exists $_{'template'} ? :
0 0 if not ref $template
0 0 unless (not defined $template)
0 0 do { unless (not defined $template) { $template =~ /$Types::Standard::_StrMatch{'(?^:^(plain|personal)$)'}/u if not ref $template; } } ? :
0 0 if (exists $_{'template'})
0 0 exists $_{'message_type'} ? :
0 0 if not ref $message_type
0 0 do { $message_type =~ /$Types::Standard::_StrMatch{'(?^:^(inapp|email)$)'}/u if not ref $message_type } ? :
0 0 if (exists $_{'message_type'})
486 0 0 if (defined $message_type and $message_type eq 'email')
487 0 0 unless defined $subject
490 0 0 defined $to ? :
0 0 defined $subject ? :
0 0 defined $template ? :
0 0 defined $message_type ? :
508 0 0 @_ ? :
0 0 if @_ != 0
517 0 0 @_ ? :
0 0 if @_ < 1
0 0 $#_ >= 0 ? :
0 0 Type::Tiny::XS::AUTO::TC8($request) ? :
0 0 if ($#_ >= 0)
0 0 $#_ == 1 && ref $_[1] eq 'HASH' ? :
0 0 exists $_{'no_content'} ? :
0 0 Type::Tiny::XS::Bool($no_content) ? :
0 0 if (exists $_{'no_content'})
523 0 0 if ($response->is_success) { }
524 0 0 unless ($no_content)
529 0 0 if ($@)
533 0 0 if ($$data{'type'} =~ /^(user|tag|note|user_message|admin_message)$/u) { }
0 0 elsif ($$data{'type'} eq 'admin.list') { }
0 0 elsif ($$data{'type'} eq 'error.list') { }
557 0 0 if ($response->header('Content-Type') =~ /json/u)
562 0 0 if ($@)