UPS/Response/QV/Generic.pm

filter: Statementstmt 94.5% 52 / 55 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 1 totaltotal 90.4% 66 / 73 CC 4 SCAR 7.4
CC
4
Cov
90%
BUILDARGS
4.8
__ANON__
1.0
BEGIN
1.0
CRAP 2.1
« UPS/Shipper.pm ↑ Summary UPS/Response/QV/Delivery.pm »
1 package Net::Async::Webservice::UPS::Response::QV::Generic;
2 1 $Net::Async::Webservice::UPS::Response::QV::Generic::VERSION = '1.1.4';
3 {
4 1 $Net::Async::Webservice::UPS::Response::QV::Generic::DIST = 'Net-Async-Webservice-UPS';
5 }
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Types::Standard qw(Str ArrayRef HashRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Net::Async::Webservice::UPS::Types qw(:types);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Net::Async::Webservice::UPS::Response::Utils qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::DateTime DateTime => { -as => 'DateTimeT' };
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use DateTime::Format::Strptime;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use List::AllUtils 'any';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 # ABSTRACT: a Quantum View "generic" event
17  
18  
19 1 has package_reference => (
20 is => 'ro',
21 isa => ArrayRef[QVReference],
22 );
23  
24  
25 1 has shipment_reference => (
26 is => 'ro',
27 isa => ArrayRef[QVReference],
28 );
29  
30  
31 1 has shipper_number => (
32 is => 'ro',
33 isa => Str,
34 );
35  
36  
37 1 has tracking_number => (
38 is => 'ro',
39 isa => Str,
40 );
41  
42  
43 1 has date_time => (
44 is => 'ro',
45 isa => DateTimeT,
46 );
47  
48  
49 1 has activity_type => (
50 is => 'ro',
51 isa => Str,
52 );
53  
54  
55 1 has service => (
56 is => 'ro',
57 isa => HashRef,
58 );
59  
60  
61 1 has rescheduled_delivery_date => (
62 is => 'ro',
63 isa => DateTimeT,
64 );
65  
66  
67 1 has bill_to_account_number => (
68 is => 'ro',
69 isa => Str,
70 );
71  
72  
73 1 has bill_to_account_option => (
74 is => 'ro',
75 isa => Str,
76 );
77  
78  
79 1 has ship_to_location_id => (
80 is => 'ro',
81 isa => Str,
82 );
83  
84  
85 1 has ship_to_receiving_name => (
86 is => 'ro',
87 isa => Str,
88 );
89  
90  
91 1 has ship_to_bookmark => (
92 is => 'ro',
93 isa => Str,
94 );
95  
96  
97 1 has failure_email => (
98 is => 'ro',
99 isa => Str,
100 );
101  
102  
103 1 has failure_code => (
104 is => 'ro',
105 isa => Str,
106 );
107  
108 1 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=4 SCAR=15.8
Pod undocumented
109 1 my ($class,$hashref) = @_;
110 0 ▶ if (@_>2) { shift; $hashref={@_} };
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 2) 0 1 1
111  
112 1 ▶ if (any { /^[A-Z]/ } keys %$hashref) {
Subroutine __ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
BranchTrueFalseTotal
if (&any(sub { /^[A-Z]/; } , keys %$hashref)) 1 0 1
113 1 state $date_parser = DateTime::Format::Strptime->new(
114 pattern => '%Y%m%d',
115 );
116  
117 1 set_implied_argument($hashref);
118 return {
119 in_if(activity_type=>'ActivityType'),
120 in_if(tracking_number=>'TrackingNumber'),
121 in_if(shipper_number=>'ShipperNumber'),
122 in_object_array_if(shipment_reference => 'ShipmentReferenceNumber', 'Net::Async::Webservice::UPS::Response::QV::Reference'),
123 in_object_array_if(package_reference => 'PackageReferenceNumber', 'Net::Async::Webservice::UPS::Response::QV::Reference'),
124 in_if(service => 'Service'),
125 in_datetime_if(date_time => 'Activity'),
126 pair_if(bill_to_account_number => $hashref->{BillToAccount}{Number}),
127 pair_if(bill_to_account_option => $hashref->{BillToAccount}{Option}),
128 pair_if(ship_to_location_id => $hashref->{ShipTo}{LocationID}),
129 pair_if(ship_to_receiving_name => $hashref->{ShipTo}{ReceivingAddressName}),
130 pair_if(ship_to_bookmark => $hashref->{ShipTo}{Bookmark}),
131  
132 ( $hashref->{RescheduledDeliveryDate} ? ( rescheduled_delivery_date => $date_parser->parse_datetime($hashref->{RescheduledDeliveryDate}) ) : () ),
133  
134 pair_if(failure_email => $hashref->{FailureNotification}{FailedEmailAddress} ),
135 1 ▶ pair_if(failure_code => $hashref->{FailureNotification}{FailureNotificationCode}{Code} ),
Branch: 1 branch
BranchTrueFalseTotal
$hashref->{'RescheduledDeliveryDate'} ? : 0 1 1
136 }
137 }
138 0 return $hashref;
139 }
140  
141 1 1;
142  
143 __END__
« UPS/Shipper.pm ↑ Summary UPS/Response/QV/Delivery.pm »