| 1 | package Net::Async::Webservice::UPS::Response::PackageResult; | ||||||||||
| 2 | 1 | $Net::Async::Webservice::UPS::Response::PackageResult::VERSION = '1.1.4'; | |||||||||
| 3 | { | ||||||||||
| 4 | 1 | $Net::Async::Webservice::UPS::Response::PackageResult::DIST = 'Net-Async-Webservice-UPS'; | |||||||||
| 5 | } | ||||||||||
| 6 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Types::Standard qw(Str); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use Net::Async::Webservice::UPS::Types qw(:types); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Net::Async::Webservice::UPS::Response::Utils ':all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | # ABSTRACT: information about a package in a booked shipment | ||||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 1 | has tracking_number => ( | |||||||||
| 16 | is => 'ro', | ||||||||||
| 17 | isa => Str, | ||||||||||
| 18 | required => 1, | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | 1 | has currency => ( | |||||||||
| 23 | is => 'ro', | ||||||||||
| 24 | isa => Str, | ||||||||||
| 25 | required => 0, | ||||||||||
| 26 | ); | ||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | 1 | has service_option_charges => ( | |||||||||
| 30 | is => 'ro', | ||||||||||
| 31 | isa => Measure, | ||||||||||
| 32 | required => 0, | ||||||||||
| 33 | ); | ||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | 1 | has label => ( | |||||||||
| 37 | is => 'ro', | ||||||||||
| 38 | isa => Image, | ||||||||||
| 39 | required => 0, | ||||||||||
| 40 | ); | ||||||||||
| 41 | |||||||||||
| 42 | |||||||||||
| 43 | 1 | has signature => ( | |||||||||
| 44 | is => 'ro', | ||||||||||
| 45 | isa => Image, | ||||||||||
| 46 | required => 0, | ||||||||||
| 47 | ); | ||||||||||
| 48 | |||||||||||
| 49 | |||||||||||
| 50 | 1 | has html => ( | |||||||||
| 51 | is => 'ro', | ||||||||||
| 52 | isa => Str, | ||||||||||
| 53 | required => 0, | ||||||||||
| 54 | ); | ||||||||||
| 55 | |||||||||||
| 56 | |||||||||||
| 57 | 1 | has pdf417 => ( | |||||||||
| 58 | is => 'ro', | ||||||||||
| 59 | isa => Str, | ||||||||||
| 60 | required => 0, | ||||||||||
| 61 | ); | ||||||||||
| 62 | |||||||||||
| 63 | |||||||||||
| 64 | 1 | has receipt => ( | |||||||||
| 65 | is => 'ro', | ||||||||||
| 66 | isa => Image, | ||||||||||
| 67 | required => 0, | ||||||||||
| 68 | ); | ||||||||||
| 69 | |||||||||||
| 70 | |||||||||||
| 71 | 1 | has form_code => ( | |||||||||
| 72 | is => 'ro', | ||||||||||
| 73 | isa => Str, | ||||||||||
| 74 | required => 0, | ||||||||||
| 75 | ); | ||||||||||
| 76 | |||||||||||
| 77 | |||||||||||
| 78 | 1 | has form_image => ( | |||||||||
| 79 | is => 'ro', | ||||||||||
| 80 | isa => Image, | ||||||||||
| 81 | required => 0, | ||||||||||
| 82 | ); | ||||||||||
| 83 | |||||||||||
| 84 | |||||||||||
| 85 | 1 | has form_group_id => ( | |||||||||
| 86 | is => 'ro', | ||||||||||
| 87 | isa => Str, | ||||||||||
| 88 | required => 0, | ||||||||||
| 89 | ); | ||||||||||
| 90 | |||||||||||
| 91 | |||||||||||
| 92 | 1 | has cod_turn_in => ( | |||||||||
| 93 | is => 'ro', | ||||||||||
| 94 | isa => Image, | ||||||||||
| 95 | required => 0, | ||||||||||
| 96 | ); | ||||||||||
| 97 | |||||||||||
| 98 | |||||||||||
| 99 | 1 | has package => ( | |||||||||
| 100 | is => 'ro', | ||||||||||
| 101 | isa => Package, | ||||||||||
| 102 | required => 1, | ||||||||||
| 103 | ); | ||||||||||
| 104 | |||||||||||
| 105 | 4 | ▶ | sub BUILDARGS { | ||||||||
|
Subroutine
BUILDARGS: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||
| 106 | 4 | my ($class,@etc) = @_; | |||||||||
| 107 | 4 | my $ret = $class->next::method(@etc); | |||||||||
| 108 | |||||||||||
| 109 | 4 | ▶ | if ($ret->{TrackingNumber}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 110 | 4 | set_implied_argument($ret); | |||||||||
| 111 | return { | ||||||||||
| 112 | package => $ret->{package}, | ||||||||||
| 113 | tracking_number => $ret->{TrackingNumber}, | ||||||||||
| 114 | currency => $ret->{ServiceOptionsCharges}{CurrencyCode}, | ||||||||||
| 115 | service_option_charges => $ret->{ServiceOptionsCharges}{MonetaryValue}, | ||||||||||
| 116 | img_if( label => $ret->{LabelImage} ), | ||||||||||
| 117 | ( $ret->{LabelImage}{InternationalSignatureGraphicImage} ? | ||||||||||
| 118 | ( signature => Net::Async::Webservice::UPS::Response::Image->new({ | ||||||||||
| 119 | format => $ret->{LabelImage}{ImageFormat}{Code}, | ||||||||||
| 120 | base64_data => $ret->{LabelImage}{InternationalSignatureGraphicImage}, | ||||||||||
| 121 | }) ) : () ), | ||||||||||
| 122 | base64_if( html => $ret->{LabelImage}{HTMLImage} ), | ||||||||||
| 123 | base64_if( pdf417 => $ret->{LabelImage}{PDF417} ), | ||||||||||
| 124 | img_if( receipt => $ret->{Receipt}{Image} ), | ||||||||||
| 125 | img_if( form_image => $ret->{Form} ), | ||||||||||
| 126 | pair_if( form_code => $ret->{Form}{Code} ), | ||||||||||
| 127 | pair_if( form_group_id => $ret->{FormGroupId} ), | ||||||||||
| 128 | 4 | ▶ | img_if( cod_turn_in => $ret->{CODTurnInPage} ), | ||||||||
|
Branch: 1 branch
| |||||||||||
| 129 | }; | ||||||||||
| 130 | } | ||||||||||
| 131 | 0 | return $ret; | |||||||||
| 132 | } | ||||||||||
| 133 | |||||||||||
| 134 | 1 | 1; | |||||||||
| 135 | |||||||||||
| 136 | __END__ | ||||||||||