line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Async::Webservice::UPS::Contact; |
2
|
|
|
|
|
|
|
$Net::Async::Webservice::UPS::Contact::VERSION = '1.1.3'; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$Net::Async::Webservice::UPS::Contact::DIST = 'Net-Async-Webservice-UPS'; |
5
|
|
|
|
|
|
|
} |
6
|
3
|
|
|
3
|
|
1887
|
use Moo; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
21
|
|
7
|
3
|
|
|
3
|
|
1128
|
use 5.010; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
161
|
|
8
|
3
|
|
|
3
|
|
16
|
use Types::Standard qw(Str); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
36
|
|
9
|
3
|
|
|
3
|
|
2170
|
use Net::Async::Webservice::UPS::Types ':types'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
20
|
|
10
|
3
|
|
|
3
|
|
14355
|
use Net::Async::Webservice::UPS::Address; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
97
|
|
11
|
3
|
|
|
3
|
|
15
|
use namespace::autoclean; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
26
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: a "contact" for UPS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has name => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => Str, |
19
|
|
|
|
|
|
|
required => 0, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has company_name => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
isa => Str, |
26
|
|
|
|
|
|
|
required => 0, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has attention_name => ( |
31
|
|
|
|
|
|
|
is => 'ro', |
32
|
|
|
|
|
|
|
isa => Str, |
33
|
|
|
|
|
|
|
required => 0, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has phone_number => ( |
38
|
|
|
|
|
|
|
is => 'ro', |
39
|
|
|
|
|
|
|
isa => Str, |
40
|
|
|
|
|
|
|
required => 0, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has email_address => ( |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => Str, |
47
|
|
|
|
|
|
|
required => 0, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has address => ( |
52
|
|
|
|
|
|
|
is => 'ro', |
53
|
|
|
|
|
|
|
isa => Address, |
54
|
|
|
|
|
|
|
required => 1, |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub as_hash { |
59
|
0
|
|
|
0
|
1
|
|
my ($self,$shape) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
0
|
|
|
|
$shape ||= 'Ship'; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
return { |
64
|
0
|
|
|
|
|
|
( $self->name ? ( Name => $self->name ) : () ), |
65
|
|
|
|
|
|
|
( $self->company_name ? ( CompanyName => $self->company_name ) : () ), |
66
|
|
|
|
|
|
|
( $self->attention_name ? ( AttentionName => $self->attention_name ) : () ), |
67
|
|
|
|
|
|
|
( $self->phone_number ? ( PhoneNumber => $self->phone_number ) : () ), |
68
|
|
|
|
|
|
|
( $self->email_address ? ( EmailAddress => $self->email_address ) : () ), |
69
|
0
|
0
|
|
|
|
|
%{ $self->address->as_hash($shape) }, |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
70
|
|
|
|
|
|
|
}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub cache_id { |
75
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return $self->address->cache_id; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=pod |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=encoding UTF-8 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 NAME |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Net::Async::Webservice::UPS::Contact - a "contact" for UPS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 VERSION |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
version 1.1.3 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DESCRIPTION |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
A contact is someone you send a shipment to, or that you want to pick |
99
|
|
|
|
|
|
|
up a shipment from. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head2 C<name> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Optional string, the contact's name. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 C<company_name> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Optional string, the contact's company name. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 C<attention_name> |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Optional string, the name of the person to the attention of whom UPS |
114
|
|
|
|
|
|
|
should bring the shipment. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 C<phone_number> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Optional string, the contact's phone number. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 C<email_address> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Optional string, the contact's email address. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 C<address> |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Required L<Net::Async::Webservice::UPS::Address> object, the contact's |
127
|
|
|
|
|
|
|
address. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 METHODS |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 C<as_hash> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Returns a hashref that, when passed through L<XML::Simple>, will |
134
|
|
|
|
|
|
|
produce the XML fragment needed in UPS requests to represent this |
135
|
|
|
|
|
|
|
contact. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 C<cache_id> |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Returns a string identifying this contact. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 AUTHORS |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=over 4 |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Sherzod B. Ruzmetov <sherzodr@cpan.org> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=back |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
160
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |