| 1 | package Net::Async::Webservice::UPS::Response::QV::Origin; | ||||||||||||||
| 2 | 1 | $Net::Async::Webservice::UPS::Response::QV::Origin::VERSION = '1.1.4'; | |||||||||||||
| 3 | { | ||||||||||||||
| 4 | 1 | $Net::Async::Webservice::UPS::Response::QV::Origin::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 "origin" 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_location => ( | |||||||||||||
| 50 | is => 'ro', | ||||||||||||||
| 51 | isa => Address, | ||||||||||||||
| 52 | ); | ||||||||||||||
| 53 | |||||||||||||||
| 54 | |||||||||||||||
| 55 | 1 | has bill_to_account_number => ( | |||||||||||||
| 56 | is => 'ro', | ||||||||||||||
| 57 | isa => Str, | ||||||||||||||
| 58 | ); | ||||||||||||||
| 59 | |||||||||||||||
| 60 | |||||||||||||||
| 61 | 1 | has bill_to_account_option => ( | |||||||||||||
| 62 | is => 'ro', | ||||||||||||||
| 63 | isa => Str, | ||||||||||||||
| 64 | ); | ||||||||||||||
| 65 | |||||||||||||||
| 66 | |||||||||||||||
| 67 | 1 | has scheduled_delivery_date_time => ( | |||||||||||||
| 68 | is => 'ro', | ||||||||||||||
| 69 | isa => DateTimeT, | ||||||||||||||
| 70 | ); | ||||||||||||||
| 71 | |||||||||||||||
| 72 | 4 | ▶ | sub BUILDARGS { | ||||||||||||
|
Subroutine
BUILDARGS: called CC=5 SCAR=18.7
Pod
undocumented
| |||||||||||||||
| 73 | 4 | my ($class,$hashref) = @_; | |||||||||||||
| 74 | 0 | ▶ | if (@_>2) { shift; $hashref={@_} }; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 75 | |||||||||||||||
| 76 | 4 | ▶ | if (any { /^[A-Z]/ } keys %$hashref) { | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
| |||||||||||||||
| 77 | 4 | state $date_parser = DateTime::Format::Strptime->new( | |||||||||||||
| 78 | pattern => '%Y%m%d%H%M%S', | ||||||||||||||
| 79 | ); | ||||||||||||||
| 80 | 4 | set_implied_argument($hashref); | |||||||||||||
| 81 | |||||||||||||||
| 82 | return { | ||||||||||||||
| 83 | in_if(tracking_number=>'TrackingNumber'), | ||||||||||||||
| 84 | in_if(shipper_number=>'ShipperNumber'), | ||||||||||||||
| 85 | in_object_array_if(shipment_reference => 'ShipmentReferenceNumber', 'Net::Async::Webservice::UPS::Response::QV::Reference'), | ||||||||||||||
| 86 | in_object_array_if(package_reference => 'PackageReferenceNumber', 'Net::Async::Webservice::UPS::Response::QV::Reference'), | ||||||||||||||
| 87 | ( $hashref->{Date} ? ( date_time => $date_parser->parse_datetime($hashref->{Date}.$hashref->{Time}) ) : () ), | ||||||||||||||
| 88 | in_object_if(activity_location => 'ActivityLocation', 'Net::Async::Webservice::UPS::Address'), | ||||||||||||||
| 89 | pair_if(bill_to_account_number => $hashref->{BillToAccount}{Number}), | ||||||||||||||
| 90 | pair_if(bill_to_account_option => $hashref->{BillToAccount}{Option}), | ||||||||||||||
| 91 | 4 | ▶ | ( $hashref->{ScheduledDeliveryDate} ? ( scheduled_delivery_date_time => $date_parser->parse_datetime($hashref->{ScheduledDeliveryDate}.$hashref->{ScheduledDeliveryTime}) ) : () ), | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 92 | }; | ||||||||||||||
| 93 | } | ||||||||||||||
| 94 | 0 | return $hashref; | |||||||||||||
| 95 | } | ||||||||||||||
| 96 | |||||||||||||||
| 97 | 1 | 1; | |||||||||||||
| 98 | |||||||||||||||
| 99 | __END__ | ||||||||||||||