| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package AsposeStorageCloud::StorageApi; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.6.0; |
|
4
|
1
|
|
|
1
|
|
64693
|
use strict; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
37
|
|
|
5
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
40
|
|
|
6
|
1
|
|
|
1
|
|
713
|
use utf8; |
|
|
1
|
|
|
|
|
24
|
|
|
|
1
|
|
|
|
|
6
|
|
|
7
|
1
|
|
|
1
|
|
38
|
use Exporter; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
59
|
|
|
8
|
1
|
|
|
1
|
|
9
|
use Carp qw( croak ); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
65
|
|
|
9
|
1
|
|
|
1
|
|
595
|
use Log::Any qw($log); |
|
|
1
|
|
|
|
|
12440
|
|
|
|
1
|
|
|
|
|
8
|
|
|
10
|
1
|
|
|
1
|
|
3257
|
use File::Slurp; |
|
|
1
|
|
|
|
|
13846
|
|
|
|
1
|
|
|
|
|
65
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
369
|
use AsposeStorageCloud::ApiClient; |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
47
|
|
|
13
|
1
|
|
|
1
|
|
11
|
use AsposeStorageCloud::Configuration; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
14085
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $VERSION = '1.02'; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
|
18
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
|
19
|
0
|
0
|
|
|
|
|
my $default_api_client = $AsposeStorageCloud::Configuration::api_client ? $AsposeStorageCloud::Configuration::api_client : |
|
20
|
|
|
|
|
|
|
AsposeStorageCloud::ApiClient->new; |
|
21
|
0
|
|
|
|
|
|
my (%self) = ( |
|
22
|
|
|
|
|
|
|
'api_client' => $default_api_client, |
|
23
|
|
|
|
|
|
|
@_ |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
bless \%self, $class; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# |
|
31
|
|
|
|
|
|
|
# GetDiscUsage |
|
32
|
|
|
|
|
|
|
# |
|
33
|
|
|
|
|
|
|
# Check the disk usage of the current account. Parameters: storage - user's storage name. |
|
34
|
|
|
|
|
|
|
# |
|
35
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
36
|
|
|
|
|
|
|
# @return DiscUsageResponse |
|
37
|
|
|
|
|
|
|
# |
|
38
|
|
|
|
|
|
|
sub GetDiscUsage { |
|
39
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# parse inputs |
|
44
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/disc/?appSid={appSid}&storage={storage}'; |
|
45
|
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
47
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
48
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
49
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
50
|
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
52
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
53
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
54
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
57
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
58
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
59
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# query params |
|
64
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
65
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
66
|
|
|
|
|
|
|
}else{ |
|
67
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $_body_data; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# authentication setting, if any |
|
77
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# make the API Call |
|
80
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
81
|
|
|
|
|
|
|
$query_params, $form_params, |
|
82
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
83
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
84
|
0
|
|
|
|
|
|
return; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
88
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'DiscUsageResponse', $response->header('content-type')); |
|
92
|
0
|
|
|
|
|
|
return $_response_object; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
# |
|
96
|
|
|
|
|
|
|
# GetIsExist |
|
97
|
|
|
|
|
|
|
# |
|
98
|
|
|
|
|
|
|
# Check if a specific file or folder exists. Parameters: path - file or folder path e.g. /file.ext or /Folder1, versionID - file's version, storage - user's storage name. |
|
99
|
|
|
|
|
|
|
# |
|
100
|
|
|
|
|
|
|
# @param string $Path (required) |
|
101
|
|
|
|
|
|
|
# @param string $versionId (optional) |
|
102
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
103
|
|
|
|
|
|
|
# @return FileExistResponse |
|
104
|
|
|
|
|
|
|
# |
|
105
|
|
|
|
|
|
|
sub GetIsExist { |
|
106
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
110
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
111
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling GetIsExist"); |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# parse inputs |
|
116
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/exist/{path}/?appSid={appSid}&versionId={versionId}&storage={storage}'; |
|
117
|
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
119
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
120
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
121
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
122
|
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
124
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
125
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
126
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
129
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
130
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
131
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# query params |
|
136
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
137
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
138
|
|
|
|
|
|
|
}else{ |
|
139
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
140
|
|
|
|
|
|
|
}# query params |
|
141
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
142
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
143
|
|
|
|
|
|
|
}else{ |
|
144
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
145
|
|
|
|
|
|
|
}# query params |
|
146
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
147
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
148
|
|
|
|
|
|
|
}else{ |
|
149
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
my $_body_data; |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# authentication setting, if any |
|
159
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# make the API Call |
|
162
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
163
|
|
|
|
|
|
|
$query_params, $form_params, |
|
164
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
165
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
166
|
0
|
|
|
|
|
|
return; |
|
167
|
|
|
|
|
|
|
} |
|
168
|
|
|
|
|
|
|
|
|
169
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
170
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'FileExistResponse', $response->header('content-type')); |
|
174
|
0
|
|
|
|
|
|
return $_response_object; |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
} |
|
177
|
|
|
|
|
|
|
# |
|
178
|
|
|
|
|
|
|
# PutCopy |
|
179
|
|
|
|
|
|
|
# |
|
180
|
|
|
|
|
|
|
# Copy a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file's version, storage - user's source storage name, newdest - destination file path, destStorage - user's destination storage name. |
|
181
|
|
|
|
|
|
|
# |
|
182
|
|
|
|
|
|
|
# @param string $Path (required) |
|
183
|
|
|
|
|
|
|
# @param string $newdest (required) |
|
184
|
|
|
|
|
|
|
# @param file $file (required) |
|
185
|
|
|
|
|
|
|
# @param string $versionId (optional) |
|
186
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
187
|
|
|
|
|
|
|
# @param string $destStorage (optional) |
|
188
|
|
|
|
|
|
|
# @return ResponseMessage |
|
189
|
|
|
|
|
|
|
# |
|
190
|
|
|
|
|
|
|
sub PutCopy { |
|
191
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
195
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
196
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling PutCopy"); |
|
197
|
|
|
|
|
|
|
} |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# verify the required parameter 'newdest' is set |
|
200
|
0
|
0
|
|
|
|
|
unless (exists $args{'newdest'}) { |
|
201
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'newdest' when calling PutCopy"); |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
# verify the required parameter 'file' is set |
|
205
|
0
|
0
|
|
|
|
|
unless (exists $args{'file'}) { |
|
206
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'file' when calling PutCopy"); |
|
207
|
|
|
|
|
|
|
} |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# parse inputs |
|
211
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/file/{path}/?appSid={appSid}&newdest={newdest}&versionId={versionId}&storage={storage}&destStorage={destStorage}'; |
|
212
|
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
214
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
215
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
216
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
217
|
|
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
219
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
220
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
221
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
224
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
225
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
226
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
227
|
|
|
|
|
|
|
} |
|
228
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data'); |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
# query params |
|
231
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
232
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
233
|
|
|
|
|
|
|
}else{ |
|
234
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
235
|
|
|
|
|
|
|
}# query params |
|
236
|
0
|
0
|
|
|
|
|
if ( exists $args{'newdest'}) { |
|
237
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{newdest}\E/$args{'newdest'}/g; |
|
238
|
|
|
|
|
|
|
}else{ |
|
239
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]newdest.*?(?=&|\?|$)//g; |
|
240
|
|
|
|
|
|
|
}# query params |
|
241
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
242
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
243
|
|
|
|
|
|
|
}else{ |
|
244
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
245
|
|
|
|
|
|
|
}# query params |
|
246
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
247
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
248
|
|
|
|
|
|
|
}else{ |
|
249
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
250
|
|
|
|
|
|
|
}# query params |
|
251
|
0
|
0
|
|
|
|
|
if ( exists $args{'destStorage'}) { |
|
252
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{destStorage}\E/$args{'destStorage'}/g; |
|
253
|
|
|
|
|
|
|
}else{ |
|
254
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]destStorage.*?(?=&|\?|$)//g; |
|
255
|
|
|
|
|
|
|
} |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
|
|
258
|
0
|
|
|
|
|
|
my $_body_data; |
|
259
|
|
|
|
|
|
|
# form params |
|
260
|
0
|
0
|
|
|
|
|
if ( exists $args{'file'} ) { |
|
261
|
|
|
|
|
|
|
|
|
262
|
0
|
|
|
|
|
|
$_body_data = read_file( $args{'file'} , binmode => ':raw' ); |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
} |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# authentication setting, if any |
|
270
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# make the API Call |
|
273
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
274
|
|
|
|
|
|
|
$query_params, $form_params, |
|
275
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
276
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
277
|
0
|
|
|
|
|
|
return; |
|
278
|
|
|
|
|
|
|
} |
|
279
|
|
|
|
|
|
|
|
|
280
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
281
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
282
|
|
|
|
|
|
|
} |
|
283
|
|
|
|
|
|
|
|
|
284
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
285
|
0
|
|
|
|
|
|
return $_response_object; |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
# |
|
289
|
|
|
|
|
|
|
# GetDownload |
|
290
|
|
|
|
|
|
|
# |
|
291
|
|
|
|
|
|
|
# Download a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. |
|
292
|
|
|
|
|
|
|
# |
|
293
|
|
|
|
|
|
|
# @param string $Path (required) |
|
294
|
|
|
|
|
|
|
# @param string $versionId (optional) |
|
295
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
296
|
|
|
|
|
|
|
# @return ResponseMessage |
|
297
|
|
|
|
|
|
|
# |
|
298
|
|
|
|
|
|
|
sub GetDownload { |
|
299
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
303
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
304
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling GetDownload"); |
|
305
|
|
|
|
|
|
|
} |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
# parse inputs |
|
309
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/file/{path}/?appSid={appSid}&versionId={versionId}&storage={storage}'; |
|
310
|
|
|
|
|
|
|
|
|
311
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
312
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
313
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
314
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
315
|
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
317
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
318
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
319
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
322
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
|
323
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
324
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
325
|
|
|
|
|
|
|
} |
|
326
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
# query params |
|
329
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
330
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
331
|
|
|
|
|
|
|
}else{ |
|
332
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
333
|
|
|
|
|
|
|
}# query params |
|
334
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
335
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
336
|
|
|
|
|
|
|
}else{ |
|
337
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
338
|
|
|
|
|
|
|
}# query params |
|
339
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
340
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
341
|
|
|
|
|
|
|
}else{ |
|
342
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
343
|
|
|
|
|
|
|
} |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
|
|
346
|
0
|
|
|
|
|
|
my $_body_data; |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
# authentication setting, if any |
|
352
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
# make the API Call |
|
355
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
356
|
|
|
|
|
|
|
$query_params, $form_params, |
|
357
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
358
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
359
|
0
|
|
|
|
|
|
return; |
|
360
|
|
|
|
|
|
|
} |
|
361
|
|
|
|
|
|
|
|
|
362
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
363
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
364
|
|
|
|
|
|
|
} |
|
365
|
|
|
|
|
|
|
|
|
366
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
367
|
0
|
|
|
|
|
|
return $_response_object; |
|
368
|
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
} |
|
370
|
|
|
|
|
|
|
# |
|
371
|
|
|
|
|
|
|
# PutCreate |
|
372
|
|
|
|
|
|
|
# |
|
373
|
|
|
|
|
|
|
# Upload a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file's version, storage - user's source storage name, newdest - destination file path, destStorage - user's destination storage name. |
|
374
|
|
|
|
|
|
|
# |
|
375
|
|
|
|
|
|
|
# @param string $Path (required) |
|
376
|
|
|
|
|
|
|
# @param file $file (required) |
|
377
|
|
|
|
|
|
|
# @param string $versionId (optional) |
|
378
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
379
|
|
|
|
|
|
|
# @return ResponseMessage |
|
380
|
|
|
|
|
|
|
# |
|
381
|
|
|
|
|
|
|
sub PutCreate { |
|
382
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
386
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
387
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling PutCreate"); |
|
388
|
|
|
|
|
|
|
} |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
# verify the required parameter 'file' is set |
|
391
|
0
|
0
|
|
|
|
|
unless (exists $args{'file'}) { |
|
392
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'file' when calling PutCreate"); |
|
393
|
|
|
|
|
|
|
} |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
# parse inputs |
|
397
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/file/{path}/?appSid={appSid}&versionId={versionId}&storage={storage}'; |
|
398
|
|
|
|
|
|
|
|
|
399
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
400
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
401
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
402
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
403
|
|
|
|
|
|
|
|
|
404
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
405
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
406
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
407
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
408
|
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
410
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
411
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
412
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
413
|
|
|
|
|
|
|
} |
|
414
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data'); |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
# query params |
|
417
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
418
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
419
|
|
|
|
|
|
|
}else{ |
|
420
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
421
|
|
|
|
|
|
|
}# query params |
|
422
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
423
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
424
|
|
|
|
|
|
|
}else{ |
|
425
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
426
|
|
|
|
|
|
|
}# query params |
|
427
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
428
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
429
|
|
|
|
|
|
|
}else{ |
|
430
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
431
|
|
|
|
|
|
|
} |
|
432
|
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
|
|
434
|
0
|
|
|
|
|
|
my $_body_data; |
|
435
|
|
|
|
|
|
|
# form params |
|
436
|
0
|
0
|
|
|
|
|
if ( exists $args{'file'} ) { |
|
437
|
|
|
|
|
|
|
|
|
438
|
0
|
|
|
|
|
|
$_body_data = read_file( $args{'file'} , binmode => ':raw' ); |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
} |
|
442
|
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
# authentication setting, if any |
|
446
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
# make the API Call |
|
449
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
450
|
|
|
|
|
|
|
$query_params, $form_params, |
|
451
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
452
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
453
|
0
|
|
|
|
|
|
return; |
|
454
|
|
|
|
|
|
|
} |
|
455
|
|
|
|
|
|
|
|
|
456
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
457
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
458
|
|
|
|
|
|
|
} |
|
459
|
|
|
|
|
|
|
|
|
460
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
461
|
0
|
|
|
|
|
|
return $_response_object; |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
} |
|
464
|
|
|
|
|
|
|
# |
|
465
|
|
|
|
|
|
|
# DeleteFile |
|
466
|
|
|
|
|
|
|
# |
|
467
|
|
|
|
|
|
|
# Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. |
|
468
|
|
|
|
|
|
|
# |
|
469
|
|
|
|
|
|
|
# @param string $Path (required) |
|
470
|
|
|
|
|
|
|
# @param string $versionId (optional) |
|
471
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
472
|
|
|
|
|
|
|
# @return RemoveFileResponse |
|
473
|
|
|
|
|
|
|
# |
|
474
|
|
|
|
|
|
|
sub DeleteFile { |
|
475
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
476
|
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
479
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
480
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling DeleteFile"); |
|
481
|
|
|
|
|
|
|
} |
|
482
|
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
# parse inputs |
|
485
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/file/{path}/?appSid={appSid}&versionId={versionId}&storage={storage}'; |
|
486
|
|
|
|
|
|
|
|
|
487
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
488
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
489
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
490
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
491
|
|
|
|
|
|
|
|
|
492
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
|
493
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
494
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
495
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
496
|
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
498
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
499
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
500
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
501
|
|
|
|
|
|
|
} |
|
502
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
503
|
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
# query params |
|
505
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
506
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
507
|
|
|
|
|
|
|
}else{ |
|
508
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
509
|
|
|
|
|
|
|
}# query params |
|
510
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
511
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
512
|
|
|
|
|
|
|
}else{ |
|
513
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
514
|
|
|
|
|
|
|
}# query params |
|
515
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
516
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
517
|
|
|
|
|
|
|
}else{ |
|
518
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
519
|
|
|
|
|
|
|
} |
|
520
|
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
|
|
522
|
0
|
|
|
|
|
|
my $_body_data; |
|
523
|
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
# authentication setting, if any |
|
528
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
529
|
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
# make the API Call |
|
531
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
532
|
|
|
|
|
|
|
$query_params, $form_params, |
|
533
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
534
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
535
|
0
|
|
|
|
|
|
return; |
|
536
|
|
|
|
|
|
|
} |
|
537
|
|
|
|
|
|
|
|
|
538
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
539
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
540
|
|
|
|
|
|
|
} |
|
541
|
|
|
|
|
|
|
|
|
542
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'RemoveFileResponse', $response->header('content-type')); |
|
543
|
0
|
|
|
|
|
|
return $_response_object; |
|
544
|
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
} |
|
546
|
|
|
|
|
|
|
# |
|
547
|
|
|
|
|
|
|
# PostMoveFile |
|
548
|
|
|
|
|
|
|
# |
|
549
|
|
|
|
|
|
|
# Move a specific file. |
|
550
|
|
|
|
|
|
|
# |
|
551
|
|
|
|
|
|
|
# @param string $src source file path e.g. /file.ext (required) |
|
552
|
|
|
|
|
|
|
# @param string $dest (required) |
|
553
|
|
|
|
|
|
|
# @param string $versionId source file's version, (optional) |
|
554
|
|
|
|
|
|
|
# @param string $storage user's source storage name (optional) |
|
555
|
|
|
|
|
|
|
# @param string $destStorage user's destination storage name (optional) |
|
556
|
|
|
|
|
|
|
# @return MoveFileResponse |
|
557
|
|
|
|
|
|
|
# |
|
558
|
|
|
|
|
|
|
sub PostMoveFile { |
|
559
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
560
|
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
# verify the required parameter 'src' is set |
|
563
|
0
|
0
|
|
|
|
|
unless (exists $args{'src'}) { |
|
564
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'src' when calling PostMoveFile"); |
|
565
|
|
|
|
|
|
|
} |
|
566
|
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
# verify the required parameter 'dest' is set |
|
568
|
0
|
0
|
|
|
|
|
unless (exists $args{'dest'}) { |
|
569
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'dest' when calling PostMoveFile"); |
|
570
|
|
|
|
|
|
|
} |
|
571
|
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
# parse inputs |
|
574
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/file/{src}/?dest={dest}&appSid={appSid}&versionId={versionId}&storage={storage}&destStorage={destStorage}'; |
|
575
|
|
|
|
|
|
|
|
|
576
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
577
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
578
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
579
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
580
|
|
|
|
|
|
|
|
|
581
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
|
582
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
583
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
584
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
585
|
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
587
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
588
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
589
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
590
|
|
|
|
|
|
|
} |
|
591
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
592
|
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
# query params |
|
594
|
0
|
0
|
|
|
|
|
if ( exists $args{'src'}) { |
|
595
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{src}\E/$args{'src'}/g; |
|
596
|
|
|
|
|
|
|
}else{ |
|
597
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]src.*?(?=&|\?|$)//g; |
|
598
|
|
|
|
|
|
|
}# query params |
|
599
|
0
|
0
|
|
|
|
|
if ( exists $args{'dest'}) { |
|
600
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{dest}\E/$args{'dest'}/g; |
|
601
|
|
|
|
|
|
|
}else{ |
|
602
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]dest.*?(?=&|\?|$)//g; |
|
603
|
|
|
|
|
|
|
}# query params |
|
604
|
0
|
0
|
|
|
|
|
if ( exists $args{'versionId'}) { |
|
605
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{versionId}\E/$args{'versionId'}/g; |
|
606
|
|
|
|
|
|
|
}else{ |
|
607
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]versionId.*?(?=&|\?|$)//g; |
|
608
|
|
|
|
|
|
|
}# query params |
|
609
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
610
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
611
|
|
|
|
|
|
|
}else{ |
|
612
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
613
|
|
|
|
|
|
|
}# query params |
|
614
|
0
|
0
|
|
|
|
|
if ( exists $args{'destStorage'}) { |
|
615
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{destStorage}\E/$args{'destStorage'}/g; |
|
616
|
|
|
|
|
|
|
}else{ |
|
617
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]destStorage.*?(?=&|\?|$)//g; |
|
618
|
|
|
|
|
|
|
} |
|
619
|
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
|
|
621
|
0
|
|
|
|
|
|
my $_body_data; |
|
622
|
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
# authentication setting, if any |
|
627
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
# make the API Call |
|
630
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
631
|
|
|
|
|
|
|
$query_params, $form_params, |
|
632
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
633
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
634
|
0
|
|
|
|
|
|
return; |
|
635
|
|
|
|
|
|
|
} |
|
636
|
|
|
|
|
|
|
|
|
637
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
638
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
639
|
|
|
|
|
|
|
} |
|
640
|
|
|
|
|
|
|
|
|
641
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'MoveFileResponse', $response->header('content-type')); |
|
642
|
0
|
|
|
|
|
|
return $_response_object; |
|
643
|
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
} |
|
645
|
|
|
|
|
|
|
# |
|
646
|
|
|
|
|
|
|
# PutCopyFolder |
|
647
|
|
|
|
|
|
|
# |
|
648
|
|
|
|
|
|
|
# Copy a folder. Parameters: path - source folder path e.g. /Folder1, storage - user's source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user's destination storage name. |
|
649
|
|
|
|
|
|
|
# |
|
650
|
|
|
|
|
|
|
# @param string $Path (required) |
|
651
|
|
|
|
|
|
|
# @param string $newdest (required) |
|
652
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
653
|
|
|
|
|
|
|
# @param string $destStorage (optional) |
|
654
|
|
|
|
|
|
|
# @return ResponseMessage |
|
655
|
|
|
|
|
|
|
# |
|
656
|
|
|
|
|
|
|
sub PutCopyFolder { |
|
657
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
658
|
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
661
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
662
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling PutCopyFolder"); |
|
663
|
|
|
|
|
|
|
} |
|
664
|
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
# verify the required parameter 'newdest' is set |
|
666
|
0
|
0
|
|
|
|
|
unless (exists $args{'newdest'}) { |
|
667
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'newdest' when calling PutCopyFolder"); |
|
668
|
|
|
|
|
|
|
} |
|
669
|
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
# parse inputs |
|
672
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/folder/{path}/?appSid={appSid}&newdest={newdest}&storage={storage}&destStorage={destStorage}'; |
|
673
|
|
|
|
|
|
|
|
|
674
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
675
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
676
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
677
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
678
|
|
|
|
|
|
|
|
|
679
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
680
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
681
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
682
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
683
|
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
685
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
686
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
687
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
688
|
|
|
|
|
|
|
} |
|
689
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
690
|
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
# query params |
|
692
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
693
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
694
|
|
|
|
|
|
|
}else{ |
|
695
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
696
|
|
|
|
|
|
|
}# query params |
|
697
|
0
|
0
|
|
|
|
|
if ( exists $args{'newdest'}) { |
|
698
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{newdest}\E/$args{'newdest'}/g; |
|
699
|
|
|
|
|
|
|
}else{ |
|
700
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]newdest.*?(?=&|\?|$)//g; |
|
701
|
|
|
|
|
|
|
}# query params |
|
702
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
703
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
704
|
|
|
|
|
|
|
}else{ |
|
705
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
706
|
|
|
|
|
|
|
}# query params |
|
707
|
0
|
0
|
|
|
|
|
if ( exists $args{'destStorage'}) { |
|
708
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{destStorage}\E/$args{'destStorage'}/g; |
|
709
|
|
|
|
|
|
|
}else{ |
|
710
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]destStorage.*?(?=&|\?|$)//g; |
|
711
|
|
|
|
|
|
|
} |
|
712
|
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
|
|
714
|
0
|
|
|
|
|
|
my $_body_data; |
|
715
|
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
# authentication setting, if any |
|
720
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
721
|
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
# make the API Call |
|
723
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
724
|
|
|
|
|
|
|
$query_params, $form_params, |
|
725
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
726
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
727
|
0
|
|
|
|
|
|
return; |
|
728
|
|
|
|
|
|
|
} |
|
729
|
|
|
|
|
|
|
|
|
730
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
731
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
732
|
|
|
|
|
|
|
} |
|
733
|
|
|
|
|
|
|
|
|
734
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
735
|
0
|
|
|
|
|
|
return $_response_object; |
|
736
|
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
} |
|
738
|
|
|
|
|
|
|
# |
|
739
|
|
|
|
|
|
|
# GetListFiles |
|
740
|
|
|
|
|
|
|
# |
|
741
|
|
|
|
|
|
|
# Get the file listing of a specific folder. Parametres: path - start with name of storage e.g. root folder '/'or some folder '/folder1/..', storage - user's storage name. |
|
742
|
|
|
|
|
|
|
# |
|
743
|
|
|
|
|
|
|
# @param string $Path (optional) |
|
744
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
745
|
|
|
|
|
|
|
# @return ResponseMessage |
|
746
|
|
|
|
|
|
|
# |
|
747
|
|
|
|
|
|
|
sub GetListFiles { |
|
748
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
# parse inputs |
|
753
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/folder/{path}/?appSid={appSid}&storage={storage}'; |
|
754
|
|
|
|
|
|
|
|
|
755
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
756
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
757
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
758
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
759
|
|
|
|
|
|
|
|
|
760
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
761
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
762
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
763
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
764
|
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
766
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
767
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
768
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
769
|
|
|
|
|
|
|
} |
|
770
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
771
|
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
# query params |
|
773
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
774
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
775
|
|
|
|
|
|
|
}else{ |
|
776
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
777
|
|
|
|
|
|
|
}# query params |
|
778
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
779
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
780
|
|
|
|
|
|
|
}else{ |
|
781
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
782
|
|
|
|
|
|
|
} |
|
783
|
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
|
|
785
|
0
|
|
|
|
|
|
my $_body_data; |
|
786
|
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
|
|
789
|
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
# authentication setting, if any |
|
791
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
792
|
|
|
|
|
|
|
|
|
793
|
|
|
|
|
|
|
# make the API Call |
|
794
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
795
|
|
|
|
|
|
|
$query_params, $form_params, |
|
796
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
797
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
798
|
0
|
|
|
|
|
|
return; |
|
799
|
|
|
|
|
|
|
} |
|
800
|
|
|
|
|
|
|
|
|
801
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
802
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
803
|
|
|
|
|
|
|
} |
|
804
|
|
|
|
|
|
|
|
|
805
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
806
|
0
|
|
|
|
|
|
return $_response_object; |
|
807
|
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
} |
|
809
|
|
|
|
|
|
|
# |
|
810
|
|
|
|
|
|
|
# PutCreateFolder |
|
811
|
|
|
|
|
|
|
# |
|
812
|
|
|
|
|
|
|
# Create the folder. Parameters: path - source folder path e.g. /Folder1, storage - user's source storage name, newdest - destination folder path e.g. /Folder2, destStorage - user's destination storage name. |
|
813
|
|
|
|
|
|
|
# |
|
814
|
|
|
|
|
|
|
# @param string $Path (required) |
|
815
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
816
|
|
|
|
|
|
|
# @param string $destStorage (optional) |
|
817
|
|
|
|
|
|
|
# @return ResponseMessage |
|
818
|
|
|
|
|
|
|
# |
|
819
|
|
|
|
|
|
|
sub PutCreateFolder { |
|
820
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
821
|
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
824
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
825
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling PutCreateFolder"); |
|
826
|
|
|
|
|
|
|
} |
|
827
|
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
# parse inputs |
|
830
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/folder/{path}/?appSid={appSid}&storage={storage}&destStorage={destStorage}'; |
|
831
|
|
|
|
|
|
|
|
|
832
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
833
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
834
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
835
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
836
|
|
|
|
|
|
|
|
|
837
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
838
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
839
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
840
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
841
|
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
843
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
844
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
845
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
846
|
|
|
|
|
|
|
} |
|
847
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
848
|
|
|
|
|
|
|
|
|
849
|
|
|
|
|
|
|
# query params |
|
850
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
851
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
852
|
|
|
|
|
|
|
}else{ |
|
853
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
854
|
|
|
|
|
|
|
}# query params |
|
855
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
856
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
857
|
|
|
|
|
|
|
}else{ |
|
858
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
859
|
|
|
|
|
|
|
}# query params |
|
860
|
0
|
0
|
|
|
|
|
if ( exists $args{'destStorage'}) { |
|
861
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{destStorage}\E/$args{'destStorage'}/g; |
|
862
|
|
|
|
|
|
|
}else{ |
|
863
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]destStorage.*?(?=&|\?|$)//g; |
|
864
|
|
|
|
|
|
|
} |
|
865
|
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
|
|
867
|
0
|
|
|
|
|
|
my $_body_data; |
|
868
|
|
|
|
|
|
|
|
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
|
|
871
|
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
# authentication setting, if any |
|
873
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
874
|
|
|
|
|
|
|
|
|
875
|
|
|
|
|
|
|
# make the API Call |
|
876
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
877
|
|
|
|
|
|
|
$query_params, $form_params, |
|
878
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
879
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
880
|
0
|
|
|
|
|
|
return; |
|
881
|
|
|
|
|
|
|
} |
|
882
|
|
|
|
|
|
|
|
|
883
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
884
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
885
|
|
|
|
|
|
|
} |
|
886
|
|
|
|
|
|
|
|
|
887
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
|
888
|
0
|
|
|
|
|
|
return $_response_object; |
|
889
|
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
} |
|
891
|
|
|
|
|
|
|
# |
|
892
|
|
|
|
|
|
|
# DeleteFolder |
|
893
|
|
|
|
|
|
|
# |
|
894
|
|
|
|
|
|
|
# Remove a specific folder. Parameters: path - folder path e.g. /Folder1, storage - user's storage name, recursive - is subfolders and files must be deleted for specified path. |
|
895
|
|
|
|
|
|
|
# |
|
896
|
|
|
|
|
|
|
# @param string $Path (required) |
|
897
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
898
|
|
|
|
|
|
|
# @param boolean $recursive (optional) |
|
899
|
|
|
|
|
|
|
# @return RemoveFolderResponse |
|
900
|
|
|
|
|
|
|
# |
|
901
|
|
|
|
|
|
|
sub DeleteFolder { |
|
902
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
903
|
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
906
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
907
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling DeleteFolder"); |
|
908
|
|
|
|
|
|
|
} |
|
909
|
|
|
|
|
|
|
|
|
910
|
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
# parse inputs |
|
912
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/folder/{path}/?appSid={appSid}&storage={storage}&recursive={recursive}'; |
|
913
|
|
|
|
|
|
|
|
|
914
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
915
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
916
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
917
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
918
|
|
|
|
|
|
|
|
|
919
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
|
920
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
921
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
922
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
923
|
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
925
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
926
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
927
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
928
|
|
|
|
|
|
|
} |
|
929
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
930
|
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
# query params |
|
932
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
933
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
934
|
|
|
|
|
|
|
}else{ |
|
935
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
936
|
|
|
|
|
|
|
}# query params |
|
937
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
938
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
939
|
|
|
|
|
|
|
}else{ |
|
940
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
941
|
|
|
|
|
|
|
}# query params |
|
942
|
0
|
0
|
|
|
|
|
if ( exists $args{'recursive'}) { |
|
943
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{recursive}\E/$args{'recursive'}/g; |
|
944
|
|
|
|
|
|
|
}else{ |
|
945
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]recursive.*?(?=&|\?|$)//g; |
|
946
|
|
|
|
|
|
|
} |
|
947
|
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
|
|
949
|
0
|
|
|
|
|
|
my $_body_data; |
|
950
|
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
# authentication setting, if any |
|
955
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
956
|
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
# make the API Call |
|
958
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
959
|
|
|
|
|
|
|
$query_params, $form_params, |
|
960
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
961
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
962
|
0
|
|
|
|
|
|
return; |
|
963
|
|
|
|
|
|
|
} |
|
964
|
|
|
|
|
|
|
|
|
965
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
966
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
967
|
|
|
|
|
|
|
} |
|
968
|
|
|
|
|
|
|
|
|
969
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'RemoveFolderResponse', $response->header('content-type')); |
|
970
|
0
|
|
|
|
|
|
return $_response_object; |
|
971
|
|
|
|
|
|
|
|
|
972
|
|
|
|
|
|
|
} |
|
973
|
|
|
|
|
|
|
# |
|
974
|
|
|
|
|
|
|
# PostMoveFolder |
|
975
|
|
|
|
|
|
|
# |
|
976
|
|
|
|
|
|
|
# Move a specific folder. Parameters: src - source folder path e.g. /Folder1, storage - user's source storage name, dest - destination folder path e.g. /Folder2, destStorage - user's destination storage name. |
|
977
|
|
|
|
|
|
|
# |
|
978
|
|
|
|
|
|
|
# @param string $src (required) |
|
979
|
|
|
|
|
|
|
# @param string $dest (required) |
|
980
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
981
|
|
|
|
|
|
|
# @param string $destStorage (optional) |
|
982
|
|
|
|
|
|
|
# @return MoveFolderResponse |
|
983
|
|
|
|
|
|
|
# |
|
984
|
|
|
|
|
|
|
sub PostMoveFolder { |
|
985
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
986
|
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
# verify the required parameter 'src' is set |
|
989
|
0
|
0
|
|
|
|
|
unless (exists $args{'src'}) { |
|
990
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'src' when calling PostMoveFolder"); |
|
991
|
|
|
|
|
|
|
} |
|
992
|
|
|
|
|
|
|
|
|
993
|
|
|
|
|
|
|
# verify the required parameter 'dest' is set |
|
994
|
0
|
0
|
|
|
|
|
unless (exists $args{'dest'}) { |
|
995
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'dest' when calling PostMoveFolder"); |
|
996
|
|
|
|
|
|
|
} |
|
997
|
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
# parse inputs |
|
1000
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/folder/{src}/?dest={dest}&appSid={appSid}&storage={storage}&destStorage={destStorage}'; |
|
1001
|
|
|
|
|
|
|
|
|
1002
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
1003
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
1004
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
1005
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
1006
|
|
|
|
|
|
|
|
|
1007
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
|
1008
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
1009
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
1010
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
1011
|
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
1013
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
1014
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
1015
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
1016
|
|
|
|
|
|
|
} |
|
1017
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
1018
|
|
|
|
|
|
|
|
|
1019
|
|
|
|
|
|
|
# query params |
|
1020
|
0
|
0
|
|
|
|
|
if ( exists $args{'src'}) { |
|
1021
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{src}\E/$args{'src'}/g; |
|
1022
|
|
|
|
|
|
|
}else{ |
|
1023
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]src.*?(?=&|\?|$)//g; |
|
1024
|
|
|
|
|
|
|
}# query params |
|
1025
|
0
|
0
|
|
|
|
|
if ( exists $args{'dest'}) { |
|
1026
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{dest}\E/$args{'dest'}/g; |
|
1027
|
|
|
|
|
|
|
}else{ |
|
1028
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]dest.*?(?=&|\?|$)//g; |
|
1029
|
|
|
|
|
|
|
}# query params |
|
1030
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
1031
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
1032
|
|
|
|
|
|
|
}else{ |
|
1033
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
1034
|
|
|
|
|
|
|
}# query params |
|
1035
|
0
|
0
|
|
|
|
|
if ( exists $args{'destStorage'}) { |
|
1036
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{destStorage}\E/$args{'destStorage'}/g; |
|
1037
|
|
|
|
|
|
|
}else{ |
|
1038
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]destStorage.*?(?=&|\?|$)//g; |
|
1039
|
|
|
|
|
|
|
} |
|
1040
|
|
|
|
|
|
|
|
|
1041
|
|
|
|
|
|
|
|
|
1042
|
0
|
|
|
|
|
|
my $_body_data; |
|
1043
|
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
|
|
1045
|
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
|
|
1047
|
|
|
|
|
|
|
# authentication setting, if any |
|
1048
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
1049
|
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
# make the API Call |
|
1051
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
1052
|
|
|
|
|
|
|
$query_params, $form_params, |
|
1053
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
1054
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
1055
|
0
|
|
|
|
|
|
return; |
|
1056
|
|
|
|
|
|
|
} |
|
1057
|
|
|
|
|
|
|
|
|
1058
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
1059
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
1060
|
|
|
|
|
|
|
} |
|
1061
|
|
|
|
|
|
|
|
|
1062
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'MoveFolderResponse', $response->header('content-type')); |
|
1063
|
0
|
|
|
|
|
|
return $_response_object; |
|
1064
|
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
} |
|
1066
|
|
|
|
|
|
|
# |
|
1067
|
|
|
|
|
|
|
# GetListFileVersions |
|
1068
|
|
|
|
|
|
|
# |
|
1069
|
|
|
|
|
|
|
# Get the file's versions list. Parameters: path - file path e.g. /file.ext or /Folder1/file.ext, storage - user's storage name. |
|
1070
|
|
|
|
|
|
|
# |
|
1071
|
|
|
|
|
|
|
# @param string $Path (required) |
|
1072
|
|
|
|
|
|
|
# @param string $storage (optional) |
|
1073
|
|
|
|
|
|
|
# @return FileVersionsResponse |
|
1074
|
|
|
|
|
|
|
# |
|
1075
|
|
|
|
|
|
|
sub GetListFileVersions { |
|
1076
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
1077
|
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
|
|
1079
|
|
|
|
|
|
|
# verify the required parameter 'Path' is set |
|
1080
|
0
|
0
|
|
|
|
|
unless (exists $args{'Path'}) { |
|
1081
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'Path' when calling GetListFileVersions"); |
|
1082
|
|
|
|
|
|
|
} |
|
1083
|
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
|
# parse inputs |
|
1086
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/version/{path}/?appSid={appSid}&storage={storage}'; |
|
1087
|
|
|
|
|
|
|
|
|
1088
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
1089
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
1090
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
1091
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
1092
|
|
|
|
|
|
|
|
|
1093
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
1094
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
1095
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
1096
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
1097
|
|
|
|
|
|
|
|
|
1098
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
1099
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
1100
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
1101
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
1102
|
|
|
|
|
|
|
} |
|
1103
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
1104
|
|
|
|
|
|
|
|
|
1105
|
|
|
|
|
|
|
# query params |
|
1106
|
0
|
0
|
|
|
|
|
if ( exists $args{'Path'}) { |
|
1107
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{Path}\E/$args{'Path'}/g; |
|
1108
|
|
|
|
|
|
|
}else{ |
|
1109
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]Path.*?(?=&|\?|$)//g; |
|
1110
|
|
|
|
|
|
|
}# query params |
|
1111
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
|
1112
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
|
1113
|
|
|
|
|
|
|
}else{ |
|
1114
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
|
1115
|
|
|
|
|
|
|
} |
|
1116
|
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
|
|
1118
|
0
|
|
|
|
|
|
my $_body_data; |
|
1119
|
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
# authentication setting, if any |
|
1124
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
1125
|
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
# make the API Call |
|
1127
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
1128
|
|
|
|
|
|
|
$query_params, $form_params, |
|
1129
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
1130
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
1131
|
0
|
|
|
|
|
|
return; |
|
1132
|
|
|
|
|
|
|
} |
|
1133
|
|
|
|
|
|
|
|
|
1134
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
1135
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
1136
|
|
|
|
|
|
|
} |
|
1137
|
|
|
|
|
|
|
|
|
1138
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'FileVersionsResponse', $response->header('content-type')); |
|
1139
|
0
|
|
|
|
|
|
return $_response_object; |
|
1140
|
|
|
|
|
|
|
|
|
1141
|
|
|
|
|
|
|
} |
|
1142
|
|
|
|
|
|
|
# |
|
1143
|
|
|
|
|
|
|
# GetIsStorageExist |
|
1144
|
|
|
|
|
|
|
# |
|
1145
|
|
|
|
|
|
|
# Check if a specific storage exists. |
|
1146
|
|
|
|
|
|
|
# |
|
1147
|
|
|
|
|
|
|
# @param string $name Storage name (required) |
|
1148
|
|
|
|
|
|
|
# @return StorageExistResponse |
|
1149
|
|
|
|
|
|
|
# |
|
1150
|
|
|
|
|
|
|
sub GetIsStorageExist { |
|
1151
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
|
1152
|
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
|
1155
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
|
1156
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling GetIsStorageExist"); |
|
1157
|
|
|
|
|
|
|
} |
|
1158
|
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
# parse inputs |
|
1161
|
0
|
|
|
|
|
|
my $_resource_path = '/storage/{name}/exist/?appSid={appSid}'; |
|
1162
|
|
|
|
|
|
|
|
|
1163
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
|
1164
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
|
1165
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}"/g; |
|
1166
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
|
1167
|
|
|
|
|
|
|
|
|
1168
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
1169
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
1170
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
1171
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
1172
|
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
1174
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
|
1175
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
1176
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
1177
|
|
|
|
|
|
|
} |
|
1178
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
|
1179
|
|
|
|
|
|
|
|
|
1180
|
|
|
|
|
|
|
# query params |
|
1181
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
|
1182
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
|
1183
|
|
|
|
|
|
|
}else{ |
|
1184
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
|
1185
|
|
|
|
|
|
|
} |
|
1186
|
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
|
|
1188
|
0
|
|
|
|
|
|
my $_body_data; |
|
1189
|
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
# authentication setting, if any |
|
1194
|
0
|
|
|
|
|
|
my $auth_settings = []; |
|
1195
|
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
# make the API Call |
|
1197
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
|
1198
|
|
|
|
|
|
|
$query_params, $form_params, |
|
1199
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
|
1200
|
0
|
0
|
|
|
|
|
if (!$response) { |
|
1201
|
0
|
|
|
|
|
|
return; |
|
1202
|
|
|
|
|
|
|
} |
|
1203
|
|
|
|
|
|
|
|
|
1204
|
0
|
0
|
|
|
|
|
if($AsposeStorageCloud::Configuration::debug){ |
|
1205
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
|
1206
|
|
|
|
|
|
|
} |
|
1207
|
|
|
|
|
|
|
|
|
1208
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'StorageExistResponse', $response->header('content-type')); |
|
1209
|
0
|
|
|
|
|
|
return $_response_object; |
|
1210
|
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
} |
|
1212
|
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
1; |