line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=encoding utf-8 |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Webservice::OVH::Me::Order::Details |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Webservice::OVH; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $ovh = Webservice::OVH->new_from_json("credentials.json"); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $order = $ovh->me->orders->[0]; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $details = $order->details; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
foreach my $detail (@$details) { |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
print $detail->unit_price; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Provides access to details for an order entry. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 METHODS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use strict; |
32
|
36
|
|
|
36
|
|
218
|
use warnings; |
|
36
|
|
|
|
|
69
|
|
|
36
|
|
|
|
|
903
|
|
33
|
36
|
|
|
36
|
|
153
|
use Carp qw{ carp croak }; |
|
36
|
|
|
|
|
67
|
|
|
36
|
|
|
|
|
778
|
|
34
|
36
|
|
|
36
|
|
208
|
|
|
36
|
|
|
|
|
76
|
|
|
36
|
|
|
|
|
19176
|
|
35
|
|
|
|
|
|
|
our $VERSION = 0.47; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 _new |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Internal Method to create the Detail object. |
40
|
|
|
|
|
|
|
This method is not ment to be called directly. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=over |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item * Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $detail_id - api id |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item * Return: L<Webservice::OVH::Me::Order::Detail> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item * Synopsis: Webservice::OVH::Me::Order::Detail->_new($ovh_api_wrapper, $detail_id, $module); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=back |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my ( $class, %params ) = @_; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
0
|
|
|
die "Missing module" unless $params{module}; |
58
|
|
|
|
|
|
|
die "Missing wrapper" unless $params{wrapper}; |
59
|
0
|
0
|
|
|
|
|
die "Missing id" unless $params{id}; |
60
|
0
|
0
|
|
|
|
|
die "Missing order" unless $params{order}; |
61
|
0
|
0
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
my $module = $params{module}; |
63
|
|
|
|
|
|
|
my $api_wrapper = $params{wrapper}; |
64
|
0
|
|
|
|
|
|
my $detail_id = $params{id}; |
65
|
0
|
|
|
|
|
|
my $order = $params{order}; |
66
|
0
|
|
|
|
|
|
my $order_id = $order->id; |
67
|
0
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
my $response = $api_wrapper->rawCall( method => 'get', path => "/me/order/$order_id/details/$detail_id", noSignature => 0 ); |
69
|
|
|
|
|
|
|
croak $response->error if $response->error; |
70
|
0
|
|
|
|
|
|
|
71
|
0
|
0
|
|
|
|
|
my $porperties = $response->content; |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
my $self = bless { _module => $module, _api_wrapper => $api_wrapper, _id => $detail_id, _properties => $porperties, _order => $order }, $class; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
return $self; |
76
|
|
|
|
|
|
|
} |
77
|
0
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 order |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Returns root Order object. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=over |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * Return: L<Webservice::OVH::Me::Order> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * Synopsis: my $order = $datail->order; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my ($self) = @_; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
return $self->{_order}; |
96
|
0
|
|
|
0
|
1
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
=head2 id |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Returns the api id. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=over |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * Return: VALUE |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * Synopsis: my $id = $detail->id; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=back |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
my ($self) = @_; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
return $self->{_id}; |
116
|
|
|
|
|
|
|
} |
117
|
0
|
|
|
0
|
1
|
|
|
118
|
|
|
|
|
|
|
=head2 properties |
119
|
0
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Retrieves properties. |
121
|
|
|
|
|
|
|
This method updates the intern property variable. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=over |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item * Return: HASH |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * Synopsis: my $properties = $detail->properties; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=back |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
my ($self) = @_; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
my $api = $self->{_api_wrapper}; |
137
|
|
|
|
|
|
|
my $order_id = $self->{_order}->id; |
138
|
|
|
|
|
|
|
my $detail_id = $self->id; |
139
|
0
|
|
|
0
|
1
|
|
my $response = $api->rawCall( method => 'get', path => "/me/order/$order_id/details/$detail_id", noSignature => 0 ); |
140
|
|
|
|
|
|
|
croak $response->error if $response->error; |
141
|
0
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
$self->{_properties} = $response->content; |
143
|
0
|
|
|
|
|
|
return $self->{_properties}; |
144
|
0
|
|
|
|
|
|
} |
145
|
0
|
0
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head2 description |
147
|
0
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
Exposed property value. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=over |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item * Return: VALUE |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item * Synopsis: my $description = $detail->description; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=back |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
my ($self) = @_; |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
return $self->{_properties}->{description}; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head2 domain |
167
|
0
|
|
|
0
|
1
|
|
|
168
|
|
|
|
|
|
|
Exposed property value. |
169
|
0
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=over |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item * Return: VALUE |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=item * Synopsis: my $domain = $detail->domain; |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=back |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
my ($self) = @_; |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
return $self->{_properties}->{domain}; |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 quantity |
187
|
|
|
|
|
|
|
|
188
|
0
|
|
|
0
|
1
|
|
Exposed property value. |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
=over |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item * Return: VALUE |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=item * Synopsis: my $quantity = $detail->quantity; |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=back |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=cut |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
my ($self) = @_; |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
return $self->{_properties}->{quantity}; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head2 total_price |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Exposed property value. |
209
|
0
|
|
|
0
|
1
|
|
|
210
|
|
|
|
|
|
|
=over |
211
|
0
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=item * Return: VALUE |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item * Synopsis: my $total_price = $detail->total_price; |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=back |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=cut |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
my ($self) = @_; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
return $self->{_properties}->{totalPrice}; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=head2 unit_price |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
Exposed property value. |
229
|
|
|
|
|
|
|
|
230
|
0
|
|
|
0
|
1
|
|
=over |
231
|
|
|
|
|
|
|
|
232
|
0
|
|
|
|
|
|
=item * Return: VALUE |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item * Synopsis: my $unit_price = $detail->unit_price; |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=back |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=cut |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
my ($self) = @_; |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
return $self->{_properties}->{unitPrice}; |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
1; |