line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::SmugMug::API; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26040
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
70
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
WWW::SmugMug::API - Perl wrapper for the SmugMug API |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 1.02 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use WWW::SmugMug::API; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $sm_api = WWW::SmugMug::API->new( |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
sm_api_key => 'changeme', |
25
|
|
|
|
|
|
|
secure => 1, |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$sm_api->login_withPassword( |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
EmailAddress => 'me@privacy.net', |
32
|
|
|
|
|
|
|
Password => 'password', |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
... |
36
|
|
|
|
|
|
|
$sm_api->logout; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Provides a low-level wrapper for the 1.2.0 version of the SmugMug API. Calls |
41
|
|
|
|
|
|
|
requiring a SessionID use the one returned from the last successful login call |
42
|
|
|
|
|
|
|
(login_anonymously, login_withPassword, or login_withHash), and calls requiring |
43
|
|
|
|
|
|
|
the API key use the sm_api_key parameter passed to the constructor; these |
44
|
|
|
|
|
|
|
provided parameters cannot be overridden. All other required parameters must |
45
|
|
|
|
|
|
|
be provided by the caller. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
The wrapper will silently discard any parameters that it does not recognise. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Method names are the API methods with the 'smugmug.' prefix removed and '_' |
50
|
|
|
|
|
|
|
substituted for '.' (e.g. 'smugmug.login.withPassword becomes |
51
|
|
|
|
|
|
|
login_withPassword()) |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Methods return hash references. The value of the 'stat' key will be 'ok' if |
54
|
|
|
|
|
|
|
the call succeeded, 'fail' otherwise. Fail responses contain three key/value |
55
|
|
|
|
|
|
|
pairs: 'stat', 'message', and 'code'. Message is an informative message |
56
|
|
|
|
|
|
|
about the failure. The code will be positive for an error thrown by SmugMug |
57
|
|
|
|
|
|
|
and negative for one from the wrapper. The following error codes are known: |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item -3 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Session not initialised. Before calling any other methods, you must |
64
|
|
|
|
|
|
|
successfully call login_anonymously, login_withPassword, or login_withHash. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item -2 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
HTTP error. Message will be the complete error (e.g. '404 Not Found') |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item -1 |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Missing required parameter. All parameters listed in the documentation as |
73
|
|
|
|
|
|
|
required must be provided, or the wrapper will reject the call. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item 1 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Invalid login. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item 3 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Invalid session. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item 4 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Invalid user. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item 5 |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
System error. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item 6 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Wrong format. (Image format when uploading, I believe) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item 9 |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Invalid album. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item 11 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Ancient version. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item 15 |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Empty set. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item 18 |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Invalid API key. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=back |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
NOTE: While this wrapper does provide a method called images_upload, per the |
114
|
|
|
|
|
|
|
best practices recommendation of the SmugMug developers we use a binary |
115
|
|
|
|
|
|
|
uploading method (HTTP PUT) to upload the image; it is not an implementation |
116
|
|
|
|
|
|
|
of the API method smugmug.images.upload. images_uploadFromURL is not provided. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|
120
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
71
|
|
121
|
1
|
|
|
1
|
|
1526
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
166690
|
|
|
1
|
|
|
|
|
42
|
|
122
|
1
|
|
|
1
|
|
1580
|
use JSON; |
|
1
|
|
|
|
|
16431
|
|
|
1
|
|
|
|
|
5
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
my $KEEP_ALIVE_CACHESIZE = 10; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
my $API_VERSION = '1.2.1'; |
127
|
|
|
|
|
|
|
my $ENDPOINT_BASE = 'api.smugmug.com/services/api/json/1.2.1/'; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
my $ERROR_CODE = { |
130
|
|
|
|
|
|
|
MISSING_REQUIRED_PARAMETER => -1, |
131
|
|
|
|
|
|
|
HTTP_ERROR => -2, |
132
|
|
|
|
|
|
|
SESSION_NOT_INITIALISED => -3, |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 new |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Create a new client object. Parameters: |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=over |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item sm_api_key |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
API key |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item agent |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Useragent string. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item secure |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Set this to C<1> to use SSL. Defaults to C<0> |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item timeout |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Time (in seconds) to wait for a response. Defaults to 30. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item retry |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Set this to C<1> to retry on error. Defaults to C<0> |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=back |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub new { |
168
|
0
|
|
|
0
|
1
|
|
my ( $class, $cnf ) = @_; |
169
|
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
my $retry = $cnf->{retry}; |
171
|
0
|
0
|
|
|
|
|
$retry = 0 unless defined $retry; |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
my $agent = $cnf->{agent}; |
174
|
0
|
0
|
|
|
|
|
$agent = "WWW::SmugMug::API/$VERSION" unless defined $agent; |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
my $sm_api_key = $cnf->{sm_api_key}; |
177
|
0
|
0
|
|
|
|
|
croak 'No API Key' unless defined $sm_api_key; |
178
|
|
|
|
|
|
|
|
179
|
0
|
|
|
|
|
|
my $sm_endpoint; |
180
|
0
|
|
|
|
|
|
my $secure = $cnf->{secure}; |
181
|
0
|
0
|
|
|
|
|
if ($secure) { |
182
|
0
|
|
|
|
|
|
$sm_endpoint = 'https://' . $ENDPOINT_BASE; |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
else { |
185
|
0
|
|
|
|
|
|
$sm_endpoint = 'http://' . $ENDPOINT_BASE; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
0
|
|
|
|
|
|
my $ua; |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
|
|
|
$ua = LWP::UserAgent->new( |
191
|
|
|
|
|
|
|
keep_alive => $KEEP_ALIVE_CACHESIZE, |
192
|
|
|
|
|
|
|
requests_redirectable => [qw(GET HEAD DELETE PUT)], |
193
|
|
|
|
|
|
|
); |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
$ua->agent($agent); |
196
|
0
|
|
|
|
|
|
$ua->timeout(30); |
197
|
0
|
|
|
|
|
|
$ua->env_proxy; |
198
|
|
|
|
|
|
|
|
199
|
0
|
|
|
|
|
|
my $json = JSON->new(); |
200
|
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
my $self = bless { |
202
|
|
|
|
|
|
|
ua => $ua, |
203
|
|
|
|
|
|
|
json => $json, |
204
|
|
|
|
|
|
|
retry => $retry, |
205
|
|
|
|
|
|
|
agent => $agent, |
206
|
|
|
|
|
|
|
sm_api_key => $sm_api_key, |
207
|
|
|
|
|
|
|
sm_endpoint => $sm_endpoint, |
208
|
|
|
|
|
|
|
sm_session => undef, |
209
|
|
|
|
|
|
|
}, $class; |
210
|
|
|
|
|
|
|
|
211
|
0
|
|
|
|
|
|
return $self; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
#BEGIN autogenerated subs |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 albums_applyWatermark |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Calls smugmug.albums.applyWatermark. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
Parameters: |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=over |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item WatermarkID (integer) (required) |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=back |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=cut |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
sub albums_applyWatermark { |
233
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
234
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.applyWatermark'; |
235
|
0
|
|
|
|
|
|
my $params; |
236
|
|
|
|
|
|
|
|
237
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
238
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
else { |
241
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID WatermarkID /; |
245
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
246
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
247
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=head2 albums_changeSettings |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
Calls smugmug.albums.changeSettings. |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
Parameters: |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
=over |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=item Title (string) |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=item CategoryID (integer) |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=item SubCategoryID (integer) |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
=item Description (string) |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=item Keywords (string) |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=item AlbumTemplateID (integer) |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=item Geography (boolean) |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=item HighlightID (integer) |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=item Position (integer) |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=item Header (boolean) |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=item Clean (boolean) |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=item EXIF (boolean) |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=item Filenames (boolean) |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=item SquareThumbs (boolean) |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=item TemplateID (integer) |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=item SortMethod (string) |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=item SortDirection (boolean) |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=item Password (string) |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=item PasswordHint (string) |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=item Public (boolean) |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=item WorldSearchable (boolean) |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=item SmugSearchable (boolean) |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=item External (boolean) |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=item Protected (boolean) |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=item Watermarking (boolean) |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item WatermarkID (integer) |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=item HideOwner (boolean) |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
=item Larges (boolean) |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=item XLarges (boolean) |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=item X2Larges (boolean) |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=item X3Larges (boolean) |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=item Originals (boolean) |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=item CanRank (boolean) |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=item FriendEdit (boolean) |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=item FamilyEdit (boolean) |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=item Comments (boolean) |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=item Share (boolean) |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=item Printable (boolean) |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=item DefaultColor (boolean) |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=item ProofDays (integer) |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=item Backprinting (string) |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=item UnsharpAmount (float) |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
=item UnsharpRadius (float) |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=item UnsharpThreshold (float) |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=item UnsharpSigma (float) |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=item CommunityID (integer) |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=back |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=cut |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
sub albums_changeSettings { |
361
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
362
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.changeSettings'; |
363
|
0
|
|
|
|
|
|
my $params; |
364
|
|
|
|
|
|
|
|
365
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
366
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
367
|
|
|
|
|
|
|
} |
368
|
|
|
|
|
|
|
else { |
369
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
370
|
|
|
|
|
|
|
} |
371
|
|
|
|
|
|
|
|
372
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID /; |
373
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
374
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
375
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
} |
378
|
|
|
|
|
|
|
|
379
|
0
|
|
|
|
|
|
my @optional_params = qw/Title CategoryID SubCategoryID Description Keywords AlbumTemplateID Geography HighlightID Position Header Clean EXIF Filenames SquareThumbs TemplateID SortMethod SortDirection Password PasswordHint Public WorldSearchable SmugSearchable External Protected Watermarking WatermarkID HideOwner Larges XLarges X2Larges X3Larges Originals CanRank FriendEdit FamilyEdit Comments Share Printable DefaultColor ProofDays Backprinting UnsharpAmount UnsharpRadius UnsharpThreshold UnsharpSigma CommunityID /; |
380
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
381
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
382
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
383
|
|
|
|
|
|
|
} |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=head2 albums_create |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
Calls smugmug.albums.create. |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
Parameters: |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=over |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=item Title (string) (required) |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=item CategoryID (string) (required) |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item SubCategoryID (integer) |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=item Description (string) |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=item Keywords (string) |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=item AlbumTemplateID (integer) |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=item Geography (boolean) |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=item HighlightID (integer) |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=item Position (integer) |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=item Header (boolean) |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=item Clean (boolean) |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
=item EXIF (boolean) |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=item Filenames (boolean) |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=item SquareThumbs (boolean) |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
=item TemplateID (integer) |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=item SortMethod (string) |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=item SortDirection (boolean) |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=item Password (string) |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=item PasswordHint (string) |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
=item Public (boolean) |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=item WorldSearchable (boolean) |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
=item SmugSearchable (boolean) |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
=item External (boolean) |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=item Protected (boolean) |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
=item Watermarking (boolean) |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=item WatermarkID (integer) |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
=item HideOwner (boolean) |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
=item Larges (boolean) |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
=item XLarges (boolean) |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=item X2Larges (boolean) |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=item X3Larges (boolean) |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=item Originals (boolean) |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=item CanRank (boolean) |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=item FriendEdit (boolean) |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=item FamilyEdit (boolean) |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
=item Comments (boolean) |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=item Share (boolean) |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
=item Printable (boolean) |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
=item DefaultColor (boolean) |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
=item ProofDays (integer) |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
=item Backprinting (string) |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
=item UnsharpAmount (float) |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
=item UnsharpRadius (float) |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
=item UnsharpThreshold (float) |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
=item UnsharpSigma (float) |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
=item CommunityID (integer) |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
=back |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
=cut |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
sub albums_create { |
494
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
495
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.create'; |
496
|
0
|
|
|
|
|
|
my $params; |
497
|
|
|
|
|
|
|
|
498
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
499
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
500
|
|
|
|
|
|
|
} |
501
|
|
|
|
|
|
|
else { |
502
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
503
|
|
|
|
|
|
|
} |
504
|
|
|
|
|
|
|
|
505
|
0
|
|
|
|
|
|
my @mandatory_params = qw/Title CategoryID /; |
506
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
507
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
508
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
} |
511
|
|
|
|
|
|
|
|
512
|
0
|
|
|
|
|
|
my @optional_params = qw/SubCategoryID Description Keywords AlbumTemplateID Geography HighlightID Position Header Clean EXIF Filenames SquareThumbs TemplateID SortMethod SortDirection Password PasswordHint Public WorldSearchable SmugSearchable External Protected Watermarking WatermarkID HideOwner Larges XLarges X2Larges X3Larges Originals CanRank FriendEdit FamilyEdit Comments Share Printable DefaultColor ProofDays Backprinting UnsharpAmount UnsharpRadius UnsharpThreshold UnsharpSigma CommunityID /; |
513
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
514
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
515
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
516
|
|
|
|
|
|
|
} |
517
|
|
|
|
|
|
|
} |
518
|
|
|
|
|
|
|
|
519
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
=head2 albums_delete |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
Calls smugmug.albums.delete. |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
Parameters: |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=over |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
=back |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
=cut |
535
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
sub albums_delete { |
537
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
538
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.delete'; |
539
|
0
|
|
|
|
|
|
my $params; |
540
|
|
|
|
|
|
|
|
541
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
542
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
543
|
|
|
|
|
|
|
} |
544
|
|
|
|
|
|
|
else { |
545
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
546
|
|
|
|
|
|
|
} |
547
|
|
|
|
|
|
|
|
548
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID /; |
549
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
550
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
551
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
} |
554
|
|
|
|
|
|
|
|
555
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
556
|
|
|
|
|
|
|
} |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
=head2 albums_get |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
Calls smugmug.albums.get. |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
Parameters: |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
=over |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
=item NickName (string) |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
=item Heavy (boolean) |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
=item SitePassword (string) |
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
=item ShareGroup () |
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
=back |
575
|
|
|
|
|
|
|
|
576
|
|
|
|
|
|
|
=cut |
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
sub albums_get { |
579
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
580
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.get'; |
581
|
0
|
|
|
|
|
|
my $params; |
582
|
|
|
|
|
|
|
|
583
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
584
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
585
|
|
|
|
|
|
|
} |
586
|
|
|
|
|
|
|
else { |
587
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
|
590
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName Heavy SitePassword ShareGroup /; |
591
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
592
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
593
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
594
|
|
|
|
|
|
|
} |
595
|
|
|
|
|
|
|
} |
596
|
|
|
|
|
|
|
|
597
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
598
|
|
|
|
|
|
|
} |
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
=head2 albums_getInfo |
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
Calls smugmug.albums.getInfo. |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
Parameters: |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
=over |
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
=item AlbumID (string) (required) |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
=item Password (string) |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=item SitePassword (string) |
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
=item AlbumKey (string) |
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
=back |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
=cut |
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
sub albums_getInfo { |
621
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
622
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.getInfo'; |
623
|
0
|
|
|
|
|
|
my $params; |
624
|
|
|
|
|
|
|
|
625
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
626
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
627
|
|
|
|
|
|
|
} |
628
|
|
|
|
|
|
|
else { |
629
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
630
|
|
|
|
|
|
|
} |
631
|
|
|
|
|
|
|
|
632
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID /; |
633
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
634
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
635
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
} |
638
|
|
|
|
|
|
|
|
639
|
0
|
|
|
|
|
|
my @optional_params = qw/Password SitePassword AlbumKey /; |
640
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
641
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
642
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
643
|
|
|
|
|
|
|
} |
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
|
646
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
647
|
|
|
|
|
|
|
} |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=head2 albums_getStats |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
Calls smugmug.albums.getStats. |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
Parameters: |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
=over |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
=item Month (integer) (required) |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
=item Year (integer) (required) |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
=item Heavy (boolean) |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
=back |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=cut |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
sub albums_getStats { |
670
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
671
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.getStats'; |
672
|
0
|
|
|
|
|
|
my $params; |
673
|
|
|
|
|
|
|
|
674
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
675
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
else { |
678
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
|
681
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID Month Year /; |
682
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
683
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
684
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
685
|
|
|
|
|
|
|
} |
686
|
|
|
|
|
|
|
} |
687
|
|
|
|
|
|
|
|
688
|
0
|
|
|
|
|
|
my @optional_params = qw/Heavy /; |
689
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
690
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
691
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
} |
694
|
|
|
|
|
|
|
|
695
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
696
|
|
|
|
|
|
|
} |
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
=head2 albums_removeWatermark |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
Calls smugmug.albums.removeWatermark. |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
Parameters: |
703
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
=over |
705
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
=back |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
=cut |
711
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
sub albums_removeWatermark { |
713
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
714
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.removeWatermark'; |
715
|
0
|
|
|
|
|
|
my $params; |
716
|
|
|
|
|
|
|
|
717
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
718
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
else { |
721
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
722
|
|
|
|
|
|
|
} |
723
|
|
|
|
|
|
|
|
724
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID /; |
725
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
726
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
727
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
728
|
|
|
|
|
|
|
} |
729
|
|
|
|
|
|
|
} |
730
|
|
|
|
|
|
|
|
731
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
732
|
|
|
|
|
|
|
} |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
=head2 albums_reSort |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
Calls smugmug.albums.reSort. |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
Parameters: |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
=over |
741
|
|
|
|
|
|
|
|
742
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
743
|
|
|
|
|
|
|
|
744
|
|
|
|
|
|
|
=item By (string) (required) |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
=item Direction (string) (required) |
747
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
=back |
749
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
=cut |
751
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
sub albums_reSort { |
753
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
754
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albums.reSort'; |
755
|
0
|
|
|
|
|
|
my $params; |
756
|
|
|
|
|
|
|
|
757
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
758
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
else { |
761
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
762
|
|
|
|
|
|
|
} |
763
|
|
|
|
|
|
|
|
764
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID By Direction /; |
765
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
766
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
767
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
|
771
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
=head2 albumtemplates_changeSettings |
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
Calls smugmug.albumtemplates.changeSettings. |
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
Parameters: |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
=over |
781
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
=item AlbumTemplateID (integer) (required) |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
=item Name (string) |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
=item HighlightID (integer) |
787
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
=item SortMethod (string) |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
=item SortDirection (boolean) |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
=item Public (boolean) |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
=item Password (string) |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
=item PasswordHint (string) |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
=item Printable (boolean) |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
=item Filenames (boolean) |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
=item Comments (boolean) |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
=item External (boolean) |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
=item Originals (boolean) |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
=item EXIF (boolean) |
809
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
=item Share (boolean) |
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
=item Header (boolean) |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
=item Larges (boolean) |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
=item XLarges (boolean) |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
=item X2Larges (boolean) |
819
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
=item X3Larges (boolean) |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
=item Clean (boolean) |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
=item Protected (boolean) |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
=item Watermarking (boolean) |
827
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
=item FamilyEdit (boolean) |
829
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
=item FriendEdit (boolean) |
831
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
=item HideOwner (boolean) |
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
=item DefaultColor (boolean) |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
=item Geography (boolean) |
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
=item CanRank (boolean) |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
=item ProofDays (integer) |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
=item Backprinting (string) |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
=item SmugSearchable (boolean) |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
=item UnsharpAmount (float) |
847
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
=item UnsharpRadius (float) |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
=item UnsharpThreshold (float) |
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
=item UnsharpSigma (float) |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
=item WorldSearchable (boolean) |
855
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
=item TemplateID (integer) |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
=item CommunityID (integer) |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
=item WatermarkID (integer) |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
=back |
863
|
|
|
|
|
|
|
|
864
|
|
|
|
|
|
|
=cut |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
sub albumtemplates_changeSettings { |
867
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
868
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albumtemplates.changeSettings'; |
869
|
0
|
|
|
|
|
|
my $params; |
870
|
|
|
|
|
|
|
|
871
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
872
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
873
|
|
|
|
|
|
|
} |
874
|
|
|
|
|
|
|
else { |
875
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
876
|
|
|
|
|
|
|
} |
877
|
|
|
|
|
|
|
|
878
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumTemplateID /; |
879
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
880
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
881
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
882
|
|
|
|
|
|
|
} |
883
|
|
|
|
|
|
|
} |
884
|
|
|
|
|
|
|
|
885
|
0
|
|
|
|
|
|
my @optional_params = qw/Name HighlightID SortMethod SortDirection Public Password PasswordHint Printable Filenames Comments External Originals EXIF Share Header Larges XLarges X2Larges X3Larges Clean Protected Watermarking FamilyEdit FriendEdit HideOwner DefaultColor Geography CanRank ProofDays Backprinting SmugSearchable UnsharpAmount UnsharpRadius UnsharpThreshold UnsharpSigma WorldSearchable TemplateID CommunityID WatermarkID /; |
886
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
887
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
888
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
} |
891
|
|
|
|
|
|
|
|
892
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
893
|
|
|
|
|
|
|
} |
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
=head2 albumtemplates_create |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
Calls smugmug.albumtemplates.create. |
898
|
|
|
|
|
|
|
|
899
|
|
|
|
|
|
|
Parameters: |
900
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
=over |
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
=item Name (string) |
904
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
=item HighlightID (integer) |
906
|
|
|
|
|
|
|
|
907
|
|
|
|
|
|
|
=item SortMethod (string) |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
=item SortDirection (boolean) |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
=item Public (boolean) |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
=item Password (string) |
914
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
=item PasswordHint (string) |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
=item Printable (boolean) |
918
|
|
|
|
|
|
|
|
919
|
|
|
|
|
|
|
=item Filenames (boolean) |
920
|
|
|
|
|
|
|
|
921
|
|
|
|
|
|
|
=item Comments (boolean) |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
=item External (boolean) |
924
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
=item Originals (boolean) |
926
|
|
|
|
|
|
|
|
927
|
|
|
|
|
|
|
=item EXIF (boolean) |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
=item Share (boolean) |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
=item Header (boolean) |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
=item Larges (boolean) |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
=item XLarges (boolean) |
936
|
|
|
|
|
|
|
|
937
|
|
|
|
|
|
|
=item X2Larges (boolean) |
938
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
=item X3Larges (boolean) |
940
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
=item Clean (boolean) |
942
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
=item Protected (boolean) |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
=item Watermarking (boolean) |
946
|
|
|
|
|
|
|
|
947
|
|
|
|
|
|
|
=item FamilyEdit (boolean) |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
=item FriendEdit (boolean) |
950
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
=item HideOwner (boolean) |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
=item DefaultColor (boolean) |
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
=item Geography (boolean) |
956
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
=item CanRank (boolean) |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
=item ProofDays (integer) |
960
|
|
|
|
|
|
|
|
961
|
|
|
|
|
|
|
=item Backprinting (string) |
962
|
|
|
|
|
|
|
|
963
|
|
|
|
|
|
|
=item SmugSearchable (boolean) |
964
|
|
|
|
|
|
|
|
965
|
|
|
|
|
|
|
=item UnsharpAmount (float) |
966
|
|
|
|
|
|
|
|
967
|
|
|
|
|
|
|
=item UnsharpRadius (float) |
968
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
=item UnsharpThreshold (float) |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
=item UnsharpSigma (float) |
972
|
|
|
|
|
|
|
|
973
|
|
|
|
|
|
|
=item WorldSearchable (boolean) |
974
|
|
|
|
|
|
|
|
975
|
|
|
|
|
|
|
=item TemplateID (integer) |
976
|
|
|
|
|
|
|
|
977
|
|
|
|
|
|
|
=item CommunityID (integer) |
978
|
|
|
|
|
|
|
|
979
|
|
|
|
|
|
|
=item WatermarkID (integer) |
980
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
=back |
982
|
|
|
|
|
|
|
|
983
|
|
|
|
|
|
|
=cut |
984
|
|
|
|
|
|
|
|
985
|
|
|
|
|
|
|
sub albumtemplates_create { |
986
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
987
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albumtemplates.create'; |
988
|
0
|
|
|
|
|
|
my $params; |
989
|
|
|
|
|
|
|
|
990
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
991
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
992
|
|
|
|
|
|
|
} |
993
|
|
|
|
|
|
|
else { |
994
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
|
997
|
0
|
|
|
|
|
|
my @optional_params = qw/Name HighlightID SortMethod SortDirection Public Password PasswordHint Printable Filenames Comments External Originals EXIF Share Header Larges XLarges X2Larges X3Larges Clean Protected Watermarking FamilyEdit FriendEdit HideOwner DefaultColor Geography CanRank ProofDays Backprinting SmugSearchable UnsharpAmount UnsharpRadius UnsharpThreshold UnsharpSigma WorldSearchable TemplateID CommunityID WatermarkID /; |
998
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
999
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1000
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1001
|
|
|
|
|
|
|
} |
1002
|
|
|
|
|
|
|
} |
1003
|
|
|
|
|
|
|
|
1004
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1005
|
|
|
|
|
|
|
} |
1006
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
=head2 albumtemplates_get |
1008
|
|
|
|
|
|
|
|
1009
|
|
|
|
|
|
|
Calls smugmug.albumtemplates.get. |
1010
|
|
|
|
|
|
|
|
1011
|
|
|
|
|
|
|
Parameters: |
1012
|
|
|
|
|
|
|
|
1013
|
|
|
|
|
|
|
=over |
1014
|
|
|
|
|
|
|
|
1015
|
|
|
|
|
|
|
No parameters |
1016
|
|
|
|
|
|
|
|
1017
|
|
|
|
|
|
|
=back |
1018
|
|
|
|
|
|
|
|
1019
|
|
|
|
|
|
|
=cut |
1020
|
|
|
|
|
|
|
|
1021
|
|
|
|
|
|
|
sub albumtemplates_get { |
1022
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1023
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.albumtemplates.get'; |
1024
|
0
|
|
|
|
|
|
my $params; |
1025
|
|
|
|
|
|
|
|
1026
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1027
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1028
|
|
|
|
|
|
|
} |
1029
|
|
|
|
|
|
|
else { |
1030
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1031
|
|
|
|
|
|
|
} |
1032
|
|
|
|
|
|
|
|
1033
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1034
|
|
|
|
|
|
|
} |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
=head2 categories_create |
1037
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
Calls smugmug.categories.create. |
1039
|
|
|
|
|
|
|
|
1040
|
|
|
|
|
|
|
Parameters: |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
=over |
1043
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
=item Name (string) (required) |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
=back |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
=cut |
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
sub categories_create { |
1051
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1052
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.categories.create'; |
1053
|
0
|
|
|
|
|
|
my $params; |
1054
|
|
|
|
|
|
|
|
1055
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1056
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1057
|
|
|
|
|
|
|
} |
1058
|
|
|
|
|
|
|
else { |
1059
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1060
|
|
|
|
|
|
|
} |
1061
|
|
|
|
|
|
|
|
1062
|
0
|
|
|
|
|
|
my @mandatory_params = qw/Name /; |
1063
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1064
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1065
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1066
|
|
|
|
|
|
|
} |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
|
1069
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1070
|
|
|
|
|
|
|
} |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
=head2 categories_delete |
1073
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
Calls smugmug.categories.delete. |
1075
|
|
|
|
|
|
|
|
1076
|
|
|
|
|
|
|
Parameters: |
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
=over |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
=item CategoryID (integer) (required) |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
=back |
1083
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
=cut |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
sub categories_delete { |
1087
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1088
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.categories.delete'; |
1089
|
0
|
|
|
|
|
|
my $params; |
1090
|
|
|
|
|
|
|
|
1091
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1092
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1093
|
|
|
|
|
|
|
} |
1094
|
|
|
|
|
|
|
else { |
1095
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1096
|
|
|
|
|
|
|
} |
1097
|
|
|
|
|
|
|
|
1098
|
0
|
|
|
|
|
|
my @mandatory_params = qw/CategoryID /; |
1099
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1100
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1101
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1102
|
|
|
|
|
|
|
} |
1103
|
|
|
|
|
|
|
} |
1104
|
|
|
|
|
|
|
|
1105
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1106
|
|
|
|
|
|
|
} |
1107
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
=head2 categories_get |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
Calls smugmug.categories.get. |
1111
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
Parameters: |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
=over |
1115
|
|
|
|
|
|
|
|
1116
|
|
|
|
|
|
|
=item NickName (string) |
1117
|
|
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
=item SitePassword (string) |
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
=back |
1121
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
=cut |
1123
|
|
|
|
|
|
|
|
1124
|
|
|
|
|
|
|
sub categories_get { |
1125
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1126
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.categories.get'; |
1127
|
0
|
|
|
|
|
|
my $params; |
1128
|
|
|
|
|
|
|
|
1129
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1130
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1131
|
|
|
|
|
|
|
} |
1132
|
|
|
|
|
|
|
else { |
1133
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1134
|
|
|
|
|
|
|
} |
1135
|
|
|
|
|
|
|
|
1136
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName SitePassword /; |
1137
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1138
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1139
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1140
|
|
|
|
|
|
|
} |
1141
|
|
|
|
|
|
|
} |
1142
|
|
|
|
|
|
|
|
1143
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1144
|
|
|
|
|
|
|
} |
1145
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
=head2 categories_rename |
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
Calls smugmug.categories.rename. |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
Parameters: |
1151
|
|
|
|
|
|
|
|
1152
|
|
|
|
|
|
|
=over |
1153
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
=item CategoryID (integer) (required) |
1155
|
|
|
|
|
|
|
|
1156
|
|
|
|
|
|
|
=item Name (string) (required) |
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
=back |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
=cut |
1161
|
|
|
|
|
|
|
|
1162
|
|
|
|
|
|
|
sub categories_rename { |
1163
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1164
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.categories.rename'; |
1165
|
0
|
|
|
|
|
|
my $params; |
1166
|
|
|
|
|
|
|
|
1167
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1168
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1169
|
|
|
|
|
|
|
} |
1170
|
|
|
|
|
|
|
else { |
1171
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1172
|
|
|
|
|
|
|
} |
1173
|
|
|
|
|
|
|
|
1174
|
0
|
|
|
|
|
|
my @mandatory_params = qw/CategoryID Name /; |
1175
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1176
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1177
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1178
|
|
|
|
|
|
|
} |
1179
|
|
|
|
|
|
|
} |
1180
|
|
|
|
|
|
|
|
1181
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1182
|
|
|
|
|
|
|
} |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
=head2 family_add |
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
Calls smugmug.family.add. |
1187
|
|
|
|
|
|
|
|
1188
|
|
|
|
|
|
|
Parameters: |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
=over |
1191
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
=item NickName (string) (required) |
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
=back |
1195
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
=cut |
1197
|
|
|
|
|
|
|
|
1198
|
|
|
|
|
|
|
sub family_add { |
1199
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1200
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.family.add'; |
1201
|
0
|
|
|
|
|
|
my $params; |
1202
|
|
|
|
|
|
|
|
1203
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1204
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1205
|
|
|
|
|
|
|
} |
1206
|
|
|
|
|
|
|
else { |
1207
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1208
|
|
|
|
|
|
|
} |
1209
|
|
|
|
|
|
|
|
1210
|
0
|
|
|
|
|
|
my @mandatory_params = qw/NickName /; |
1211
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1212
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1213
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1214
|
|
|
|
|
|
|
} |
1215
|
|
|
|
|
|
|
} |
1216
|
|
|
|
|
|
|
|
1217
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1218
|
|
|
|
|
|
|
} |
1219
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
=head2 family_get |
1221
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
Calls smugmug.family.get. |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
Parameters: |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
=over |
1227
|
|
|
|
|
|
|
|
1228
|
|
|
|
|
|
|
No parameters |
1229
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
=back |
1231
|
|
|
|
|
|
|
|
1232
|
|
|
|
|
|
|
=cut |
1233
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
sub family_get { |
1235
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1236
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.family.get'; |
1237
|
0
|
|
|
|
|
|
my $params; |
1238
|
|
|
|
|
|
|
|
1239
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1240
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1241
|
|
|
|
|
|
|
} |
1242
|
|
|
|
|
|
|
else { |
1243
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1244
|
|
|
|
|
|
|
} |
1245
|
|
|
|
|
|
|
|
1246
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1247
|
|
|
|
|
|
|
} |
1248
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
=head2 family_remove |
1250
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
Calls smugmug.family.remove. |
1252
|
|
|
|
|
|
|
|
1253
|
|
|
|
|
|
|
Parameters: |
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
=over |
1256
|
|
|
|
|
|
|
|
1257
|
|
|
|
|
|
|
=item NickName (string) (required) |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
=back |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
=cut |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
sub family_remove { |
1264
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1265
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.family.remove'; |
1266
|
0
|
|
|
|
|
|
my $params; |
1267
|
|
|
|
|
|
|
|
1268
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1269
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1270
|
|
|
|
|
|
|
} |
1271
|
|
|
|
|
|
|
else { |
1272
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1273
|
|
|
|
|
|
|
} |
1274
|
|
|
|
|
|
|
|
1275
|
0
|
|
|
|
|
|
my @mandatory_params = qw/NickName /; |
1276
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1277
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1278
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1279
|
|
|
|
|
|
|
} |
1280
|
|
|
|
|
|
|
} |
1281
|
|
|
|
|
|
|
|
1282
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1283
|
|
|
|
|
|
|
} |
1284
|
|
|
|
|
|
|
|
1285
|
|
|
|
|
|
|
=head2 family_removeAll |
1286
|
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
|
Calls smugmug.family.removeAll. |
1288
|
|
|
|
|
|
|
|
1289
|
|
|
|
|
|
|
Parameters: |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
=over |
1292
|
|
|
|
|
|
|
|
1293
|
|
|
|
|
|
|
No parameters |
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
=back |
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
=cut |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
sub family_removeAll { |
1300
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1301
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.family.removeAll'; |
1302
|
0
|
|
|
|
|
|
my $params; |
1303
|
|
|
|
|
|
|
|
1304
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1305
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1306
|
|
|
|
|
|
|
} |
1307
|
|
|
|
|
|
|
else { |
1308
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1309
|
|
|
|
|
|
|
} |
1310
|
|
|
|
|
|
|
|
1311
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1312
|
|
|
|
|
|
|
} |
1313
|
|
|
|
|
|
|
|
1314
|
|
|
|
|
|
|
=head2 friends_add |
1315
|
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
|
Calls smugmug.friends.add. |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
Parameters: |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
=over |
1321
|
|
|
|
|
|
|
|
1322
|
|
|
|
|
|
|
=item NickName (string) (required) |
1323
|
|
|
|
|
|
|
|
1324
|
|
|
|
|
|
|
=back |
1325
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
=cut |
1327
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
sub friends_add { |
1329
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1330
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.friends.add'; |
1331
|
0
|
|
|
|
|
|
my $params; |
1332
|
|
|
|
|
|
|
|
1333
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1334
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1335
|
|
|
|
|
|
|
} |
1336
|
|
|
|
|
|
|
else { |
1337
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1338
|
|
|
|
|
|
|
} |
1339
|
|
|
|
|
|
|
|
1340
|
0
|
|
|
|
|
|
my @mandatory_params = qw/NickName /; |
1341
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1342
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1343
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1344
|
|
|
|
|
|
|
} |
1345
|
|
|
|
|
|
|
} |
1346
|
|
|
|
|
|
|
|
1347
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1348
|
|
|
|
|
|
|
} |
1349
|
|
|
|
|
|
|
|
1350
|
|
|
|
|
|
|
=head2 friends_get |
1351
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
Calls smugmug.friends.get. |
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
Parameters: |
1355
|
|
|
|
|
|
|
|
1356
|
|
|
|
|
|
|
=over |
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
No parameters |
1359
|
|
|
|
|
|
|
|
1360
|
|
|
|
|
|
|
=back |
1361
|
|
|
|
|
|
|
|
1362
|
|
|
|
|
|
|
=cut |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
sub friends_get { |
1365
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1366
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.friends.get'; |
1367
|
0
|
|
|
|
|
|
my $params; |
1368
|
|
|
|
|
|
|
|
1369
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1370
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
else { |
1373
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1374
|
|
|
|
|
|
|
} |
1375
|
|
|
|
|
|
|
|
1376
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1377
|
|
|
|
|
|
|
} |
1378
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
=head2 friends_remove |
1380
|
|
|
|
|
|
|
|
1381
|
|
|
|
|
|
|
Calls smugmug.friends.remove. |
1382
|
|
|
|
|
|
|
|
1383
|
|
|
|
|
|
|
Parameters: |
1384
|
|
|
|
|
|
|
|
1385
|
|
|
|
|
|
|
=over |
1386
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
=item NickName (string) (required) |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
=back |
1390
|
|
|
|
|
|
|
|
1391
|
|
|
|
|
|
|
=cut |
1392
|
|
|
|
|
|
|
|
1393
|
|
|
|
|
|
|
sub friends_remove { |
1394
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1395
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.friends.remove'; |
1396
|
0
|
|
|
|
|
|
my $params; |
1397
|
|
|
|
|
|
|
|
1398
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1399
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1400
|
|
|
|
|
|
|
} |
1401
|
|
|
|
|
|
|
else { |
1402
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1403
|
|
|
|
|
|
|
} |
1404
|
|
|
|
|
|
|
|
1405
|
0
|
|
|
|
|
|
my @mandatory_params = qw/NickName /; |
1406
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1407
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1408
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1409
|
|
|
|
|
|
|
} |
1410
|
|
|
|
|
|
|
} |
1411
|
|
|
|
|
|
|
|
1412
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1413
|
|
|
|
|
|
|
} |
1414
|
|
|
|
|
|
|
|
1415
|
|
|
|
|
|
|
=head2 friends_removeAll |
1416
|
|
|
|
|
|
|
|
1417
|
|
|
|
|
|
|
Calls smugmug.friends.removeAll. |
1418
|
|
|
|
|
|
|
|
1419
|
|
|
|
|
|
|
Parameters: |
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
=over |
1422
|
|
|
|
|
|
|
|
1423
|
|
|
|
|
|
|
No parameters |
1424
|
|
|
|
|
|
|
|
1425
|
|
|
|
|
|
|
=back |
1426
|
|
|
|
|
|
|
|
1427
|
|
|
|
|
|
|
=cut |
1428
|
|
|
|
|
|
|
|
1429
|
|
|
|
|
|
|
sub friends_removeAll { |
1430
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1431
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.friends.removeAll'; |
1432
|
0
|
|
|
|
|
|
my $params; |
1433
|
|
|
|
|
|
|
|
1434
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1435
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1436
|
|
|
|
|
|
|
} |
1437
|
|
|
|
|
|
|
else { |
1438
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1439
|
|
|
|
|
|
|
} |
1440
|
|
|
|
|
|
|
|
1441
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1442
|
|
|
|
|
|
|
} |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
=head2 images_applyWatermark |
1445
|
|
|
|
|
|
|
|
1446
|
|
|
|
|
|
|
Calls smugmug.images.applyWatermark. |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
Parameters: |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
=over |
1451
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
=item WatermarkID (integer) (required) |
1455
|
|
|
|
|
|
|
|
1456
|
|
|
|
|
|
|
=back |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
=cut |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
sub images_applyWatermark { |
1461
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1462
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.applyWatermark'; |
1463
|
0
|
|
|
|
|
|
my $params; |
1464
|
|
|
|
|
|
|
|
1465
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1466
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1467
|
|
|
|
|
|
|
} |
1468
|
|
|
|
|
|
|
else { |
1469
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1470
|
|
|
|
|
|
|
} |
1471
|
|
|
|
|
|
|
|
1472
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID WatermarkID /; |
1473
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1474
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1475
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1476
|
|
|
|
|
|
|
} |
1477
|
|
|
|
|
|
|
} |
1478
|
|
|
|
|
|
|
|
1479
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1480
|
|
|
|
|
|
|
} |
1481
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
=head2 images_changePosition |
1483
|
|
|
|
|
|
|
|
1484
|
|
|
|
|
|
|
Calls smugmug.images.changePosition. |
1485
|
|
|
|
|
|
|
|
1486
|
|
|
|
|
|
|
Parameters: |
1487
|
|
|
|
|
|
|
|
1488
|
|
|
|
|
|
|
=over |
1489
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1491
|
|
|
|
|
|
|
|
1492
|
|
|
|
|
|
|
=item Position (integer) (required) |
1493
|
|
|
|
|
|
|
|
1494
|
|
|
|
|
|
|
=back |
1495
|
|
|
|
|
|
|
|
1496
|
|
|
|
|
|
|
=cut |
1497
|
|
|
|
|
|
|
|
1498
|
|
|
|
|
|
|
sub images_changePosition { |
1499
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1500
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.changePosition'; |
1501
|
0
|
|
|
|
|
|
my $params; |
1502
|
|
|
|
|
|
|
|
1503
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1504
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1505
|
|
|
|
|
|
|
} |
1506
|
|
|
|
|
|
|
else { |
1507
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1508
|
|
|
|
|
|
|
} |
1509
|
|
|
|
|
|
|
|
1510
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID Position /; |
1511
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1512
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1513
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1514
|
|
|
|
|
|
|
} |
1515
|
|
|
|
|
|
|
} |
1516
|
|
|
|
|
|
|
|
1517
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1518
|
|
|
|
|
|
|
} |
1519
|
|
|
|
|
|
|
|
1520
|
|
|
|
|
|
|
=head2 images_changeSettings |
1521
|
|
|
|
|
|
|
|
1522
|
|
|
|
|
|
|
Calls smugmug.images.changeSettings. |
1523
|
|
|
|
|
|
|
|
1524
|
|
|
|
|
|
|
Parameters: |
1525
|
|
|
|
|
|
|
|
1526
|
|
|
|
|
|
|
=over |
1527
|
|
|
|
|
|
|
|
1528
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1529
|
|
|
|
|
|
|
|
1530
|
|
|
|
|
|
|
=item AlbumID (integer) |
1531
|
|
|
|
|
|
|
|
1532
|
|
|
|
|
|
|
=item Caption (string) |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
=item Keywords (string) |
1535
|
|
|
|
|
|
|
|
1536
|
|
|
|
|
|
|
=item Hidden (boolean) |
1537
|
|
|
|
|
|
|
|
1538
|
|
|
|
|
|
|
=back |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
=cut |
1541
|
|
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
sub images_changeSettings { |
1543
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1544
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.changeSettings'; |
1545
|
0
|
|
|
|
|
|
my $params; |
1546
|
|
|
|
|
|
|
|
1547
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1548
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
else { |
1551
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1552
|
|
|
|
|
|
|
} |
1553
|
|
|
|
|
|
|
|
1554
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1555
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1556
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1557
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1558
|
|
|
|
|
|
|
} |
1559
|
|
|
|
|
|
|
} |
1560
|
|
|
|
|
|
|
|
1561
|
0
|
|
|
|
|
|
my @optional_params = qw/AlbumID Caption Keywords Hidden /; |
1562
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1563
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1564
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1565
|
|
|
|
|
|
|
} |
1566
|
|
|
|
|
|
|
} |
1567
|
|
|
|
|
|
|
|
1568
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1569
|
|
|
|
|
|
|
} |
1570
|
|
|
|
|
|
|
|
1571
|
|
|
|
|
|
|
=head2 images_crop |
1572
|
|
|
|
|
|
|
|
1573
|
|
|
|
|
|
|
Calls smugmug.images.crop. |
1574
|
|
|
|
|
|
|
|
1575
|
|
|
|
|
|
|
Parameters: |
1576
|
|
|
|
|
|
|
|
1577
|
|
|
|
|
|
|
=over |
1578
|
|
|
|
|
|
|
|
1579
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1580
|
|
|
|
|
|
|
|
1581
|
|
|
|
|
|
|
=item Width (integer) (required) |
1582
|
|
|
|
|
|
|
|
1583
|
|
|
|
|
|
|
=item Height (integer) (required) |
1584
|
|
|
|
|
|
|
|
1585
|
|
|
|
|
|
|
=item X (integer) (required) |
1586
|
|
|
|
|
|
|
|
1587
|
|
|
|
|
|
|
=item Y (integer) (required) |
1588
|
|
|
|
|
|
|
|
1589
|
|
|
|
|
|
|
=back |
1590
|
|
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
=cut |
1592
|
|
|
|
|
|
|
|
1593
|
|
|
|
|
|
|
sub images_crop { |
1594
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1595
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.crop'; |
1596
|
0
|
|
|
|
|
|
my $params; |
1597
|
|
|
|
|
|
|
|
1598
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1599
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1600
|
|
|
|
|
|
|
} |
1601
|
|
|
|
|
|
|
else { |
1602
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1603
|
|
|
|
|
|
|
} |
1604
|
|
|
|
|
|
|
|
1605
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID Width Height X Y /; |
1606
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1607
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1608
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1609
|
|
|
|
|
|
|
} |
1610
|
|
|
|
|
|
|
} |
1611
|
|
|
|
|
|
|
|
1612
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1613
|
|
|
|
|
|
|
} |
1614
|
|
|
|
|
|
|
|
1615
|
|
|
|
|
|
|
=head2 images_delete |
1616
|
|
|
|
|
|
|
|
1617
|
|
|
|
|
|
|
Calls smugmug.images.delete. |
1618
|
|
|
|
|
|
|
|
1619
|
|
|
|
|
|
|
Parameters: |
1620
|
|
|
|
|
|
|
|
1621
|
|
|
|
|
|
|
=over |
1622
|
|
|
|
|
|
|
|
1623
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1624
|
|
|
|
|
|
|
|
1625
|
|
|
|
|
|
|
=back |
1626
|
|
|
|
|
|
|
|
1627
|
|
|
|
|
|
|
=cut |
1628
|
|
|
|
|
|
|
|
1629
|
|
|
|
|
|
|
sub images_delete { |
1630
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1631
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.delete'; |
1632
|
0
|
|
|
|
|
|
my $params; |
1633
|
|
|
|
|
|
|
|
1634
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1635
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1636
|
|
|
|
|
|
|
} |
1637
|
|
|
|
|
|
|
else { |
1638
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1639
|
|
|
|
|
|
|
} |
1640
|
|
|
|
|
|
|
|
1641
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1642
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1643
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1644
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1645
|
|
|
|
|
|
|
} |
1646
|
|
|
|
|
|
|
} |
1647
|
|
|
|
|
|
|
|
1648
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1649
|
|
|
|
|
|
|
} |
1650
|
|
|
|
|
|
|
|
1651
|
|
|
|
|
|
|
=head2 images_get |
1652
|
|
|
|
|
|
|
|
1653
|
|
|
|
|
|
|
Calls smugmug.images.get. |
1654
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
Parameters: |
1656
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
=over |
1658
|
|
|
|
|
|
|
|
1659
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
1660
|
|
|
|
|
|
|
|
1661
|
|
|
|
|
|
|
=item Heavy (boolean) |
1662
|
|
|
|
|
|
|
|
1663
|
|
|
|
|
|
|
=item Password (string) |
1664
|
|
|
|
|
|
|
|
1665
|
|
|
|
|
|
|
=item SitePassword (string) |
1666
|
|
|
|
|
|
|
|
1667
|
|
|
|
|
|
|
=item AlbumKey (string) (required) |
1668
|
|
|
|
|
|
|
|
1669
|
|
|
|
|
|
|
=back |
1670
|
|
|
|
|
|
|
|
1671
|
|
|
|
|
|
|
=cut |
1672
|
|
|
|
|
|
|
|
1673
|
|
|
|
|
|
|
sub images_get { |
1674
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1675
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.get'; |
1676
|
0
|
|
|
|
|
|
my $params; |
1677
|
|
|
|
|
|
|
|
1678
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1679
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1680
|
|
|
|
|
|
|
} |
1681
|
|
|
|
|
|
|
else { |
1682
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1683
|
|
|
|
|
|
|
} |
1684
|
|
|
|
|
|
|
|
1685
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID AlbumKey /; |
1686
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1687
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1688
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1689
|
|
|
|
|
|
|
} |
1690
|
|
|
|
|
|
|
} |
1691
|
|
|
|
|
|
|
|
1692
|
0
|
|
|
|
|
|
my @optional_params = qw/Heavy Password SitePassword /; |
1693
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1694
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1695
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1696
|
|
|
|
|
|
|
} |
1697
|
|
|
|
|
|
|
} |
1698
|
|
|
|
|
|
|
|
1699
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1700
|
|
|
|
|
|
|
} |
1701
|
|
|
|
|
|
|
|
1702
|
|
|
|
|
|
|
=head2 images_getEXIF |
1703
|
|
|
|
|
|
|
|
1704
|
|
|
|
|
|
|
Calls smugmug.images.getEXIF. |
1705
|
|
|
|
|
|
|
|
1706
|
|
|
|
|
|
|
Parameters: |
1707
|
|
|
|
|
|
|
|
1708
|
|
|
|
|
|
|
=over |
1709
|
|
|
|
|
|
|
|
1710
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1711
|
|
|
|
|
|
|
|
1712
|
|
|
|
|
|
|
=item Password (string) |
1713
|
|
|
|
|
|
|
|
1714
|
|
|
|
|
|
|
=item SitePassword (string) |
1715
|
|
|
|
|
|
|
|
1716
|
|
|
|
|
|
|
=item ImageKey (string) |
1717
|
|
|
|
|
|
|
|
1718
|
|
|
|
|
|
|
=back |
1719
|
|
|
|
|
|
|
|
1720
|
|
|
|
|
|
|
=cut |
1721
|
|
|
|
|
|
|
|
1722
|
|
|
|
|
|
|
sub images_getEXIF { |
1723
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1724
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.getEXIF'; |
1725
|
0
|
|
|
|
|
|
my $params; |
1726
|
|
|
|
|
|
|
|
1727
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1728
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1729
|
|
|
|
|
|
|
} |
1730
|
|
|
|
|
|
|
else { |
1731
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1732
|
|
|
|
|
|
|
} |
1733
|
|
|
|
|
|
|
|
1734
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1735
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1736
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1737
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1738
|
|
|
|
|
|
|
} |
1739
|
|
|
|
|
|
|
} |
1740
|
|
|
|
|
|
|
|
1741
|
0
|
|
|
|
|
|
my @optional_params = qw/Password SitePassword ImageKey /; |
1742
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1743
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1744
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1745
|
|
|
|
|
|
|
} |
1746
|
|
|
|
|
|
|
} |
1747
|
|
|
|
|
|
|
|
1748
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1749
|
|
|
|
|
|
|
} |
1750
|
|
|
|
|
|
|
|
1751
|
|
|
|
|
|
|
=head2 images_getInfo |
1752
|
|
|
|
|
|
|
|
1753
|
|
|
|
|
|
|
Calls smugmug.images.getInfo. |
1754
|
|
|
|
|
|
|
|
1755
|
|
|
|
|
|
|
Parameters: |
1756
|
|
|
|
|
|
|
|
1757
|
|
|
|
|
|
|
=over |
1758
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1760
|
|
|
|
|
|
|
|
1761
|
|
|
|
|
|
|
=item Password (string) |
1762
|
|
|
|
|
|
|
|
1763
|
|
|
|
|
|
|
=item SitePassword (string) |
1764
|
|
|
|
|
|
|
|
1765
|
|
|
|
|
|
|
=item ImageKey (string) |
1766
|
|
|
|
|
|
|
|
1767
|
|
|
|
|
|
|
=back |
1768
|
|
|
|
|
|
|
|
1769
|
|
|
|
|
|
|
=cut |
1770
|
|
|
|
|
|
|
|
1771
|
|
|
|
|
|
|
sub images_getInfo { |
1772
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1773
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.getInfo'; |
1774
|
0
|
|
|
|
|
|
my $params; |
1775
|
|
|
|
|
|
|
|
1776
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1777
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1778
|
|
|
|
|
|
|
} |
1779
|
|
|
|
|
|
|
else { |
1780
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1781
|
|
|
|
|
|
|
} |
1782
|
|
|
|
|
|
|
|
1783
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1784
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1785
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1786
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1787
|
|
|
|
|
|
|
} |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
|
1790
|
0
|
|
|
|
|
|
my @optional_params = qw/Password SitePassword ImageKey /; |
1791
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1792
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1793
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1794
|
|
|
|
|
|
|
} |
1795
|
|
|
|
|
|
|
} |
1796
|
|
|
|
|
|
|
|
1797
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1798
|
|
|
|
|
|
|
} |
1799
|
|
|
|
|
|
|
|
1800
|
|
|
|
|
|
|
=head2 images_getStats |
1801
|
|
|
|
|
|
|
|
1802
|
|
|
|
|
|
|
Calls smugmug.images.getStats. |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
Parameters: |
1805
|
|
|
|
|
|
|
|
1806
|
|
|
|
|
|
|
=over |
1807
|
|
|
|
|
|
|
|
1808
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1809
|
|
|
|
|
|
|
|
1810
|
|
|
|
|
|
|
=item Month (integer) (required) |
1811
|
|
|
|
|
|
|
|
1812
|
|
|
|
|
|
|
=back |
1813
|
|
|
|
|
|
|
|
1814
|
|
|
|
|
|
|
=cut |
1815
|
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
|
sub images_getStats { |
1817
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1818
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.getStats'; |
1819
|
0
|
|
|
|
|
|
my $params; |
1820
|
|
|
|
|
|
|
|
1821
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1822
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1823
|
|
|
|
|
|
|
} |
1824
|
|
|
|
|
|
|
else { |
1825
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1826
|
|
|
|
|
|
|
} |
1827
|
|
|
|
|
|
|
|
1828
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID Month /; |
1829
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1830
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1831
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1832
|
|
|
|
|
|
|
} |
1833
|
|
|
|
|
|
|
} |
1834
|
|
|
|
|
|
|
|
1835
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1836
|
|
|
|
|
|
|
} |
1837
|
|
|
|
|
|
|
|
1838
|
|
|
|
|
|
|
=head2 images_getURLs |
1839
|
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
Calls smugmug.images.getURLs. |
1841
|
|
|
|
|
|
|
|
1842
|
|
|
|
|
|
|
Parameters: |
1843
|
|
|
|
|
|
|
|
1844
|
|
|
|
|
|
|
=over |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1847
|
|
|
|
|
|
|
|
1848
|
|
|
|
|
|
|
=item TemplateID (integer) |
1849
|
|
|
|
|
|
|
|
1850
|
|
|
|
|
|
|
=item Password (string) |
1851
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
=item SitePassword (string) |
1853
|
|
|
|
|
|
|
|
1854
|
|
|
|
|
|
|
=item ImageKey (string) |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
=back |
1857
|
|
|
|
|
|
|
|
1858
|
|
|
|
|
|
|
=cut |
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
sub images_getURLs { |
1861
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1862
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.getURLs'; |
1863
|
0
|
|
|
|
|
|
my $params; |
1864
|
|
|
|
|
|
|
|
1865
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1866
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1867
|
|
|
|
|
|
|
} |
1868
|
|
|
|
|
|
|
else { |
1869
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1870
|
|
|
|
|
|
|
} |
1871
|
|
|
|
|
|
|
|
1872
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1873
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1874
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1875
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1876
|
|
|
|
|
|
|
} |
1877
|
|
|
|
|
|
|
} |
1878
|
|
|
|
|
|
|
|
1879
|
0
|
|
|
|
|
|
my @optional_params = qw/TemplateID Password SitePassword ImageKey /; |
1880
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1881
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1882
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1883
|
|
|
|
|
|
|
} |
1884
|
|
|
|
|
|
|
} |
1885
|
|
|
|
|
|
|
|
1886
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1887
|
|
|
|
|
|
|
} |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
=head2 images_removeWatermark |
1890
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
Calls smugmug.images.removeWatermark. |
1892
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
Parameters: |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
=over |
1896
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
=back |
1900
|
|
|
|
|
|
|
|
1901
|
|
|
|
|
|
|
=cut |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
sub images_removeWatermark { |
1904
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1905
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.removeWatermark'; |
1906
|
0
|
|
|
|
|
|
my $params; |
1907
|
|
|
|
|
|
|
|
1908
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1909
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1910
|
|
|
|
|
|
|
} |
1911
|
|
|
|
|
|
|
else { |
1912
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1913
|
|
|
|
|
|
|
} |
1914
|
|
|
|
|
|
|
|
1915
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1916
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1917
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1918
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1919
|
|
|
|
|
|
|
} |
1920
|
|
|
|
|
|
|
} |
1921
|
|
|
|
|
|
|
|
1922
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1923
|
|
|
|
|
|
|
} |
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
=head2 images_rotate |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
Calls smugmug.images.rotate. |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
Parameters: |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
=over |
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
=item Degrees (integer) |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
=item Flip (boolean) |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
=back |
1940
|
|
|
|
|
|
|
|
1941
|
|
|
|
|
|
|
=cut |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
sub images_rotate { |
1944
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1945
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.rotate'; |
1946
|
0
|
|
|
|
|
|
my $params; |
1947
|
|
|
|
|
|
|
|
1948
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
1949
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
1950
|
|
|
|
|
|
|
} |
1951
|
|
|
|
|
|
|
else { |
1952
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
1953
|
|
|
|
|
|
|
} |
1954
|
|
|
|
|
|
|
|
1955
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
1956
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
1957
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
1958
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
1959
|
|
|
|
|
|
|
} |
1960
|
|
|
|
|
|
|
} |
1961
|
|
|
|
|
|
|
|
1962
|
0
|
|
|
|
|
|
my @optional_params = qw/Degrees Flip /; |
1963
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
1964
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
1965
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
1966
|
|
|
|
|
|
|
} |
1967
|
|
|
|
|
|
|
} |
1968
|
|
|
|
|
|
|
|
1969
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
1970
|
|
|
|
|
|
|
} |
1971
|
|
|
|
|
|
|
|
1972
|
|
|
|
|
|
|
=head2 images_zoomThumbnail |
1973
|
|
|
|
|
|
|
|
1974
|
|
|
|
|
|
|
Calls smugmug.images.zoomThumbnail. |
1975
|
|
|
|
|
|
|
|
1976
|
|
|
|
|
|
|
Parameters: |
1977
|
|
|
|
|
|
|
|
1978
|
|
|
|
|
|
|
=over |
1979
|
|
|
|
|
|
|
|
1980
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
1981
|
|
|
|
|
|
|
|
1982
|
|
|
|
|
|
|
=item Width (integer) (required) |
1983
|
|
|
|
|
|
|
|
1984
|
|
|
|
|
|
|
=item Height (integer) (required) |
1985
|
|
|
|
|
|
|
|
1986
|
|
|
|
|
|
|
=item X (integer) (required) |
1987
|
|
|
|
|
|
|
|
1988
|
|
|
|
|
|
|
=item Y (integer) (required) |
1989
|
|
|
|
|
|
|
|
1990
|
|
|
|
|
|
|
=back |
1991
|
|
|
|
|
|
|
|
1992
|
|
|
|
|
|
|
=cut |
1993
|
|
|
|
|
|
|
|
1994
|
|
|
|
|
|
|
sub images_zoomThumbnail { |
1995
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
1996
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.images.zoomThumbnail'; |
1997
|
0
|
|
|
|
|
|
my $params; |
1998
|
|
|
|
|
|
|
|
1999
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2000
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2001
|
|
|
|
|
|
|
} |
2002
|
|
|
|
|
|
|
else { |
2003
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2004
|
|
|
|
|
|
|
} |
2005
|
|
|
|
|
|
|
|
2006
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID Width Height X Y /; |
2007
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2008
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2009
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
} |
2012
|
|
|
|
|
|
|
|
2013
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2014
|
|
|
|
|
|
|
} |
2015
|
|
|
|
|
|
|
|
2016
|
|
|
|
|
|
|
=head2 login_anonymously |
2017
|
|
|
|
|
|
|
|
2018
|
|
|
|
|
|
|
Calls smugmug.login.anonymously. |
2019
|
|
|
|
|
|
|
|
2020
|
|
|
|
|
|
|
Parameters: |
2021
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
=over |
2023
|
|
|
|
|
|
|
|
2024
|
|
|
|
|
|
|
No parameters |
2025
|
|
|
|
|
|
|
|
2026
|
|
|
|
|
|
|
=back |
2027
|
|
|
|
|
|
|
|
2028
|
|
|
|
|
|
|
=cut |
2029
|
|
|
|
|
|
|
|
2030
|
|
|
|
|
|
|
sub login_anonymously { |
2031
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2032
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.login.anonymously'; |
2033
|
0
|
|
|
|
|
|
my $params; |
2034
|
|
|
|
|
|
|
|
2035
|
0
|
|
|
|
|
|
$params->{APIKey} = $self->{sm_api_key}; |
2036
|
|
|
|
|
|
|
|
2037
|
0
|
|
|
|
|
|
my $result = $self->_get_request($api_method, $params); |
2038
|
0
|
0
|
|
|
|
|
if ($result->{stat} eq 'ok') { |
2039
|
0
|
|
|
|
|
|
$self->{sm_session} = $result->{Login}->{Session}->{id}; |
2040
|
|
|
|
|
|
|
} |
2041
|
|
|
|
|
|
|
|
2042
|
0
|
|
|
|
|
|
return $result; |
2043
|
|
|
|
|
|
|
} |
2044
|
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
|
=head2 login_withHash |
2046
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
Calls smugmug.login.withHash. |
2048
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
Parameters: |
2050
|
|
|
|
|
|
|
|
2051
|
|
|
|
|
|
|
=over |
2052
|
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
|
=item UserID (integer) (required) |
2054
|
|
|
|
|
|
|
|
2055
|
|
|
|
|
|
|
=item PasswordHash (string) (required) |
2056
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
=back |
2058
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
=cut |
2060
|
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
|
sub login_withHash { |
2062
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2063
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.login.withHash'; |
2064
|
0
|
|
|
|
|
|
my $params; |
2065
|
|
|
|
|
|
|
|
2066
|
0
|
|
|
|
|
|
$params->{APIKey} = $self->{sm_api_key}; |
2067
|
|
|
|
|
|
|
|
2068
|
0
|
|
|
|
|
|
my @mandatory_params = qw/UserID PasswordHash /; |
2069
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2070
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2071
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2072
|
|
|
|
|
|
|
} |
2073
|
|
|
|
|
|
|
} |
2074
|
|
|
|
|
|
|
|
2075
|
0
|
|
|
|
|
|
my $result = $self->_get_request($api_method, $params); |
2076
|
0
|
0
|
|
|
|
|
if ($result->{stat} eq 'ok') { |
2077
|
0
|
|
|
|
|
|
$self->{sm_session} = $result->{Login}->{Session}->{id}; |
2078
|
|
|
|
|
|
|
} |
2079
|
|
|
|
|
|
|
|
2080
|
0
|
|
|
|
|
|
return $result; |
2081
|
|
|
|
|
|
|
} |
2082
|
|
|
|
|
|
|
|
2083
|
|
|
|
|
|
|
=head2 login_withPassword |
2084
|
|
|
|
|
|
|
|
2085
|
|
|
|
|
|
|
Calls smugmug.login.withPassword. |
2086
|
|
|
|
|
|
|
|
2087
|
|
|
|
|
|
|
Parameters: |
2088
|
|
|
|
|
|
|
|
2089
|
|
|
|
|
|
|
=over |
2090
|
|
|
|
|
|
|
|
2091
|
|
|
|
|
|
|
=item EmailAddress (string) (required) |
2092
|
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
|
=item Password (string) (required) |
2094
|
|
|
|
|
|
|
|
2095
|
|
|
|
|
|
|
=back |
2096
|
|
|
|
|
|
|
|
2097
|
|
|
|
|
|
|
=cut |
2098
|
|
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
sub login_withPassword { |
2100
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2101
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.login.withPassword'; |
2102
|
0
|
|
|
|
|
|
my $params; |
2103
|
|
|
|
|
|
|
|
2104
|
0
|
|
|
|
|
|
$params->{APIKey} = $self->{sm_api_key}; |
2105
|
|
|
|
|
|
|
|
2106
|
0
|
|
|
|
|
|
my @mandatory_params = qw/EmailAddress Password /; |
2107
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2108
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2109
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2110
|
|
|
|
|
|
|
} |
2111
|
|
|
|
|
|
|
} |
2112
|
|
|
|
|
|
|
|
2113
|
0
|
|
|
|
|
|
my $result = $self->_get_request($api_method, $params); |
2114
|
0
|
0
|
|
|
|
|
if ($result->{stat} eq 'ok') { |
2115
|
0
|
|
|
|
|
|
$self->{sm_session} = $result->{Login}->{Session}->{id}; |
2116
|
|
|
|
|
|
|
} |
2117
|
|
|
|
|
|
|
|
2118
|
0
|
|
|
|
|
|
return $result; |
2119
|
|
|
|
|
|
|
} |
2120
|
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
|
=head2 logout |
2122
|
|
|
|
|
|
|
|
2123
|
|
|
|
|
|
|
Calls smugmug.logout. |
2124
|
|
|
|
|
|
|
|
2125
|
|
|
|
|
|
|
Parameters: |
2126
|
|
|
|
|
|
|
|
2127
|
|
|
|
|
|
|
=over |
2128
|
|
|
|
|
|
|
|
2129
|
|
|
|
|
|
|
No parameters |
2130
|
|
|
|
|
|
|
|
2131
|
|
|
|
|
|
|
=back |
2132
|
|
|
|
|
|
|
|
2133
|
|
|
|
|
|
|
=cut |
2134
|
|
|
|
|
|
|
|
2135
|
|
|
|
|
|
|
sub logout { |
2136
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2137
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.logout'; |
2138
|
0
|
|
|
|
|
|
my $params; |
2139
|
|
|
|
|
|
|
|
2140
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2141
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2142
|
|
|
|
|
|
|
} |
2143
|
|
|
|
|
|
|
else { |
2144
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2145
|
|
|
|
|
|
|
} |
2146
|
|
|
|
|
|
|
|
2147
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2148
|
|
|
|
|
|
|
} |
2149
|
|
|
|
|
|
|
|
2150
|
|
|
|
|
|
|
=head2 products_get |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
Calls smugmug.products.get. |
2153
|
|
|
|
|
|
|
|
2154
|
|
|
|
|
|
|
Parameters: |
2155
|
|
|
|
|
|
|
|
2156
|
|
|
|
|
|
|
=over |
2157
|
|
|
|
|
|
|
|
2158
|
|
|
|
|
|
|
No parameters |
2159
|
|
|
|
|
|
|
|
2160
|
|
|
|
|
|
|
=back |
2161
|
|
|
|
|
|
|
|
2162
|
|
|
|
|
|
|
=cut |
2163
|
|
|
|
|
|
|
|
2164
|
|
|
|
|
|
|
sub products_get { |
2165
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2166
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.products.get'; |
2167
|
0
|
|
|
|
|
|
my $params; |
2168
|
|
|
|
|
|
|
|
2169
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2170
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2171
|
|
|
|
|
|
|
} |
2172
|
|
|
|
|
|
|
else { |
2173
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2174
|
|
|
|
|
|
|
} |
2175
|
|
|
|
|
|
|
|
2176
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2177
|
|
|
|
|
|
|
} |
2178
|
|
|
|
|
|
|
|
2179
|
|
|
|
|
|
|
=head2 propricing_getPortfolio |
2180
|
|
|
|
|
|
|
|
2181
|
|
|
|
|
|
|
Calls smugmug.propricing.getPortfolio. |
2182
|
|
|
|
|
|
|
|
2183
|
|
|
|
|
|
|
Parameters: |
2184
|
|
|
|
|
|
|
|
2185
|
|
|
|
|
|
|
=over |
2186
|
|
|
|
|
|
|
|
2187
|
|
|
|
|
|
|
=item ProductType (string) |
2188
|
|
|
|
|
|
|
|
2189
|
|
|
|
|
|
|
=item ProductID (integer) |
2190
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
=back |
2192
|
|
|
|
|
|
|
|
2193
|
|
|
|
|
|
|
=cut |
2194
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
sub propricing_getPortfolio { |
2196
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2197
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.propricing.getPortfolio'; |
2198
|
0
|
|
|
|
|
|
my $params; |
2199
|
|
|
|
|
|
|
|
2200
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2201
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2202
|
|
|
|
|
|
|
} |
2203
|
|
|
|
|
|
|
else { |
2204
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2205
|
|
|
|
|
|
|
} |
2206
|
|
|
|
|
|
|
|
2207
|
0
|
|
|
|
|
|
my @optional_params = qw/ProductType ProductID /; |
2208
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2209
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2210
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2211
|
|
|
|
|
|
|
} |
2212
|
|
|
|
|
|
|
} |
2213
|
|
|
|
|
|
|
|
2214
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2215
|
|
|
|
|
|
|
} |
2216
|
|
|
|
|
|
|
|
2217
|
|
|
|
|
|
|
=head2 propricing_getAlbum |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
Calls smugmug.propricing.getAlbum. |
2220
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
Parameters: |
2222
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
=over |
2224
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
2226
|
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
=item ProductType (string) |
2228
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
=item ProductID (integer) |
2230
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
=back |
2232
|
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
=cut |
2234
|
|
|
|
|
|
|
|
2235
|
|
|
|
|
|
|
sub propricing_getAlbum { |
2236
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2237
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.propricing.getAlbum'; |
2238
|
0
|
|
|
|
|
|
my $params; |
2239
|
|
|
|
|
|
|
|
2240
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2241
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2242
|
|
|
|
|
|
|
} |
2243
|
|
|
|
|
|
|
else { |
2244
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2245
|
|
|
|
|
|
|
} |
2246
|
|
|
|
|
|
|
|
2247
|
0
|
|
|
|
|
|
my @mandatory_params = qw/AlbumID /; |
2248
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2249
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2250
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2251
|
|
|
|
|
|
|
} |
2252
|
|
|
|
|
|
|
} |
2253
|
|
|
|
|
|
|
|
2254
|
0
|
|
|
|
|
|
my @optional_params = qw/ProductType ProductID /; |
2255
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2256
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2257
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2258
|
|
|
|
|
|
|
} |
2259
|
|
|
|
|
|
|
} |
2260
|
|
|
|
|
|
|
|
2261
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2262
|
|
|
|
|
|
|
} |
2263
|
|
|
|
|
|
|
|
2264
|
|
|
|
|
|
|
=head2 propricing_getImage |
2265
|
|
|
|
|
|
|
|
2266
|
|
|
|
|
|
|
Calls smugmug.propricing.getImage. |
2267
|
|
|
|
|
|
|
|
2268
|
|
|
|
|
|
|
Parameters: |
2269
|
|
|
|
|
|
|
|
2270
|
|
|
|
|
|
|
=over |
2271
|
|
|
|
|
|
|
|
2272
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
2273
|
|
|
|
|
|
|
|
2274
|
|
|
|
|
|
|
=item ProductType (string) |
2275
|
|
|
|
|
|
|
|
2276
|
|
|
|
|
|
|
=item ProductID (integer) |
2277
|
|
|
|
|
|
|
|
2278
|
|
|
|
|
|
|
=back |
2279
|
|
|
|
|
|
|
|
2280
|
|
|
|
|
|
|
=cut |
2281
|
|
|
|
|
|
|
|
2282
|
|
|
|
|
|
|
sub propricing_getImage { |
2283
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2284
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.propricing.getImage'; |
2285
|
0
|
|
|
|
|
|
my $params; |
2286
|
|
|
|
|
|
|
|
2287
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2288
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2289
|
|
|
|
|
|
|
} |
2290
|
|
|
|
|
|
|
else { |
2291
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2292
|
|
|
|
|
|
|
} |
2293
|
|
|
|
|
|
|
|
2294
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
2295
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2296
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2297
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2298
|
|
|
|
|
|
|
} |
2299
|
|
|
|
|
|
|
} |
2300
|
|
|
|
|
|
|
|
2301
|
0
|
|
|
|
|
|
my @optional_params = qw/ProductType ProductID /; |
2302
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2303
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2304
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2305
|
|
|
|
|
|
|
} |
2306
|
|
|
|
|
|
|
} |
2307
|
|
|
|
|
|
|
|
2308
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2309
|
|
|
|
|
|
|
} |
2310
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
=head2 sharegroups_addAlbum |
2312
|
|
|
|
|
|
|
|
2313
|
|
|
|
|
|
|
Calls smugmug.sharegroups.addAlbum. |
2314
|
|
|
|
|
|
|
|
2315
|
|
|
|
|
|
|
Parameters: |
2316
|
|
|
|
|
|
|
|
2317
|
|
|
|
|
|
|
=over |
2318
|
|
|
|
|
|
|
|
2319
|
|
|
|
|
|
|
=item ShareGroupID (integer) (required) |
2320
|
|
|
|
|
|
|
|
2321
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
2322
|
|
|
|
|
|
|
|
2323
|
|
|
|
|
|
|
=back |
2324
|
|
|
|
|
|
|
|
2325
|
|
|
|
|
|
|
=cut |
2326
|
|
|
|
|
|
|
|
2327
|
|
|
|
|
|
|
sub sharegroups_addAlbum { |
2328
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2329
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.addAlbum'; |
2330
|
0
|
|
|
|
|
|
my $params; |
2331
|
|
|
|
|
|
|
|
2332
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2333
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2334
|
|
|
|
|
|
|
} |
2335
|
|
|
|
|
|
|
else { |
2336
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2337
|
|
|
|
|
|
|
} |
2338
|
|
|
|
|
|
|
|
2339
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ShareGroupID AlbumID /; |
2340
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2341
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2342
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2343
|
|
|
|
|
|
|
} |
2344
|
|
|
|
|
|
|
} |
2345
|
|
|
|
|
|
|
|
2346
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2347
|
|
|
|
|
|
|
} |
2348
|
|
|
|
|
|
|
|
2349
|
|
|
|
|
|
|
=head2 sharegroups_create |
2350
|
|
|
|
|
|
|
|
2351
|
|
|
|
|
|
|
Calls smugmug.sharegroups.create. |
2352
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
Parameters: |
2354
|
|
|
|
|
|
|
|
2355
|
|
|
|
|
|
|
=over |
2356
|
|
|
|
|
|
|
|
2357
|
|
|
|
|
|
|
=item Name (string) (required) |
2358
|
|
|
|
|
|
|
|
2359
|
|
|
|
|
|
|
=item Description (string) |
2360
|
|
|
|
|
|
|
|
2361
|
|
|
|
|
|
|
=back |
2362
|
|
|
|
|
|
|
|
2363
|
|
|
|
|
|
|
=cut |
2364
|
|
|
|
|
|
|
|
2365
|
|
|
|
|
|
|
sub sharegroups_create { |
2366
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2367
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.create'; |
2368
|
0
|
|
|
|
|
|
my $params; |
2369
|
|
|
|
|
|
|
|
2370
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2371
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2372
|
|
|
|
|
|
|
} |
2373
|
|
|
|
|
|
|
else { |
2374
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2375
|
|
|
|
|
|
|
} |
2376
|
|
|
|
|
|
|
|
2377
|
0
|
|
|
|
|
|
my @mandatory_params = qw/Name /; |
2378
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2379
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2380
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2381
|
|
|
|
|
|
|
} |
2382
|
|
|
|
|
|
|
} |
2383
|
|
|
|
|
|
|
|
2384
|
0
|
|
|
|
|
|
my @optional_params = qw/Description /; |
2385
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2386
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2387
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2388
|
|
|
|
|
|
|
} |
2389
|
|
|
|
|
|
|
} |
2390
|
|
|
|
|
|
|
|
2391
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2392
|
|
|
|
|
|
|
} |
2393
|
|
|
|
|
|
|
|
2394
|
|
|
|
|
|
|
=head2 sharegroups_delete |
2395
|
|
|
|
|
|
|
|
2396
|
|
|
|
|
|
|
Calls smugmug.sharegroups.delete. |
2397
|
|
|
|
|
|
|
|
2398
|
|
|
|
|
|
|
Parameters: |
2399
|
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
=over |
2401
|
|
|
|
|
|
|
|
2402
|
|
|
|
|
|
|
=item ShareGroupID (integer) (required) |
2403
|
|
|
|
|
|
|
|
2404
|
|
|
|
|
|
|
=back |
2405
|
|
|
|
|
|
|
|
2406
|
|
|
|
|
|
|
=cut |
2407
|
|
|
|
|
|
|
|
2408
|
|
|
|
|
|
|
sub sharegroups_delete { |
2409
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2410
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.delete'; |
2411
|
0
|
|
|
|
|
|
my $params; |
2412
|
|
|
|
|
|
|
|
2413
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2414
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2415
|
|
|
|
|
|
|
} |
2416
|
|
|
|
|
|
|
else { |
2417
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2418
|
|
|
|
|
|
|
} |
2419
|
|
|
|
|
|
|
|
2420
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ShareGroupID /; |
2421
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2422
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2423
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2424
|
|
|
|
|
|
|
} |
2425
|
|
|
|
|
|
|
} |
2426
|
|
|
|
|
|
|
|
2427
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2428
|
|
|
|
|
|
|
} |
2429
|
|
|
|
|
|
|
|
2430
|
|
|
|
|
|
|
=head2 sharegroups_get |
2431
|
|
|
|
|
|
|
|
2432
|
|
|
|
|
|
|
Calls smugmug.sharegroups.get. |
2433
|
|
|
|
|
|
|
|
2434
|
|
|
|
|
|
|
Parameters: |
2435
|
|
|
|
|
|
|
|
2436
|
|
|
|
|
|
|
=over |
2437
|
|
|
|
|
|
|
|
2438
|
|
|
|
|
|
|
=item Heavy (boolean) |
2439
|
|
|
|
|
|
|
|
2440
|
|
|
|
|
|
|
=back |
2441
|
|
|
|
|
|
|
|
2442
|
|
|
|
|
|
|
=cut |
2443
|
|
|
|
|
|
|
|
2444
|
|
|
|
|
|
|
sub sharegroups_get { |
2445
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2446
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.get'; |
2447
|
0
|
|
|
|
|
|
my $params; |
2448
|
|
|
|
|
|
|
|
2449
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2450
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2451
|
|
|
|
|
|
|
} |
2452
|
|
|
|
|
|
|
else { |
2453
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2454
|
|
|
|
|
|
|
} |
2455
|
|
|
|
|
|
|
|
2456
|
0
|
|
|
|
|
|
my @optional_params = qw/Heavy /; |
2457
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2458
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2459
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2460
|
|
|
|
|
|
|
} |
2461
|
|
|
|
|
|
|
} |
2462
|
|
|
|
|
|
|
|
2463
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2464
|
|
|
|
|
|
|
} |
2465
|
|
|
|
|
|
|
|
2466
|
|
|
|
|
|
|
=head2 sharegroups_getInfo |
2467
|
|
|
|
|
|
|
|
2468
|
|
|
|
|
|
|
Calls smugmug.sharegroups.getInfo. |
2469
|
|
|
|
|
|
|
|
2470
|
|
|
|
|
|
|
Parameters: |
2471
|
|
|
|
|
|
|
|
2472
|
|
|
|
|
|
|
=over |
2473
|
|
|
|
|
|
|
|
2474
|
|
|
|
|
|
|
=item ShareGroupID (integer) (required) |
2475
|
|
|
|
|
|
|
|
2476
|
|
|
|
|
|
|
=back |
2477
|
|
|
|
|
|
|
|
2478
|
|
|
|
|
|
|
=cut |
2479
|
|
|
|
|
|
|
|
2480
|
|
|
|
|
|
|
sub sharegroups_getInfo { |
2481
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2482
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.getInfo'; |
2483
|
0
|
|
|
|
|
|
my $params; |
2484
|
|
|
|
|
|
|
|
2485
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2486
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2487
|
|
|
|
|
|
|
} |
2488
|
|
|
|
|
|
|
else { |
2489
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2490
|
|
|
|
|
|
|
} |
2491
|
|
|
|
|
|
|
|
2492
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ShareGroupID /; |
2493
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2494
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2495
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2496
|
|
|
|
|
|
|
} |
2497
|
|
|
|
|
|
|
} |
2498
|
|
|
|
|
|
|
|
2499
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2500
|
|
|
|
|
|
|
} |
2501
|
|
|
|
|
|
|
|
2502
|
|
|
|
|
|
|
=head2 sharegroups_removeAlbum |
2503
|
|
|
|
|
|
|
|
2504
|
|
|
|
|
|
|
Calls smugmug.sharegroups.removeAlbum. |
2505
|
|
|
|
|
|
|
|
2506
|
|
|
|
|
|
|
Parameters: |
2507
|
|
|
|
|
|
|
|
2508
|
|
|
|
|
|
|
=over |
2509
|
|
|
|
|
|
|
|
2510
|
|
|
|
|
|
|
=item ShareGroupID (integer) (required) |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
=item AlbumID (integer) (required) |
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
=back |
2515
|
|
|
|
|
|
|
|
2516
|
|
|
|
|
|
|
=cut |
2517
|
|
|
|
|
|
|
|
2518
|
|
|
|
|
|
|
sub sharegroups_removeAlbum { |
2519
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2520
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.sharegroups.removeAlbum'; |
2521
|
0
|
|
|
|
|
|
my $params; |
2522
|
|
|
|
|
|
|
|
2523
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2524
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2525
|
|
|
|
|
|
|
} |
2526
|
|
|
|
|
|
|
else { |
2527
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2528
|
|
|
|
|
|
|
} |
2529
|
|
|
|
|
|
|
|
2530
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ShareGroupID AlbumID /; |
2531
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2532
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2533
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2534
|
|
|
|
|
|
|
} |
2535
|
|
|
|
|
|
|
} |
2536
|
|
|
|
|
|
|
|
2537
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2538
|
|
|
|
|
|
|
} |
2539
|
|
|
|
|
|
|
|
2540
|
|
|
|
|
|
|
=head2 subcategories_create |
2541
|
|
|
|
|
|
|
|
2542
|
|
|
|
|
|
|
Calls smugmug.subcategories.create. |
2543
|
|
|
|
|
|
|
|
2544
|
|
|
|
|
|
|
Parameters: |
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
=over |
2547
|
|
|
|
|
|
|
|
2548
|
|
|
|
|
|
|
=item Name (string) (required) |
2549
|
|
|
|
|
|
|
|
2550
|
|
|
|
|
|
|
=item CategoryID (integer) (required) |
2551
|
|
|
|
|
|
|
|
2552
|
|
|
|
|
|
|
=back |
2553
|
|
|
|
|
|
|
|
2554
|
|
|
|
|
|
|
=cut |
2555
|
|
|
|
|
|
|
|
2556
|
|
|
|
|
|
|
sub subcategories_create { |
2557
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2558
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.subcategories.create'; |
2559
|
0
|
|
|
|
|
|
my $params; |
2560
|
|
|
|
|
|
|
|
2561
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2562
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2563
|
|
|
|
|
|
|
} |
2564
|
|
|
|
|
|
|
else { |
2565
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2566
|
|
|
|
|
|
|
} |
2567
|
|
|
|
|
|
|
|
2568
|
0
|
|
|
|
|
|
my @mandatory_params = qw/Name CategoryID /; |
2569
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2570
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2571
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2572
|
|
|
|
|
|
|
} |
2573
|
|
|
|
|
|
|
} |
2574
|
|
|
|
|
|
|
|
2575
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2576
|
|
|
|
|
|
|
} |
2577
|
|
|
|
|
|
|
|
2578
|
|
|
|
|
|
|
=head2 subcategories_delete |
2579
|
|
|
|
|
|
|
|
2580
|
|
|
|
|
|
|
Calls smugmug.subcategories.delete. |
2581
|
|
|
|
|
|
|
|
2582
|
|
|
|
|
|
|
Parameters: |
2583
|
|
|
|
|
|
|
|
2584
|
|
|
|
|
|
|
=over |
2585
|
|
|
|
|
|
|
|
2586
|
|
|
|
|
|
|
=item SubCategoryID (integer) (required) |
2587
|
|
|
|
|
|
|
|
2588
|
|
|
|
|
|
|
=back |
2589
|
|
|
|
|
|
|
|
2590
|
|
|
|
|
|
|
=cut |
2591
|
|
|
|
|
|
|
|
2592
|
|
|
|
|
|
|
sub subcategories_delete { |
2593
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2594
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.subcategories.delete'; |
2595
|
0
|
|
|
|
|
|
my $params; |
2596
|
|
|
|
|
|
|
|
2597
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2598
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2599
|
|
|
|
|
|
|
} |
2600
|
|
|
|
|
|
|
else { |
2601
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2602
|
|
|
|
|
|
|
} |
2603
|
|
|
|
|
|
|
|
2604
|
0
|
|
|
|
|
|
my @mandatory_params = qw/SubCategoryID /; |
2605
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2606
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2607
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2608
|
|
|
|
|
|
|
} |
2609
|
|
|
|
|
|
|
} |
2610
|
|
|
|
|
|
|
|
2611
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2612
|
|
|
|
|
|
|
} |
2613
|
|
|
|
|
|
|
|
2614
|
|
|
|
|
|
|
=head2 subcategories_get |
2615
|
|
|
|
|
|
|
|
2616
|
|
|
|
|
|
|
Calls smugmug.subcategories.get. |
2617
|
|
|
|
|
|
|
|
2618
|
|
|
|
|
|
|
Parameters: |
2619
|
|
|
|
|
|
|
|
2620
|
|
|
|
|
|
|
=over |
2621
|
|
|
|
|
|
|
|
2622
|
|
|
|
|
|
|
=item CategoryID (integer) (required) |
2623
|
|
|
|
|
|
|
|
2624
|
|
|
|
|
|
|
=item NickName (string) |
2625
|
|
|
|
|
|
|
|
2626
|
|
|
|
|
|
|
=item SitePassword (string) |
2627
|
|
|
|
|
|
|
|
2628
|
|
|
|
|
|
|
=back |
2629
|
|
|
|
|
|
|
|
2630
|
|
|
|
|
|
|
=cut |
2631
|
|
|
|
|
|
|
|
2632
|
|
|
|
|
|
|
sub subcategories_get { |
2633
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2634
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.subcategories.get'; |
2635
|
0
|
|
|
|
|
|
my $params; |
2636
|
|
|
|
|
|
|
|
2637
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2638
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2639
|
|
|
|
|
|
|
} |
2640
|
|
|
|
|
|
|
else { |
2641
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2642
|
|
|
|
|
|
|
} |
2643
|
|
|
|
|
|
|
|
2644
|
0
|
|
|
|
|
|
my @mandatory_params = qw/CategoryID /; |
2645
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2646
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2647
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2648
|
|
|
|
|
|
|
} |
2649
|
|
|
|
|
|
|
} |
2650
|
|
|
|
|
|
|
|
2651
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName SitePassword /; |
2652
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2653
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2654
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2655
|
|
|
|
|
|
|
} |
2656
|
|
|
|
|
|
|
} |
2657
|
|
|
|
|
|
|
|
2658
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2659
|
|
|
|
|
|
|
} |
2660
|
|
|
|
|
|
|
|
2661
|
|
|
|
|
|
|
=head2 subcategories_getAll |
2662
|
|
|
|
|
|
|
|
2663
|
|
|
|
|
|
|
Calls smugmug.subcategories.getAll. |
2664
|
|
|
|
|
|
|
|
2665
|
|
|
|
|
|
|
Parameters: |
2666
|
|
|
|
|
|
|
|
2667
|
|
|
|
|
|
|
=over |
2668
|
|
|
|
|
|
|
|
2669
|
|
|
|
|
|
|
=item NickName (string) |
2670
|
|
|
|
|
|
|
|
2671
|
|
|
|
|
|
|
=item SitePassword (string) |
2672
|
|
|
|
|
|
|
|
2673
|
|
|
|
|
|
|
=back |
2674
|
|
|
|
|
|
|
|
2675
|
|
|
|
|
|
|
=cut |
2676
|
|
|
|
|
|
|
|
2677
|
|
|
|
|
|
|
sub subcategories_getAll { |
2678
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2679
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.subcategories.getAll'; |
2680
|
0
|
|
|
|
|
|
my $params; |
2681
|
|
|
|
|
|
|
|
2682
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2683
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2684
|
|
|
|
|
|
|
} |
2685
|
|
|
|
|
|
|
else { |
2686
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2687
|
|
|
|
|
|
|
} |
2688
|
|
|
|
|
|
|
|
2689
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName SitePassword /; |
2690
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2691
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2692
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2693
|
|
|
|
|
|
|
} |
2694
|
|
|
|
|
|
|
} |
2695
|
|
|
|
|
|
|
|
2696
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2697
|
|
|
|
|
|
|
} |
2698
|
|
|
|
|
|
|
|
2699
|
|
|
|
|
|
|
=head2 subcategories_rename |
2700
|
|
|
|
|
|
|
|
2701
|
|
|
|
|
|
|
Calls smugmug.subcategories.rename. |
2702
|
|
|
|
|
|
|
|
2703
|
|
|
|
|
|
|
Parameters: |
2704
|
|
|
|
|
|
|
|
2705
|
|
|
|
|
|
|
=over |
2706
|
|
|
|
|
|
|
|
2707
|
|
|
|
|
|
|
=item SubCategoryID (integer) (required) |
2708
|
|
|
|
|
|
|
|
2709
|
|
|
|
|
|
|
=item Name (string) (required) |
2710
|
|
|
|
|
|
|
|
2711
|
|
|
|
|
|
|
=back |
2712
|
|
|
|
|
|
|
|
2713
|
|
|
|
|
|
|
=cut |
2714
|
|
|
|
|
|
|
|
2715
|
|
|
|
|
|
|
sub subcategories_rename { |
2716
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2717
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.subcategories.rename'; |
2718
|
0
|
|
|
|
|
|
my $params; |
2719
|
|
|
|
|
|
|
|
2720
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2721
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2722
|
|
|
|
|
|
|
} |
2723
|
|
|
|
|
|
|
else { |
2724
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2725
|
|
|
|
|
|
|
} |
2726
|
|
|
|
|
|
|
|
2727
|
0
|
|
|
|
|
|
my @mandatory_params = qw/SubCategoryID Name /; |
2728
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2729
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2730
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2731
|
|
|
|
|
|
|
} |
2732
|
|
|
|
|
|
|
} |
2733
|
|
|
|
|
|
|
|
2734
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2735
|
|
|
|
|
|
|
} |
2736
|
|
|
|
|
|
|
|
2737
|
|
|
|
|
|
|
=head2 themes_get |
2738
|
|
|
|
|
|
|
|
2739
|
|
|
|
|
|
|
Calls smugmug.themes.get. |
2740
|
|
|
|
|
|
|
|
2741
|
|
|
|
|
|
|
Parameters: |
2742
|
|
|
|
|
|
|
|
2743
|
|
|
|
|
|
|
=over |
2744
|
|
|
|
|
|
|
|
2745
|
|
|
|
|
|
|
No parameters |
2746
|
|
|
|
|
|
|
|
2747
|
|
|
|
|
|
|
=back |
2748
|
|
|
|
|
|
|
|
2749
|
|
|
|
|
|
|
=cut |
2750
|
|
|
|
|
|
|
|
2751
|
|
|
|
|
|
|
sub themes_get { |
2752
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2753
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.themes.get'; |
2754
|
0
|
|
|
|
|
|
my $params; |
2755
|
|
|
|
|
|
|
|
2756
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2757
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2758
|
|
|
|
|
|
|
} |
2759
|
|
|
|
|
|
|
else { |
2760
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2761
|
|
|
|
|
|
|
} |
2762
|
|
|
|
|
|
|
|
2763
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2764
|
|
|
|
|
|
|
} |
2765
|
|
|
|
|
|
|
|
2766
|
|
|
|
|
|
|
=head2 users_getDisplayName |
2767
|
|
|
|
|
|
|
|
2768
|
|
|
|
|
|
|
Calls smugmug.users.getDisplayName. |
2769
|
|
|
|
|
|
|
|
2770
|
|
|
|
|
|
|
Parameters: |
2771
|
|
|
|
|
|
|
|
2772
|
|
|
|
|
|
|
=over |
2773
|
|
|
|
|
|
|
|
2774
|
|
|
|
|
|
|
=item NickName (string) |
2775
|
|
|
|
|
|
|
|
2776
|
|
|
|
|
|
|
=back |
2777
|
|
|
|
|
|
|
|
2778
|
|
|
|
|
|
|
=cut |
2779
|
|
|
|
|
|
|
|
2780
|
|
|
|
|
|
|
sub users_getDisplayName { |
2781
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2782
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.users.getDisplayName'; |
2783
|
0
|
|
|
|
|
|
my $params; |
2784
|
|
|
|
|
|
|
|
2785
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2786
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2787
|
|
|
|
|
|
|
} |
2788
|
|
|
|
|
|
|
else { |
2789
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2790
|
|
|
|
|
|
|
} |
2791
|
|
|
|
|
|
|
|
2792
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName /; |
2793
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2794
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2795
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2796
|
|
|
|
|
|
|
} |
2797
|
|
|
|
|
|
|
} |
2798
|
|
|
|
|
|
|
|
2799
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2800
|
|
|
|
|
|
|
} |
2801
|
|
|
|
|
|
|
|
2802
|
|
|
|
|
|
|
=head2 users_getTransferStats |
2803
|
|
|
|
|
|
|
|
2804
|
|
|
|
|
|
|
Calls smugmug.users.getTransferStats. |
2805
|
|
|
|
|
|
|
|
2806
|
|
|
|
|
|
|
Parameters: |
2807
|
|
|
|
|
|
|
|
2808
|
|
|
|
|
|
|
=over |
2809
|
|
|
|
|
|
|
|
2810
|
|
|
|
|
|
|
=item Month (integer) (required) |
2811
|
|
|
|
|
|
|
|
2812
|
|
|
|
|
|
|
=item Year (integer) (required) |
2813
|
|
|
|
|
|
|
|
2814
|
|
|
|
|
|
|
=item Heavy (boolean) |
2815
|
|
|
|
|
|
|
|
2816
|
|
|
|
|
|
|
=back |
2817
|
|
|
|
|
|
|
|
2818
|
|
|
|
|
|
|
=cut |
2819
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
sub users_getTransferStats { |
2821
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2822
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.users.getTransferStats'; |
2823
|
0
|
|
|
|
|
|
my $params; |
2824
|
|
|
|
|
|
|
|
2825
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2826
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2827
|
|
|
|
|
|
|
} |
2828
|
|
|
|
|
|
|
else { |
2829
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2830
|
|
|
|
|
|
|
} |
2831
|
|
|
|
|
|
|
|
2832
|
0
|
|
|
|
|
|
my @mandatory_params = qw/Month Year /; |
2833
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2834
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2835
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2836
|
|
|
|
|
|
|
} |
2837
|
|
|
|
|
|
|
} |
2838
|
|
|
|
|
|
|
|
2839
|
0
|
|
|
|
|
|
my @optional_params = qw/Heavy /; |
2840
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2841
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2842
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2843
|
|
|
|
|
|
|
} |
2844
|
|
|
|
|
|
|
} |
2845
|
|
|
|
|
|
|
|
2846
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2847
|
|
|
|
|
|
|
} |
2848
|
|
|
|
|
|
|
|
2849
|
|
|
|
|
|
|
=head2 users_getTree |
2850
|
|
|
|
|
|
|
|
2851
|
|
|
|
|
|
|
Calls smugmug.users.getTree. |
2852
|
|
|
|
|
|
|
|
2853
|
|
|
|
|
|
|
Parameters: |
2854
|
|
|
|
|
|
|
|
2855
|
|
|
|
|
|
|
=over |
2856
|
|
|
|
|
|
|
|
2857
|
|
|
|
|
|
|
=item NickName (string) |
2858
|
|
|
|
|
|
|
|
2859
|
|
|
|
|
|
|
=item Heavy (boolean) |
2860
|
|
|
|
|
|
|
|
2861
|
|
|
|
|
|
|
=item SitePassword (string) |
2862
|
|
|
|
|
|
|
|
2863
|
|
|
|
|
|
|
=item Sharegroup () |
2864
|
|
|
|
|
|
|
|
2865
|
|
|
|
|
|
|
=back |
2866
|
|
|
|
|
|
|
|
2867
|
|
|
|
|
|
|
=cut |
2868
|
|
|
|
|
|
|
|
2869
|
|
|
|
|
|
|
sub users_getTree { |
2870
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2871
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.users.getTree'; |
2872
|
0
|
|
|
|
|
|
my $params; |
2873
|
|
|
|
|
|
|
|
2874
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2875
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2876
|
|
|
|
|
|
|
} |
2877
|
|
|
|
|
|
|
else { |
2878
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2879
|
|
|
|
|
|
|
} |
2880
|
|
|
|
|
|
|
|
2881
|
0
|
|
|
|
|
|
my @optional_params = qw/NickName Heavy SitePassword Sharegroup /; |
2882
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2883
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2884
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2885
|
|
|
|
|
|
|
} |
2886
|
|
|
|
|
|
|
} |
2887
|
|
|
|
|
|
|
|
2888
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2889
|
|
|
|
|
|
|
} |
2890
|
|
|
|
|
|
|
|
2891
|
|
|
|
|
|
|
=head2 watermarks_changeSettings |
2892
|
|
|
|
|
|
|
|
2893
|
|
|
|
|
|
|
Calls smugmug.watermarks.changeSettings. |
2894
|
|
|
|
|
|
|
|
2895
|
|
|
|
|
|
|
Parameters: |
2896
|
|
|
|
|
|
|
|
2897
|
|
|
|
|
|
|
=over |
2898
|
|
|
|
|
|
|
|
2899
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
2900
|
|
|
|
|
|
|
|
2901
|
|
|
|
|
|
|
=item Name (string) |
2902
|
|
|
|
|
|
|
|
2903
|
|
|
|
|
|
|
=item Pinned (string) |
2904
|
|
|
|
|
|
|
|
2905
|
|
|
|
|
|
|
=item Dissolved (integer) |
2906
|
|
|
|
|
|
|
|
2907
|
|
|
|
|
|
|
=item Thumbs (boolean) |
2908
|
|
|
|
|
|
|
|
2909
|
|
|
|
|
|
|
=back |
2910
|
|
|
|
|
|
|
|
2911
|
|
|
|
|
|
|
=cut |
2912
|
|
|
|
|
|
|
|
2913
|
|
|
|
|
|
|
sub watermarks_changeSettings { |
2914
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2915
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.watermarks.changeSettings'; |
2916
|
0
|
|
|
|
|
|
my $params; |
2917
|
|
|
|
|
|
|
|
2918
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2919
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2920
|
|
|
|
|
|
|
} |
2921
|
|
|
|
|
|
|
else { |
2922
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2923
|
|
|
|
|
|
|
} |
2924
|
|
|
|
|
|
|
|
2925
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
2926
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2927
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2928
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2929
|
|
|
|
|
|
|
} |
2930
|
|
|
|
|
|
|
} |
2931
|
|
|
|
|
|
|
|
2932
|
0
|
|
|
|
|
|
my @optional_params = qw/Name Pinned Dissolved Thumbs /; |
2933
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2934
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2935
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2936
|
|
|
|
|
|
|
} |
2937
|
|
|
|
|
|
|
} |
2938
|
|
|
|
|
|
|
|
2939
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2940
|
|
|
|
|
|
|
} |
2941
|
|
|
|
|
|
|
|
2942
|
|
|
|
|
|
|
=head2 watermarks_create |
2943
|
|
|
|
|
|
|
|
2944
|
|
|
|
|
|
|
Calls smugmug.watermarks.create. |
2945
|
|
|
|
|
|
|
|
2946
|
|
|
|
|
|
|
Parameters: |
2947
|
|
|
|
|
|
|
|
2948
|
|
|
|
|
|
|
=over |
2949
|
|
|
|
|
|
|
|
2950
|
|
|
|
|
|
|
=item ImageID (integer) (required) |
2951
|
|
|
|
|
|
|
|
2952
|
|
|
|
|
|
|
=item Name (string) |
2953
|
|
|
|
|
|
|
|
2954
|
|
|
|
|
|
|
=item Pinned (string) |
2955
|
|
|
|
|
|
|
|
2956
|
|
|
|
|
|
|
=item Dissolved (integer) |
2957
|
|
|
|
|
|
|
|
2958
|
|
|
|
|
|
|
=item Thumbs (boolean) |
2959
|
|
|
|
|
|
|
|
2960
|
|
|
|
|
|
|
=back |
2961
|
|
|
|
|
|
|
|
2962
|
|
|
|
|
|
|
=cut |
2963
|
|
|
|
|
|
|
|
2964
|
|
|
|
|
|
|
sub watermarks_create { |
2965
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
2966
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.watermarks.create'; |
2967
|
0
|
|
|
|
|
|
my $params; |
2968
|
|
|
|
|
|
|
|
2969
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
2970
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
2971
|
|
|
|
|
|
|
} |
2972
|
|
|
|
|
|
|
else { |
2973
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
2974
|
|
|
|
|
|
|
} |
2975
|
|
|
|
|
|
|
|
2976
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageID /; |
2977
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
2978
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
2979
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
2980
|
|
|
|
|
|
|
} |
2981
|
|
|
|
|
|
|
} |
2982
|
|
|
|
|
|
|
|
2983
|
0
|
|
|
|
|
|
my @optional_params = qw/Name Pinned Dissolved Thumbs /; |
2984
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
2985
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
2986
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
2987
|
|
|
|
|
|
|
} |
2988
|
|
|
|
|
|
|
} |
2989
|
|
|
|
|
|
|
|
2990
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
2991
|
|
|
|
|
|
|
} |
2992
|
|
|
|
|
|
|
|
2993
|
|
|
|
|
|
|
=head2 watermarks_delete |
2994
|
|
|
|
|
|
|
|
2995
|
|
|
|
|
|
|
Calls smugmug.watermarks.delete. |
2996
|
|
|
|
|
|
|
|
2997
|
|
|
|
|
|
|
Parameters: |
2998
|
|
|
|
|
|
|
|
2999
|
|
|
|
|
|
|
=over |
3000
|
|
|
|
|
|
|
|
3001
|
|
|
|
|
|
|
=item WatermarkID (integer) (required) |
3002
|
|
|
|
|
|
|
|
3003
|
|
|
|
|
|
|
=back |
3004
|
|
|
|
|
|
|
|
3005
|
|
|
|
|
|
|
=cut |
3006
|
|
|
|
|
|
|
|
3007
|
|
|
|
|
|
|
sub watermarks_delete { |
3008
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
3009
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.watermarks.delete'; |
3010
|
0
|
|
|
|
|
|
my $params; |
3011
|
|
|
|
|
|
|
|
3012
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
3013
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
3014
|
|
|
|
|
|
|
} |
3015
|
|
|
|
|
|
|
else { |
3016
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
3017
|
|
|
|
|
|
|
} |
3018
|
|
|
|
|
|
|
|
3019
|
0
|
|
|
|
|
|
my @mandatory_params = qw/WatermarkID /; |
3020
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
3021
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
3022
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
3023
|
|
|
|
|
|
|
} |
3024
|
|
|
|
|
|
|
} |
3025
|
|
|
|
|
|
|
|
3026
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
3027
|
|
|
|
|
|
|
} |
3028
|
|
|
|
|
|
|
|
3029
|
|
|
|
|
|
|
=head2 watermarks_get |
3030
|
|
|
|
|
|
|
|
3031
|
|
|
|
|
|
|
Calls smugmug.watermarks.get. |
3032
|
|
|
|
|
|
|
|
3033
|
|
|
|
|
|
|
Parameters: |
3034
|
|
|
|
|
|
|
|
3035
|
|
|
|
|
|
|
=over |
3036
|
|
|
|
|
|
|
|
3037
|
|
|
|
|
|
|
=item Heavy (boolean) |
3038
|
|
|
|
|
|
|
|
3039
|
|
|
|
|
|
|
=back |
3040
|
|
|
|
|
|
|
|
3041
|
|
|
|
|
|
|
=cut |
3042
|
|
|
|
|
|
|
|
3043
|
|
|
|
|
|
|
sub watermarks_get { |
3044
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
3045
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.watermarks.get'; |
3046
|
0
|
|
|
|
|
|
my $params; |
3047
|
|
|
|
|
|
|
|
3048
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
3049
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
3050
|
|
|
|
|
|
|
} |
3051
|
|
|
|
|
|
|
else { |
3052
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
3053
|
|
|
|
|
|
|
} |
3054
|
|
|
|
|
|
|
|
3055
|
0
|
|
|
|
|
|
my @optional_params = qw/Heavy /; |
3056
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
3057
|
0
|
0
|
|
|
|
|
if (defined $passed_params->{$param}) { |
3058
|
0
|
|
|
|
|
|
$params->{$param} = $passed_params->{$param}; |
3059
|
|
|
|
|
|
|
} |
3060
|
|
|
|
|
|
|
} |
3061
|
|
|
|
|
|
|
|
3062
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
3063
|
|
|
|
|
|
|
} |
3064
|
|
|
|
|
|
|
|
3065
|
|
|
|
|
|
|
=head2 watermarks_getInfo |
3066
|
|
|
|
|
|
|
|
3067
|
|
|
|
|
|
|
Calls smugmug.watermarks.getInfo. |
3068
|
|
|
|
|
|
|
|
3069
|
|
|
|
|
|
|
Parameters: |
3070
|
|
|
|
|
|
|
|
3071
|
|
|
|
|
|
|
=over |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
=item WatermarkID (integer) (required) |
3074
|
|
|
|
|
|
|
|
3075
|
|
|
|
|
|
|
=back |
3076
|
|
|
|
|
|
|
|
3077
|
|
|
|
|
|
|
=cut |
3078
|
|
|
|
|
|
|
|
3079
|
|
|
|
|
|
|
sub watermarks_getInfo { |
3080
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
3081
|
0
|
|
|
|
|
|
my $api_method = 'smugmug.watermarks.getInfo'; |
3082
|
0
|
|
|
|
|
|
my $params; |
3083
|
|
|
|
|
|
|
|
3084
|
0
|
0
|
|
|
|
|
if(defined $self->{sm_session}) { |
3085
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
3086
|
|
|
|
|
|
|
} |
3087
|
|
|
|
|
|
|
else { |
3088
|
0
|
|
|
|
|
|
return $self->_construct_error('Please call one of the login* methods first.', $ERROR_CODE->{SESSION_NOT_INITIALISED}); |
3089
|
|
|
|
|
|
|
} |
3090
|
|
|
|
|
|
|
|
3091
|
0
|
|
|
|
|
|
my @mandatory_params = qw/WatermarkID /; |
3092
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
3093
|
0
|
0
|
|
|
|
|
unless ($params->{$param} = $passed_params->{$param}) { |
3094
|
0
|
|
|
|
|
|
return $self->_construct_error("Missing mandatory parameter $param", $ERROR_CODE->{MISSING_REQUIRED_PARAMETER}); |
3095
|
|
|
|
|
|
|
} |
3096
|
|
|
|
|
|
|
} |
3097
|
|
|
|
|
|
|
|
3098
|
0
|
|
|
|
|
|
return $self->_get_request($api_method, $params); |
3099
|
|
|
|
|
|
|
} |
3100
|
|
|
|
|
|
|
|
3101
|
|
|
|
|
|
|
#END autogenerated subs |
3102
|
|
|
|
|
|
|
|
3103
|
|
|
|
|
|
|
=head2 getSessionID |
3104
|
|
|
|
|
|
|
|
3105
|
|
|
|
|
|
|
Returns the currently cached SessionID. |
3106
|
|
|
|
|
|
|
|
3107
|
|
|
|
|
|
|
Parameters: |
3108
|
|
|
|
|
|
|
|
3109
|
|
|
|
|
|
|
=over |
3110
|
|
|
|
|
|
|
|
3111
|
|
|
|
|
|
|
No parameters |
3112
|
|
|
|
|
|
|
|
3113
|
|
|
|
|
|
|
=back |
3114
|
|
|
|
|
|
|
|
3115
|
|
|
|
|
|
|
=cut |
3116
|
|
|
|
|
|
|
|
3117
|
|
|
|
|
|
|
sub getSessionID { |
3118
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
3119
|
0
|
|
|
|
|
|
return $self->{sm_session}; |
3120
|
|
|
|
|
|
|
} |
3121
|
|
|
|
|
|
|
|
3122
|
|
|
|
|
|
|
=head2 images_upload |
3123
|
|
|
|
|
|
|
|
3124
|
|
|
|
|
|
|
Uploads an image. |
3125
|
|
|
|
|
|
|
|
3126
|
|
|
|
|
|
|
Parameters: |
3127
|
|
|
|
|
|
|
|
3128
|
|
|
|
|
|
|
=over |
3129
|
|
|
|
|
|
|
|
3130
|
|
|
|
|
|
|
=item ImageData (binary) (required) |
3131
|
|
|
|
|
|
|
|
3132
|
|
|
|
|
|
|
=item FileName (string) (required) |
3133
|
|
|
|
|
|
|
|
3134
|
|
|
|
|
|
|
=item AlbumID (integer) |
3135
|
|
|
|
|
|
|
|
3136
|
|
|
|
|
|
|
=item ImageID (integer) |
3137
|
|
|
|
|
|
|
|
3138
|
|
|
|
|
|
|
=item Caption (string) |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
=item Keywords (string) |
3141
|
|
|
|
|
|
|
|
3142
|
|
|
|
|
|
|
=item Latitude (float?) |
3143
|
|
|
|
|
|
|
|
3144
|
|
|
|
|
|
|
=item Longitude (float?) |
3145
|
|
|
|
|
|
|
|
3146
|
|
|
|
|
|
|
=item Altitude (integer?) |
3147
|
|
|
|
|
|
|
|
3148
|
|
|
|
|
|
|
=back |
3149
|
|
|
|
|
|
|
|
3150
|
|
|
|
|
|
|
=cut |
3151
|
|
|
|
|
|
|
|
3152
|
|
|
|
|
|
|
sub images_upload { |
3153
|
0
|
|
|
0
|
1
|
|
my ( $self, $passed_params ) = @_; |
3154
|
|
|
|
|
|
|
|
3155
|
0
|
|
|
|
|
|
my $params; |
3156
|
|
|
|
|
|
|
|
3157
|
0
|
0
|
|
|
|
|
if ( defined $self->{sm_session} ) { |
3158
|
0
|
|
|
|
|
|
$params->{SessionID} = $self->{sm_session}; |
3159
|
|
|
|
|
|
|
} |
3160
|
|
|
|
|
|
|
else { |
3161
|
0
|
|
|
|
|
|
return $self->_construct_error( |
3162
|
|
|
|
|
|
|
'Please call one of the login* methods first.', |
3163
|
|
|
|
|
|
|
$ERROR_CODE->{SESSION_NOT_INITIALISED} |
3164
|
|
|
|
|
|
|
); |
3165
|
|
|
|
|
|
|
} |
3166
|
|
|
|
|
|
|
|
3167
|
0
|
|
|
|
|
|
my @mandatory_params = qw/ImageData FileName/; |
3168
|
0
|
|
|
|
|
|
for my $param (@mandatory_params) { |
3169
|
0
|
0
|
|
|
|
|
unless ( $params->{$param} = $passed_params->{$param} ) { |
3170
|
0
|
|
|
|
|
|
return $self->_construct_error( |
3171
|
|
|
|
|
|
|
"Missing mandatory parameter $param", |
3172
|
|
|
|
|
|
|
$ERROR_CODE->{MISSING_REQUIRED_PARAMETER} |
3173
|
|
|
|
|
|
|
); |
3174
|
|
|
|
|
|
|
} |
3175
|
|
|
|
|
|
|
} |
3176
|
|
|
|
|
|
|
|
3177
|
0
|
|
|
|
|
|
my $request = |
3178
|
|
|
|
|
|
|
HTTP::Request->new( 'PUT', |
3179
|
|
|
|
|
|
|
'http://upload.smugmug.com/' . $params->{FileName} ); |
3180
|
0
|
|
|
|
|
|
$request->content( $params->{ImageData} ); |
3181
|
0
|
|
|
|
|
|
$request->header( |
3182
|
|
|
|
|
|
|
'X-Smug-SessionID' => $params->{SessionID}, |
3183
|
|
|
|
|
|
|
'X-Smug-Version' => $API_VERSION, |
3184
|
|
|
|
|
|
|
'X-Smug-ResponseType' => 'JSON', |
3185
|
|
|
|
|
|
|
'X-Smug-FileName' => $params->{FileName}, |
3186
|
|
|
|
|
|
|
); |
3187
|
|
|
|
|
|
|
|
3188
|
0
|
|
|
|
|
|
my @optional_params = |
3189
|
|
|
|
|
|
|
qw/AlbumID ImageID Caption Keywords Latitude Longitude Altitude/; |
3190
|
0
|
|
|
|
|
|
for my $param (@optional_params) { |
3191
|
0
|
0
|
|
|
|
|
if ( defined $passed_params->{$param} ) { |
3192
|
0
|
|
|
|
|
|
$request->header( "X-Smug-$param" => $passed_params->{$param} ); |
3193
|
|
|
|
|
|
|
} |
3194
|
|
|
|
|
|
|
} |
3195
|
|
|
|
|
|
|
|
3196
|
0
|
|
|
|
|
|
my $response = $self->{ua}->request($request); |
3197
|
0
|
0
|
|
|
|
|
if ( $response->is_success ) { |
3198
|
0
|
|
|
|
|
|
return $self->{json}->decode( $response->content ); |
3199
|
|
|
|
|
|
|
} |
3200
|
|
|
|
|
|
|
else { |
3201
|
0
|
|
|
|
|
|
return $self->_construct_error( $response->status_line, |
3202
|
|
|
|
|
|
|
$ERROR_CODE->{HTTP_ERROR} ); |
3203
|
|
|
|
|
|
|
} |
3204
|
|
|
|
|
|
|
} |
3205
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
sub _get_request { |
3207
|
0
|
|
|
0
|
|
|
my ( $self, $method, $params ) = @_; |
3208
|
|
|
|
|
|
|
|
3209
|
0
|
|
|
|
|
|
my $response = |
3210
|
|
|
|
|
|
|
$self->{ua}->post( "$self->{sm_endpoint}?method=$method", $params ); |
3211
|
0
|
0
|
|
|
|
|
if ( $response->is_success ) { |
3212
|
0
|
|
|
|
|
|
return $self->{json}->decode( $response->content ); |
3213
|
|
|
|
|
|
|
} |
3214
|
|
|
|
|
|
|
else { |
3215
|
0
|
|
|
|
|
|
return $self->_construct_error( $response->status_line, |
3216
|
|
|
|
|
|
|
$ERROR_CODE->{HTTP_ERROR} ); |
3217
|
|
|
|
|
|
|
} |
3218
|
|
|
|
|
|
|
} |
3219
|
|
|
|
|
|
|
|
3220
|
|
|
|
|
|
|
sub _construct_error { |
3221
|
0
|
|
|
0
|
|
|
my ( $self, $message, $error_code ) = @_; |
3222
|
|
|
|
|
|
|
return ( |
3223
|
|
|
|
|
|
|
{ |
3224
|
0
|
|
|
|
|
|
stat => 'fail', |
3225
|
|
|
|
|
|
|
message => $message, |
3226
|
|
|
|
|
|
|
code => $error_code, |
3227
|
|
|
|
|
|
|
} |
3228
|
|
|
|
|
|
|
); |
3229
|
|
|
|
|
|
|
|
3230
|
|
|
|
|
|
|
} |
3231
|
|
|
|
|
|
|
|
3232
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
3233
|
|
|
|
|
|
|
|
3234
|
|
|
|
|
|
|
This section intentionally left blank. |
3235
|
|
|
|
|
|
|
|
3236
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
3237
|
|
|
|
|
|
|
|
3238
|
|
|
|
|
|
|
WWW::SmugMUG::API requires no special configuration or environment variables. |
3239
|
|
|
|
|
|
|
|
3240
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
3241
|
|
|
|
|
|
|
|
3242
|
|
|
|
|
|
|
JSON |
3243
|
|
|
|
|
|
|
LWP::UserAgent |
3244
|
|
|
|
|
|
|
|
3245
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
3246
|
|
|
|
|
|
|
|
3247
|
|
|
|
|
|
|
No known incompatibilities. |
3248
|
|
|
|
|
|
|
|
3249
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
3250
|
|
|
|
|
|
|
|
3251
|
|
|
|
|
|
|
No known bugs. |
3252
|
|
|
|
|
|
|
|
3253
|
|
|
|
|
|
|
=head1 SUPPORT |
3254
|
|
|
|
|
|
|
|
3255
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
3256
|
|
|
|
|
|
|
|
3257
|
|
|
|
|
|
|
perldoc WWW::SmugMug::API |
3258
|
|
|
|
|
|
|
|
3259
|
|
|
|
|
|
|
=head1 AUTHOR |
3260
|
|
|
|
|
|
|
|
3261
|
|
|
|
|
|
|
Paul Arthur, C<< >> |
3262
|
|
|
|
|
|
|
|
3263
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
3264
|
|
|
|
|
|
|
|
3265
|
|
|
|
|
|
|
This section intentionally left blank. |
3266
|
|
|
|
|
|
|
|
3267
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
3268
|
|
|
|
|
|
|
|
3269
|
|
|
|
|
|
|
Copyright 2008-2010 Paul Arthur MacIain, all rights reserved. |
3270
|
|
|
|
|
|
|
|
3271
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
3272
|
|
|
|
|
|
|
under the same terms as Perl itself. |
3273
|
|
|
|
|
|
|
|
3274
|
|
|
|
|
|
|
|
3275
|
|
|
|
|
|
|
=cut |
3276
|
|
|
|
|
|
|
|
3277
|
|
|
|
|
|
|
1; # End of WWW::SmugMug::API |