line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::iThenticate::Response; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
30703
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1505
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.16; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
WebService::iThenticate::Response - manipulate response objects for the WebService::iThenticate |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# make the request |
15
|
|
|
|
|
|
|
$response = $ithenticate_api_client->login; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# check for any errors |
18
|
|
|
|
|
|
|
my %errors = %{ $response->errors }; |
19
|
|
|
|
|
|
|
foreach my $key ( keys %errors ) { |
20
|
|
|
|
|
|
|
warn(sprintf('Error %s encountered, message %s', $key, $errors{$key})); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# grab the numeric api status code |
24
|
|
|
|
|
|
|
$api_status_code = $response->api_status; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# grab the session id |
27
|
|
|
|
|
|
|
$sid = $response->sid |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
This class encapsulates responses received from the WebService::iThenticate |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=over 4 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# new is a private method in this class so don't perldoc it |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _new { |
45
|
1
|
|
|
1
|
|
1671
|
my $class = shift; |
46
|
1
|
50
|
|
|
|
17
|
my $response = shift or die 'need a response object'; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my %self = (); |
49
|
0
|
|
|
|
|
|
$self{rpc_response} = $response; |
50
|
0
|
|
|
|
|
|
bless \%self, $class; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return \%self; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item errors() |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
%errors = %{ $response->errors }; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Returns a hash reference of error name => error value, or undefined if no |
60
|
|
|
|
|
|
|
errors present. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub errors { |
65
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# return if no errors |
68
|
0
|
0
|
|
|
|
|
return unless exists $self->{rpc_response}->{errors}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# if there are errors, they are either in array form or array |
71
|
0
|
0
|
|
|
|
|
if ( ref( $self->{rpc_response}->{errors} ) eq 'RPC::XML::array' ) { |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# errors returned in an array |
74
|
0
|
|
|
|
|
|
return map { $_->value } @{ $self->{rpc_response}->{errors} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# errors returned in a hash |
78
|
0
|
|
|
|
|
|
my %errors = map { $_ => $self->{rpc_response}->{errors}->{$_}->value->[0] } keys %{ $self->{rpc_response}->{errors} }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
0
|
0
|
|
|
|
|
return unless keys %errors; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
return \%errors; |
83
|
|
|
|
|
|
|
} ## end sub errors |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item sid() |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
$sid = $response->sid; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns the session id for an authenticated client, or undefined if |
91
|
|
|
|
|
|
|
the client has not authenticated (no session present). |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub sid { |
97
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{sid}; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return $self->{rpc_response}->{sid}->value; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item as_xml() |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
$xml_response = $response->as_xml; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Returns the stringified xml response |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub as_xml { |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
115
|
|
|
|
|
|
|
|
116
|
0
|
0
|
|
|
|
|
die "no rpc_response object\n" unless exists $self->{rpc_response}; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
return $self->{rpc_response}->as_string; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item timestamp() |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
$timestamp = $response->timestamp; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Returns the timestamp of the api response in the format |
126
|
|
|
|
|
|
|
iso8601 XMLRPC field in UTC (with a "Z" appended). |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=cut |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub timestamp { |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
133
|
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{response_timestamp}; |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
return $self->{rpc_response}->{response_timestamp}; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item api_status() |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
$api_status = $response->api_status; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Returns the numeric api status code for the client request. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Values correspond to HTTP status codes, e.g. 200 OK, 404 Not Found, etc. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub api_status { |
151
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
152
|
|
|
|
|
|
|
|
153
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{api_status}; |
154
|
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
return $self->{rpc_response}->{api_status}->value; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item id() |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
$id = $response->id; |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Returns the id of a newly created object |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub id { |
168
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
169
|
|
|
|
|
|
|
|
170
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{id}; |
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
|
return $self->{rpc_response}->{id}->value; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item report() |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
$report = $response->report; |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
# a url to view the report which requires user authentication |
180
|
|
|
|
|
|
|
$report_url = $report->{report_url}; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
# a view only report url which expires in a set amount of time |
183
|
|
|
|
|
|
|
$view_only_url = $report->{view_only_url}; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# the expiration time in minutes of the $view_only_url |
186
|
|
|
|
|
|
|
$view_only_expires = $report->{view_only_expires}; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Returns a hash reference containing links to view the report, one link |
189
|
|
|
|
|
|
|
requires authentication, one does not but expires a set amount of time |
190
|
|
|
|
|
|
|
after the api request is made. |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=cut |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub report { |
195
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
196
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
my %response = map { $_ => $self->{rpc_response}->{$_}->value } |
|
0
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
qw( report_url view_only_url view_only_expires ); |
199
|
|
|
|
|
|
|
|
200
|
0
|
|
|
|
|
|
return \%response; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=item document() |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
$document = $response->document; |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
Returns an hash reference of the document data |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=cut |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub document { |
214
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
215
|
|
|
|
|
|
|
|
216
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{document}; |
217
|
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
my $document = $self->{rpc_response}->{document}; |
219
|
|
|
|
|
|
|
|
220
|
0
|
|
|
|
|
|
my %hash; |
221
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$document} ) { |
|
0
|
|
|
|
|
|
|
222
|
0
|
|
|
|
|
|
$hash{$key} = $document->{$key}->value; |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
0
|
|
|
|
|
|
return \%hash; |
226
|
|
|
|
|
|
|
} |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=item account() |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
$account = $response->account; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
Returns a hash reference of the account status |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
sub account { |
238
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
239
|
|
|
|
|
|
|
|
240
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{account}; |
241
|
|
|
|
|
|
|
|
242
|
0
|
|
|
|
|
|
my $account = $self->{rpc_response}->{account}; |
243
|
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
my %status_hash; |
245
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$account} ) { |
|
0
|
|
|
|
|
|
|
246
|
0
|
|
|
|
|
|
$status_hash{$key} = $account->{$key}->value; |
247
|
|
|
|
|
|
|
} |
248
|
|
|
|
|
|
|
|
249
|
0
|
|
|
|
|
|
return \%status_hash; |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=item folder() |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
$folder = $response->folder; |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
Returns a hash reference of the folder data |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
=cut |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
sub folder { |
263
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
264
|
|
|
|
|
|
|
|
265
|
0
|
0
|
|
|
|
|
return unless $self->{rpc_response}->{folder}; |
266
|
|
|
|
|
|
|
|
267
|
0
|
|
|
|
|
|
my $folder = $self->{rpc_response}->{folder}; |
268
|
|
|
|
|
|
|
|
269
|
0
|
|
|
|
|
|
my %folder_hash; |
270
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$folder} ) { |
|
0
|
|
|
|
|
|
|
271
|
0
|
|
|
|
|
|
$folder_hash{$key} = $folder->{$key}->value; |
272
|
|
|
|
|
|
|
} |
273
|
|
|
|
|
|
|
|
274
|
0
|
|
|
|
|
|
return \%folder_hash; |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=item uploaded() |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
$uploaded = $response->uploaded; |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
Returns an array reference of document hash references |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=cut |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
sub uploaded { |
286
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
287
|
|
|
|
|
|
|
|
288
|
0
|
0
|
|
|
|
|
return unless defined $self->{rpc_response}->{uploaded}->[0]; |
289
|
|
|
|
|
|
|
|
290
|
0
|
|
|
|
|
|
my @uploaded; |
291
|
0
|
|
|
|
|
|
foreach my $upload ( @{ $self->{rpc_response}->{uploaded} } ) { |
|
0
|
|
|
|
|
|
|
292
|
0
|
|
|
|
|
|
my %hash; |
293
|
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$upload} ) { |
|
0
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
|
296
|
0
|
|
|
|
|
|
$hash{$key} = $upload->{$key}->value; |
297
|
|
|
|
|
|
|
} |
298
|
0
|
|
|
|
|
|
push @uploaded, \%hash; |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
0
|
|
|
|
|
|
return \@uploaded; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=item documents() |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$documents = $response->documents; |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
Returns an array reference of document hash references |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=cut |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
sub documents { |
315
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
316
|
|
|
|
|
|
|
|
317
|
0
|
0
|
|
|
|
|
return unless defined $self->{rpc_response}->{documents}->[0]; |
318
|
|
|
|
|
|
|
|
319
|
0
|
|
|
|
|
|
my @documents; |
320
|
0
|
|
|
|
|
|
foreach my $doc ( @{ $self->{rpc_response}->{documents} } ) { |
|
0
|
|
|
|
|
|
|
321
|
0
|
|
|
|
|
|
my %hash; |
322
|
|
|
|
|
|
|
|
323
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$doc} ) { |
|
0
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
$hash{$key} = $doc->{$key}->value; |
326
|
|
|
|
|
|
|
} |
327
|
0
|
|
|
|
|
|
push @documents, \%hash; |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
0
|
|
|
|
|
|
return \@documents; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=item groups() |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
@groups = @{ $response->groups }; |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
Returns an array reference of group hash references |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=cut |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub groups { |
344
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
345
|
|
|
|
|
|
|
|
346
|
0
|
0
|
|
|
|
|
return unless defined $self->{rpc_response}->{groups}; |
347
|
|
|
|
|
|
|
|
348
|
0
|
|
|
|
|
|
my @groups; |
349
|
0
|
|
|
|
|
|
foreach my $group ( @{ $self->{rpc_response}->{groups} } ) { |
|
0
|
|
|
|
|
|
|
350
|
0
|
|
|
|
|
|
my %hash; |
351
|
|
|
|
|
|
|
|
352
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$group} ) { |
|
0
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
|
354
|
0
|
|
|
|
|
|
$hash{$key} = $group->{$key}->value; |
355
|
|
|
|
|
|
|
} |
356
|
0
|
|
|
|
|
|
push @groups, \%hash; |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
0
|
|
|
|
|
|
return \@groups; |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=item folders() |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
$folders_array_reference = $response->folders; |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
where the array reference contains a set of hash references |
368
|
|
|
|
|
|
|
with the folder data |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
[ { |
371
|
|
|
|
|
|
|
folder_id => '1', |
372
|
|
|
|
|
|
|
name => 'test_folder', |
373
|
|
|
|
|
|
|
}, |
374
|
|
|
|
|
|
|
{ |
375
|
|
|
|
|
|
|
... |
376
|
|
|
|
|
|
|
}, |
377
|
|
|
|
|
|
|
] |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
Returns an array reference of folder hash references |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=cut |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
sub folders { |
384
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
385
|
|
|
|
|
|
|
|
386
|
0
|
0
|
|
|
|
|
return unless defined $self->{rpc_response}->{folders}; |
387
|
|
|
|
|
|
|
|
388
|
0
|
|
|
|
|
|
my @folders; |
389
|
0
|
|
|
|
|
|
foreach my $folder ( @{ $self->{rpc_response}->{folders} } ) { |
|
0
|
|
|
|
|
|
|
390
|
0
|
|
|
|
|
|
my %hash; |
391
|
|
|
|
|
|
|
|
392
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$folder} ) { |
|
0
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
|
394
|
0
|
|
|
|
|
|
$hash{$key} = $folder->{$key}->value; |
395
|
|
|
|
|
|
|
} |
396
|
0
|
|
|
|
|
|
push @folders, \%hash; |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
0
|
|
|
|
|
|
return \@folders; |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=item users() |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
@users = @{ $response->users }; |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
Returns an array reference of user hash references |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=cut |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
sub users { |
412
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
413
|
|
|
|
|
|
|
|
414
|
0
|
0
|
|
|
|
|
return unless defined $self->{rpc_response}->{users}; |
415
|
|
|
|
|
|
|
|
416
|
0
|
|
|
|
|
|
my @users; |
417
|
0
|
|
|
|
|
|
foreach my $user ( @{ $self->{rpc_response}->{users} } ) { |
|
0
|
|
|
|
|
|
|
418
|
0
|
|
|
|
|
|
my %hash; |
419
|
|
|
|
|
|
|
|
420
|
0
|
|
|
|
|
|
foreach my $key ( keys %{$user} ) { |
|
0
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
|
422
|
0
|
|
|
|
|
|
$hash{$key} = $user->{$key}->value; |
423
|
|
|
|
|
|
|
} |
424
|
0
|
|
|
|
|
|
push @users, \%hash; |
425
|
|
|
|
|
|
|
} |
426
|
|
|
|
|
|
|
|
427
|
0
|
|
|
|
|
|
return \@users; |
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=item messages() |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
if ( $response->messages ) { |
435
|
|
|
|
|
|
|
@messages = @{ $response->messages }; |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
Returns an array reference of message scalars |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=cut |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub messages { |
443
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
444
|
|
|
|
|
|
|
|
445
|
0
|
|
|
|
|
|
my $messages_ref = $self->{rpc_response}->{messages}; |
446
|
|
|
|
|
|
|
|
447
|
0
|
0
|
|
|
|
|
return unless defined $messages_ref->[0]; |
448
|
|
|
|
|
|
|
|
449
|
0
|
|
|
|
|
|
my @messages = map { $_->value } @{$messages_ref}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
|
451
|
0
|
|
|
|
|
|
return \@messages; |
452
|
|
|
|
|
|
|
} |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=back |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=head1 SEE ALSO |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
WebService::iThenticate::Request, WebService::iThenticate::Client, RPC::XML |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=head1 AUTHOR |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
Fred Moyer |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
=head1 COPYRIGHT |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
Copyright (C) (2011) iParadigms, LLC. All rights reserved. |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
=head1 LICENSE |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
=cut |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
1; |