| 1 | package Net::Async::Webservice::UPS::Response::QV::Event; | ||||||||||||||
| 2 | 1 | $Net::Async::Webservice::UPS::Response::QV::Event::VERSION = '1.1.4'; | |||||||||||||
| 3 | { | ||||||||||||||
| 4 | 1 | $Net::Async::Webservice::UPS::Response::QV::Event::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 ':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 namespace::autoclean; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | |||||||||||||||
| 15 | # ABSTRACT: a Quantum View "event" | ||||||||||||||
| 16 | |||||||||||||||
| 17 | |||||||||||||||
| 18 | 1 | has name => ( | |||||||||||||
| 19 | is => 'ro', | ||||||||||||||
| 20 | isa => Str, | ||||||||||||||
| 21 | required => 1, | ||||||||||||||
| 22 | ); | ||||||||||||||
| 23 | |||||||||||||||
| 24 | |||||||||||||||
| 25 | 1 | has number => ( | |||||||||||||
| 26 | is => 'ro', | ||||||||||||||
| 27 | isa => Str, | ||||||||||||||
| 28 | required => 1, | ||||||||||||||
| 29 | ); | ||||||||||||||
| 30 | |||||||||||||||
| 31 | |||||||||||||||
| 32 | 1 | has status => ( | |||||||||||||
| 33 | is => 'ro', | ||||||||||||||
| 34 | isa => HashRef, | ||||||||||||||
| 35 | required => 1, | ||||||||||||||
| 36 | ); | ||||||||||||||
| 37 | |||||||||||||||
| 38 | |||||||||||||||
| 39 | 1 | has files => ( | |||||||||||||
| 40 | is => 'ro', | ||||||||||||||
| 41 | isa => ArrayRef[QVFile], | ||||||||||||||
| 42 | required => 1, | ||||||||||||||
| 43 | ); | ||||||||||||||
| 44 | |||||||||||||||
| 45 | |||||||||||||||
| 46 | 1 | has begin_date => ( | |||||||||||||
| 47 | is => 'ro', | ||||||||||||||
| 48 | isa => DateTimeT, | ||||||||||||||
| 49 | required => 0, | ||||||||||||||
| 50 | ); | ||||||||||||||
| 51 | |||||||||||||||
| 52 | |||||||||||||||
| 53 | 1 | has end_date => ( | |||||||||||||
| 54 | is => 'ro', | ||||||||||||||
| 55 | isa => DateTimeT, | ||||||||||||||
| 56 | required => 0, | ||||||||||||||
| 57 | ); | ||||||||||||||
| 58 | |||||||||||||||
| 59 | 5 | ▶ | sub BUILDARGS { | ||||||||||||
|
Subroutine
BUILDARGS: called CC=5 SCAR=17.3
Pod
undocumented
| |||||||||||||||
| 60 | 5 | my ($class,$hashref) = @_; | |||||||||||||
| 61 | 0 | ▶ | if (@_>2) { shift; $hashref={@_} }; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 62 | |||||||||||||||
| 63 | 5 | ▶ | if ($hashref->{Name}) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 64 | 5 | state $date_parser = DateTime::Format::Strptime->new( | |||||||||||||
| 65 | pattern => '%Y%m%d%H%M%S', | ||||||||||||||
| 66 | ); | ||||||||||||||
| 67 | 5 | set_implied_argument($hashref); | |||||||||||||
| 68 | |||||||||||||||
| 69 | return { | ||||||||||||||
| 70 | in_if(name=>'Name'), | ||||||||||||||
| 71 | in_if(number=>'Number'), | ||||||||||||||
| 72 | in_if(status=>'SubscriptionStatus'), | ||||||||||||||
| 73 | ( $hashref->{DateRange}{BeginDate} ? ( begin_date => $date_parser->parse_datetime($hashref->{DateRange}{BeginDate}) ) : () ), | ||||||||||||||
| 74 | 5 | ▶ | ( $hashref->{DateRange}{EndDate} ? ( end_date => $date_parser->parse_datetime($hashref->{DateRange}{EndDate}) ) : () ), | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 75 | in_object_array_if(files=>'SubscriptionFile','Net::Async::Webservice::UPS::Response::QV::File'), | ||||||||||||||
| 76 | }; | ||||||||||||||
| 77 | } | ||||||||||||||
| 78 | 0 | return $hashref; | |||||||||||||
| 79 | } | ||||||||||||||
| 80 | |||||||||||||||
| 81 | 1 | 1; | |||||||||||||
| 82 | |||||||||||||||
| 83 | __END__ | ||||||||||||||