line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Async::Webservice::UPS::QVSubscription; |
2
|
|
|
|
|
|
|
$Net::Async::Webservice::UPS::QVSubscription::VERSION = '1.1.2'; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$Net::Async::Webservice::UPS::QVSubscription::DIST = 'Net-Async-Webservice-UPS'; |
5
|
|
|
|
|
|
|
} |
6
|
3
|
|
|
3
|
|
1682
|
use Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
7
|
3
|
|
|
3
|
|
936
|
use 5.010; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
116
|
|
8
|
3
|
|
|
3
|
|
11
|
use Types::Standard qw(Str Int Bool StrictNum); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
23
|
|
9
|
|
|
|
|
|
|
use Types::DateTime |
10
|
3
|
|
|
|
|
49
|
DateTime => { -as => 'DateTimeT' }, |
11
|
3
|
|
|
3
|
|
3903
|
Format => { -as => 'DTFormat' }; |
|
3
|
|
|
|
|
43229
|
|
12
|
3
|
|
|
3
|
|
1441
|
use Net::Async::Webservice::UPS::Types ':types'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
22
|
|
13
|
3
|
|
|
3
|
|
11928
|
use namespace::autoclean; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
28
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $dt = DateTimeT->plus_coercions(DTFormat['ISO8601']); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# ABSTRACT: a UPS Quantum View subscription |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has begin_date => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
isa => $dt, |
23
|
|
|
|
|
|
|
coerce => $dt->coercion |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has end_date => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => $dt, |
30
|
|
|
|
|
|
|
coerce => $dt->coercion |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has name => ( |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => Str, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has filename => ( |
41
|
|
|
|
|
|
|
is => 'ro', |
42
|
|
|
|
|
|
|
isa => Str, |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub as_hash { |
47
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
|
|
|
my $sr = { |
|
|
0
|
|
|
|
|
|
50
|
|
|
|
|
|
|
( $self->name ? ( Name => $self->name ) : () ), |
51
|
|
|
|
|
|
|
( $self->filename ? ( FileName => $self->filename ) : () ), |
52
|
|
|
|
|
|
|
}; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
for my $f (qw(begin end)){ |
55
|
0
|
|
|
|
|
|
my $method = "${f}_date"; |
56
|
0
|
0
|
|
|
|
|
if ($self->$method) { |
57
|
0
|
|
|
|
|
|
my $date = $self->$method->clone->set_time_zone('UTC'); |
58
|
0
|
|
|
|
|
|
$sr->{DateTimeRange}{"\u${f}DateTime"} = |
59
|
|
|
|
|
|
|
$date->strftime('%Y%m%d%H%M%S'); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $sr; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=pod |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=encoding UTF-8 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 NAME |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Net::Async::Webservice::UPS::QVSubscription - a UPS Quantum View subscription |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 VERSION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
version 1.1.2 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 DESCRIPTION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Instances of this class can be passed to |
85
|
|
|
|
|
|
|
L<Net::Async::Webservice::UPS/qv_events> to specify what events you |
86
|
|
|
|
|
|
|
want to retrieve. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<begin_date> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Optional L<DateTime> (with coercion from ISO 8601 strings), to only |
93
|
|
|
|
|
|
|
retrieve events after this date. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 C<end_date> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Optional L<DateTime> (with coercion from ISO 8601 strings), to only |
98
|
|
|
|
|
|
|
retrieve events before this date. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 C<name> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Optional string, the name of a subscription. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 C<filename> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Optional string, the name of a Quantum View subscription file. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 METHODS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 C<as_hash> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Returns a hashref that, when passed through L<XML::Simple>, will |
113
|
|
|
|
|
|
|
produce the XML fragment needed in UPS C<QVEvents> requests to |
114
|
|
|
|
|
|
|
represent this subscription. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHORS |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=over 4 |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Sherzod B. Ruzmetov <sherzodr@cpan.org> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=back |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
135
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |