line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AsposeEmailCloud::EmailApi; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.6.0; |
4
|
1
|
|
|
1
|
|
161658
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
18
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
8
|
1
|
|
|
1
|
|
9
|
use Carp qw( croak ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
61
|
|
9
|
1
|
|
|
1
|
|
5
|
use Log::Any qw($log); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
10
|
1
|
|
|
1
|
|
340
|
use File::Slurp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
264
|
use AsposeEmailCloud::ApiClient; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
13
|
1
|
|
|
1
|
|
6
|
use AsposeEmailCloud::Configuration; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10498
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $VERSION = '1.03'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
19
|
0
|
0
|
|
|
|
|
my $default_api_client = $AsposeEmailCloud::Configuration::api_client ? $AsposeEmailCloud::Configuration::api_client : |
20
|
|
|
|
|
|
|
AsposeEmailCloud::ApiClient->new; |
21
|
0
|
|
|
|
|
|
my (%self) = ( |
22
|
|
|
|
|
|
|
'api_client' => $default_api_client, |
23
|
|
|
|
|
|
|
@_ |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
#my $self = { |
27
|
|
|
|
|
|
|
# #api_client => $options->{api_client} |
28
|
|
|
|
|
|
|
# api_client => $default_api_client |
29
|
|
|
|
|
|
|
#}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
bless \%self, $class; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# AppendMessage |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# Append message from a storage |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
# @param String $storage (optional) |
41
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
42
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
43
|
|
|
|
|
|
|
# @param String $folder (optional) |
44
|
|
|
|
|
|
|
# @param String $mailPath (optional) |
45
|
|
|
|
|
|
|
# @param Boolean $markAsSent (optional) |
46
|
|
|
|
|
|
|
# @return SaaSposeResponse |
47
|
|
|
|
|
|
|
# |
48
|
|
|
|
|
|
|
sub AppendMessage { |
49
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# parse inputs |
54
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/Append/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&folder={folder}&mailPath={mailPath}&markAsSent={markAsSent}'; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
57
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
58
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
59
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
62
|
0
|
|
|
|
|
|
my $query_params = {}; |
63
|
0
|
|
|
|
|
|
my $header_params = {}; |
64
|
0
|
|
|
|
|
|
my $form_params = {}; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
67
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
68
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
69
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
70
|
|
|
|
|
|
|
} |
71
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# query params |
74
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
75
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
76
|
|
|
|
|
|
|
}else{ |
77
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
78
|
|
|
|
|
|
|
}# query params |
79
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
80
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
81
|
|
|
|
|
|
|
}else{ |
82
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
83
|
|
|
|
|
|
|
}# query params |
84
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
85
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
86
|
|
|
|
|
|
|
}else{ |
87
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
88
|
|
|
|
|
|
|
}# query params |
89
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
90
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
91
|
|
|
|
|
|
|
}else{ |
92
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
93
|
|
|
|
|
|
|
}# query params |
94
|
0
|
0
|
|
|
|
|
if ( exists $args{'mailPath'}) { |
95
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{mailPath}\E/$args{'mailPath'}/g; |
96
|
|
|
|
|
|
|
}else{ |
97
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]mailPath.*?(?=&|\?|$)//g; |
98
|
|
|
|
|
|
|
}# query params |
99
|
0
|
0
|
|
|
|
|
if ( exists $args{'markAsSent'}) { |
100
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{markAsSent}\E/$args{'markAsSent'}/g; |
101
|
|
|
|
|
|
|
}else{ |
102
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]markAsSent.*?(?=&|\?|$)//g; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $_body_data; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# authentication setting, if any |
112
|
0
|
|
|
|
|
|
my $auth_settings = []; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# make the API Call |
115
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
116
|
|
|
|
|
|
|
$query_params, $form_params, |
117
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
118
|
0
|
0
|
|
|
|
|
if (!$response) { |
119
|
0
|
|
|
|
|
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
123
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
127
|
0
|
|
|
|
|
|
return $_response_object; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
# |
131
|
|
|
|
|
|
|
# AppendMimeMessage |
132
|
|
|
|
|
|
|
# |
133
|
|
|
|
|
|
|
# Append mime message |
134
|
|
|
|
|
|
|
# |
135
|
|
|
|
|
|
|
# @param String $storage (optional) |
136
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
137
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
138
|
|
|
|
|
|
|
# @param String $folder (optional) |
139
|
|
|
|
|
|
|
# @param Boolean $markAsSent (optional) |
140
|
|
|
|
|
|
|
# @param $body (required) |
141
|
|
|
|
|
|
|
# @return SaaSposeResponse |
142
|
|
|
|
|
|
|
# |
143
|
|
|
|
|
|
|
sub AppendMimeMessage { |
144
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# verify the required parameter 'body' is set |
148
|
0
|
0
|
|
|
|
|
unless (exists $args{'body'}) { |
149
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'body' when calling AppendMimeMessage"); |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
# parse inputs |
154
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/AppendMime/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&folder={folder}&markAsSent={markAsSent}'; |
155
|
|
|
|
|
|
|
|
156
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
157
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
158
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
159
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
160
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
162
|
0
|
|
|
|
|
|
my $query_params = {}; |
163
|
0
|
|
|
|
|
|
my $header_params = {}; |
164
|
0
|
|
|
|
|
|
my $form_params = {}; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
167
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
168
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
169
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
170
|
|
|
|
|
|
|
} |
171
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# query params |
174
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
175
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
176
|
|
|
|
|
|
|
}else{ |
177
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
178
|
|
|
|
|
|
|
}# query params |
179
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
180
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
181
|
|
|
|
|
|
|
}else{ |
182
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
183
|
|
|
|
|
|
|
}# query params |
184
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
185
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
186
|
|
|
|
|
|
|
}else{ |
187
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
188
|
|
|
|
|
|
|
}# query params |
189
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
190
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
191
|
|
|
|
|
|
|
}else{ |
192
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
193
|
|
|
|
|
|
|
}# query params |
194
|
0
|
0
|
|
|
|
|
if ( exists $args{'markAsSent'}) { |
195
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{markAsSent}\E/$args{'markAsSent'}/g; |
196
|
|
|
|
|
|
|
}else{ |
197
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]markAsSent.*?(?=&|\?|$)//g; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
my $_body_data; |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
# body params |
205
|
0
|
0
|
|
|
|
|
if ( exists $args{'body'}) { |
206
|
0
|
|
|
|
|
|
$_body_data = $args{'body'}; |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
# authentication setting, if any |
210
|
0
|
|
|
|
|
|
my $auth_settings = []; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
# make the API Call |
213
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
214
|
|
|
|
|
|
|
$query_params, $form_params, |
215
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
216
|
0
|
0
|
|
|
|
|
if (!$response) { |
217
|
0
|
|
|
|
|
|
return; |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
221
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
225
|
0
|
|
|
|
|
|
return $_response_object; |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
# |
229
|
|
|
|
|
|
|
# CreateFolder |
230
|
|
|
|
|
|
|
# |
231
|
|
|
|
|
|
|
# Creates the new folder |
232
|
|
|
|
|
|
|
# |
233
|
|
|
|
|
|
|
# @param String $storage (optional) |
234
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
235
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
236
|
|
|
|
|
|
|
# @param String $parentFolder (optional) |
237
|
|
|
|
|
|
|
# @param String $name (optional) |
238
|
|
|
|
|
|
|
# @return SaaSposeResponse |
239
|
|
|
|
|
|
|
# |
240
|
|
|
|
|
|
|
sub CreateFolder { |
241
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
# parse inputs |
246
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/CreateFolder/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&parentFolder={parentFolder}&name={name}'; |
247
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
249
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
250
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
251
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
252
|
|
|
|
|
|
|
|
253
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
254
|
0
|
|
|
|
|
|
my $query_params = {}; |
255
|
0
|
|
|
|
|
|
my $header_params = {}; |
256
|
0
|
|
|
|
|
|
my $form_params = {}; |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
259
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
260
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
261
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
262
|
|
|
|
|
|
|
} |
263
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# query params |
266
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
267
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
268
|
|
|
|
|
|
|
}else{ |
269
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
270
|
|
|
|
|
|
|
}# query params |
271
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
272
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
273
|
|
|
|
|
|
|
}else{ |
274
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
275
|
|
|
|
|
|
|
}# query params |
276
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
277
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
278
|
|
|
|
|
|
|
}else{ |
279
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
280
|
|
|
|
|
|
|
}# query params |
281
|
0
|
0
|
|
|
|
|
if ( exists $args{'parentFolder'}) { |
282
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{parentFolder}\E/$args{'parentFolder'}/g; |
283
|
|
|
|
|
|
|
}else{ |
284
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]parentFolder.*?(?=&|\?|$)//g; |
285
|
|
|
|
|
|
|
}# query params |
286
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
287
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
288
|
|
|
|
|
|
|
}else{ |
289
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
293
|
0
|
|
|
|
|
|
my $_body_data; |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
# authentication setting, if any |
299
|
0
|
|
|
|
|
|
my $auth_settings = []; |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
# make the API Call |
302
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
303
|
|
|
|
|
|
|
$query_params, $form_params, |
304
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
305
|
0
|
0
|
|
|
|
|
if (!$response) { |
306
|
0
|
|
|
|
|
|
return; |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
310
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
|
313
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
314
|
0
|
|
|
|
|
|
return $_response_object; |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
} |
317
|
|
|
|
|
|
|
# |
318
|
|
|
|
|
|
|
# DeleteFolder |
319
|
|
|
|
|
|
|
# |
320
|
|
|
|
|
|
|
# Deletes the folder |
321
|
|
|
|
|
|
|
# |
322
|
|
|
|
|
|
|
# @param String $storage (optional) |
323
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
324
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
325
|
|
|
|
|
|
|
# @param String $folder (optional) |
326
|
|
|
|
|
|
|
# @param Boolean $deletePermanently (optional) |
327
|
|
|
|
|
|
|
# @return SaaSposeResponse |
328
|
|
|
|
|
|
|
# |
329
|
|
|
|
|
|
|
sub DeleteFolder { |
330
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
# parse inputs |
335
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/DeleteFolder/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&folder={folder}&deletePermanently={deletePermanently}'; |
336
|
|
|
|
|
|
|
|
337
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
338
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
339
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
340
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
341
|
|
|
|
|
|
|
|
342
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
343
|
0
|
|
|
|
|
|
my $query_params = {}; |
344
|
0
|
|
|
|
|
|
my $header_params = {}; |
345
|
0
|
|
|
|
|
|
my $form_params = {}; |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
348
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
349
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
350
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
351
|
|
|
|
|
|
|
} |
352
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
# query params |
355
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
356
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
357
|
|
|
|
|
|
|
}else{ |
358
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
359
|
|
|
|
|
|
|
}# query params |
360
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
361
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
362
|
|
|
|
|
|
|
}else{ |
363
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
364
|
|
|
|
|
|
|
}# query params |
365
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
366
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
367
|
|
|
|
|
|
|
}else{ |
368
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
369
|
|
|
|
|
|
|
}# query params |
370
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
371
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
372
|
|
|
|
|
|
|
}else{ |
373
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
374
|
|
|
|
|
|
|
}# query params |
375
|
0
|
0
|
|
|
|
|
if ( exists $args{'deletePermanently'}) { |
376
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{deletePermanently}\E/$args{'deletePermanently'}/g; |
377
|
|
|
|
|
|
|
}else{ |
378
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]deletePermanently.*?(?=&|\?|$)//g; |
379
|
|
|
|
|
|
|
} |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
|
382
|
0
|
|
|
|
|
|
my $_body_data; |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
# authentication setting, if any |
388
|
0
|
|
|
|
|
|
my $auth_settings = []; |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
# make the API Call |
391
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
392
|
|
|
|
|
|
|
$query_params, $form_params, |
393
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
394
|
0
|
0
|
|
|
|
|
if (!$response) { |
395
|
0
|
|
|
|
|
|
return; |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
|
398
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
399
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
|
402
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
403
|
0
|
|
|
|
|
|
return $_response_object; |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
} |
406
|
|
|
|
|
|
|
# |
407
|
|
|
|
|
|
|
# DeleteMessage |
408
|
|
|
|
|
|
|
# |
409
|
|
|
|
|
|
|
# Deletes the mail message |
410
|
|
|
|
|
|
|
# |
411
|
|
|
|
|
|
|
# @param String $storage (optional) |
412
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
413
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
414
|
|
|
|
|
|
|
# @param String $messageId (optional) |
415
|
|
|
|
|
|
|
# @param Boolean $deletePermanently (optional) |
416
|
|
|
|
|
|
|
# @return SaaSposeResponse |
417
|
|
|
|
|
|
|
# |
418
|
|
|
|
|
|
|
sub DeleteMessage { |
419
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
# parse inputs |
424
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/DeleteMessage/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&messageId={messageId}&deletePermanently={deletePermanently}'; |
425
|
|
|
|
|
|
|
|
426
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
427
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
428
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
429
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
430
|
|
|
|
|
|
|
|
431
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
432
|
0
|
|
|
|
|
|
my $query_params = {}; |
433
|
0
|
|
|
|
|
|
my $header_params = {}; |
434
|
0
|
|
|
|
|
|
my $form_params = {}; |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
437
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
438
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
439
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
440
|
|
|
|
|
|
|
} |
441
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
# query params |
444
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
445
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
446
|
|
|
|
|
|
|
}else{ |
447
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
448
|
|
|
|
|
|
|
}# query params |
449
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
450
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
451
|
|
|
|
|
|
|
}else{ |
452
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
453
|
|
|
|
|
|
|
}# query params |
454
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
455
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
456
|
|
|
|
|
|
|
}else{ |
457
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
458
|
|
|
|
|
|
|
}# query params |
459
|
0
|
0
|
|
|
|
|
if ( exists $args{'messageId'}) { |
460
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{messageId}\E/$args{'messageId'}/g; |
461
|
|
|
|
|
|
|
}else{ |
462
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]messageId.*?(?=&|\?|$)//g; |
463
|
|
|
|
|
|
|
}# query params |
464
|
0
|
0
|
|
|
|
|
if ( exists $args{'deletePermanently'}) { |
465
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{deletePermanently}\E/$args{'deletePermanently'}/g; |
466
|
|
|
|
|
|
|
}else{ |
467
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]deletePermanently.*?(?=&|\?|$)//g; |
468
|
|
|
|
|
|
|
} |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
|
471
|
0
|
|
|
|
|
|
my $_body_data; |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
# authentication setting, if any |
477
|
0
|
|
|
|
|
|
my $auth_settings = []; |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
# make the API Call |
480
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
481
|
|
|
|
|
|
|
$query_params, $form_params, |
482
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
483
|
0
|
0
|
|
|
|
|
if (!$response) { |
484
|
0
|
|
|
|
|
|
return; |
485
|
|
|
|
|
|
|
} |
486
|
|
|
|
|
|
|
|
487
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
488
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
492
|
0
|
|
|
|
|
|
return $_response_object; |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
} |
495
|
|
|
|
|
|
|
# |
496
|
|
|
|
|
|
|
# FetchMessage |
497
|
|
|
|
|
|
|
# |
498
|
|
|
|
|
|
|
# Fetches the message from server |
499
|
|
|
|
|
|
|
# |
500
|
|
|
|
|
|
|
# @param String $storage (optional) |
501
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
502
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
503
|
|
|
|
|
|
|
# @param String $messageId (optional) |
504
|
|
|
|
|
|
|
# @return MimeResponse |
505
|
|
|
|
|
|
|
# |
506
|
|
|
|
|
|
|
sub FetchMessage { |
507
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
# parse inputs |
512
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/Fetch/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&messageId={messageId}'; |
513
|
|
|
|
|
|
|
|
514
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
515
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
516
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
517
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
518
|
|
|
|
|
|
|
|
519
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
520
|
0
|
|
|
|
|
|
my $query_params = {}; |
521
|
0
|
|
|
|
|
|
my $header_params = {}; |
522
|
0
|
|
|
|
|
|
my $form_params = {}; |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
525
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
526
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
527
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
528
|
|
|
|
|
|
|
} |
529
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
# query params |
532
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
533
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
534
|
|
|
|
|
|
|
}else{ |
535
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
536
|
|
|
|
|
|
|
}# query params |
537
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
538
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
539
|
|
|
|
|
|
|
}else{ |
540
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
541
|
|
|
|
|
|
|
}# query params |
542
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
543
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
544
|
|
|
|
|
|
|
}else{ |
545
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
546
|
|
|
|
|
|
|
}# query params |
547
|
0
|
0
|
|
|
|
|
if ( exists $args{'messageId'}) { |
548
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{messageId}\E/$args{'messageId'}/g; |
549
|
|
|
|
|
|
|
}else{ |
550
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]messageId.*?(?=&|\?|$)//g; |
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
|
554
|
0
|
|
|
|
|
|
my $_body_data; |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
# authentication setting, if any |
560
|
0
|
|
|
|
|
|
my $auth_settings = []; |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
# make the API Call |
563
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
564
|
|
|
|
|
|
|
$query_params, $form_params, |
565
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
566
|
0
|
0
|
|
|
|
|
if (!$response) { |
567
|
0
|
|
|
|
|
|
return; |
568
|
|
|
|
|
|
|
} |
569
|
|
|
|
|
|
|
|
570
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
571
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
572
|
|
|
|
|
|
|
} |
573
|
|
|
|
|
|
|
|
574
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'MimeResponse', $response->header('content-type')); |
575
|
0
|
|
|
|
|
|
return $_response_object; |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
} |
578
|
|
|
|
|
|
|
# |
579
|
|
|
|
|
|
|
# ListFolders |
580
|
|
|
|
|
|
|
# |
581
|
|
|
|
|
|
|
# Gets collection of child folders from parent |
582
|
|
|
|
|
|
|
# |
583
|
|
|
|
|
|
|
# @param String $storage (optional) |
584
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
585
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
586
|
|
|
|
|
|
|
# @param String $parentFolder (optional) |
587
|
|
|
|
|
|
|
# @return ListFoldersResponse |
588
|
|
|
|
|
|
|
# |
589
|
|
|
|
|
|
|
sub ListFolders { |
590
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
# parse inputs |
595
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/ListFolders/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&parentFolder={parentFolder}'; |
596
|
|
|
|
|
|
|
|
597
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
598
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
599
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
600
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
601
|
|
|
|
|
|
|
|
602
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
603
|
0
|
|
|
|
|
|
my $query_params = {}; |
604
|
0
|
|
|
|
|
|
my $header_params = {}; |
605
|
0
|
|
|
|
|
|
my $form_params = {}; |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
608
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
609
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
610
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
611
|
|
|
|
|
|
|
} |
612
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
# query params |
615
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
616
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
617
|
|
|
|
|
|
|
}else{ |
618
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
619
|
|
|
|
|
|
|
}# query params |
620
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
621
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
622
|
|
|
|
|
|
|
}else{ |
623
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
624
|
|
|
|
|
|
|
}# query params |
625
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
626
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
627
|
|
|
|
|
|
|
}else{ |
628
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
629
|
|
|
|
|
|
|
}# query params |
630
|
0
|
0
|
|
|
|
|
if ( exists $args{'parentFolder'}) { |
631
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{parentFolder}\E/$args{'parentFolder'}/g; |
632
|
|
|
|
|
|
|
}else{ |
633
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]parentFolder.*?(?=&|\?|$)//g; |
634
|
|
|
|
|
|
|
} |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
|
637
|
0
|
|
|
|
|
|
my $_body_data; |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
|
642
|
|
|
|
|
|
|
# authentication setting, if any |
643
|
0
|
|
|
|
|
|
my $auth_settings = []; |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
# make the API Call |
646
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
647
|
|
|
|
|
|
|
$query_params, $form_params, |
648
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
649
|
0
|
0
|
|
|
|
|
if (!$response) { |
650
|
0
|
|
|
|
|
|
return; |
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
|
653
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
654
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
655
|
|
|
|
|
|
|
} |
656
|
|
|
|
|
|
|
|
657
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ListFoldersResponse', $response->header('content-type')); |
658
|
0
|
|
|
|
|
|
return $_response_object; |
659
|
|
|
|
|
|
|
|
660
|
|
|
|
|
|
|
} |
661
|
|
|
|
|
|
|
# |
662
|
|
|
|
|
|
|
# ListMessages |
663
|
|
|
|
|
|
|
# |
664
|
|
|
|
|
|
|
# List the messages in the specified folder. |
665
|
|
|
|
|
|
|
# |
666
|
|
|
|
|
|
|
# @param String $storage (optional) |
667
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
668
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
669
|
|
|
|
|
|
|
# @param String $folder (optional) |
670
|
|
|
|
|
|
|
# @param Boolean $recursive (optional) |
671
|
|
|
|
|
|
|
# @param String $queryString (optional) |
672
|
|
|
|
|
|
|
# @return ListResponse |
673
|
|
|
|
|
|
|
# |
674
|
|
|
|
|
|
|
sub ListMessages { |
675
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
# parse inputs |
680
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/ListMessages/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&folder={folder}&recursive={recursive}&queryString={queryString}'; |
681
|
|
|
|
|
|
|
|
682
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
683
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
684
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
685
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
686
|
|
|
|
|
|
|
|
687
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
688
|
0
|
|
|
|
|
|
my $query_params = {}; |
689
|
0
|
|
|
|
|
|
my $header_params = {}; |
690
|
0
|
|
|
|
|
|
my $form_params = {}; |
691
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
693
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
694
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
695
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
696
|
|
|
|
|
|
|
} |
697
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
# query params |
700
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
701
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
702
|
|
|
|
|
|
|
}else{ |
703
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
704
|
|
|
|
|
|
|
}# query params |
705
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
706
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
707
|
|
|
|
|
|
|
}else{ |
708
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
709
|
|
|
|
|
|
|
}# query params |
710
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
711
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
712
|
|
|
|
|
|
|
}else{ |
713
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
714
|
|
|
|
|
|
|
}# query params |
715
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
716
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
717
|
|
|
|
|
|
|
}else{ |
718
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
719
|
|
|
|
|
|
|
}# query params |
720
|
0
|
0
|
|
|
|
|
if ( exists $args{'recursive'}) { |
721
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{recursive}\E/$args{'recursive'}/g; |
722
|
|
|
|
|
|
|
}else{ |
723
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]recursive.*?(?=&|\?|$)//g; |
724
|
|
|
|
|
|
|
}# query params |
725
|
0
|
0
|
|
|
|
|
if ( exists $args{'queryString'}) { |
726
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{queryString}\E/$args{'queryString'}/g; |
727
|
|
|
|
|
|
|
}else{ |
728
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]queryString.*?(?=&|\?|$)//g; |
729
|
|
|
|
|
|
|
} |
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
|
732
|
0
|
|
|
|
|
|
my $_body_data; |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
# authentication setting, if any |
738
|
0
|
|
|
|
|
|
my $auth_settings = []; |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
# make the API Call |
741
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
742
|
|
|
|
|
|
|
$query_params, $form_params, |
743
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
744
|
0
|
0
|
|
|
|
|
if (!$response) { |
745
|
0
|
|
|
|
|
|
return; |
746
|
|
|
|
|
|
|
} |
747
|
|
|
|
|
|
|
|
748
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
749
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
750
|
|
|
|
|
|
|
} |
751
|
|
|
|
|
|
|
|
752
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ListResponse', $response->header('content-type')); |
753
|
0
|
|
|
|
|
|
return $_response_object; |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
} |
756
|
|
|
|
|
|
|
# |
757
|
|
|
|
|
|
|
# SaveMailAccount |
758
|
|
|
|
|
|
|
# |
759
|
|
|
|
|
|
|
# Get mail common info. |
760
|
|
|
|
|
|
|
# |
761
|
|
|
|
|
|
|
# @param String $storage (required) |
762
|
|
|
|
|
|
|
# @param String $accountName (required) |
763
|
|
|
|
|
|
|
# @param String $host (required) |
764
|
|
|
|
|
|
|
# @param String $port (required) |
765
|
|
|
|
|
|
|
# @param String $login (required) |
766
|
|
|
|
|
|
|
# @param String $password (required) |
767
|
|
|
|
|
|
|
# @param String $securityOptions (required) |
768
|
|
|
|
|
|
|
# @param String $protocolType (required) |
769
|
|
|
|
|
|
|
# @param String $description (required) |
770
|
|
|
|
|
|
|
# @return SaaSposeResponse |
771
|
|
|
|
|
|
|
# |
772
|
|
|
|
|
|
|
sub SaveMailAccount { |
773
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
# verify the required parameter 'storage' is set |
777
|
0
|
0
|
|
|
|
|
unless (exists $args{'storage'}) { |
778
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'storage' when calling SaveMailAccount"); |
779
|
|
|
|
|
|
|
} |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
# verify the required parameter 'accountName' is set |
782
|
0
|
0
|
|
|
|
|
unless (exists $args{'accountName'}) { |
783
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'accountName' when calling SaveMailAccount"); |
784
|
|
|
|
|
|
|
} |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
# verify the required parameter 'host' is set |
787
|
0
|
0
|
|
|
|
|
unless (exists $args{'host'}) { |
788
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'host' when calling SaveMailAccount"); |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
|
791
|
|
|
|
|
|
|
# verify the required parameter 'port' is set |
792
|
0
|
0
|
|
|
|
|
unless (exists $args{'port'}) { |
793
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'port' when calling SaveMailAccount"); |
794
|
|
|
|
|
|
|
} |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
# verify the required parameter 'login' is set |
797
|
0
|
0
|
|
|
|
|
unless (exists $args{'login'}) { |
798
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'login' when calling SaveMailAccount"); |
799
|
|
|
|
|
|
|
} |
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
# verify the required parameter 'password' is set |
802
|
0
|
0
|
|
|
|
|
unless (exists $args{'password'}) { |
803
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'password' when calling SaveMailAccount"); |
804
|
|
|
|
|
|
|
} |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
# verify the required parameter 'securityOptions' is set |
807
|
0
|
0
|
|
|
|
|
unless (exists $args{'securityOptions'}) { |
808
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'securityOptions' when calling SaveMailAccount"); |
809
|
|
|
|
|
|
|
} |
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
# verify the required parameter 'protocolType' is set |
812
|
0
|
0
|
|
|
|
|
unless (exists $args{'protocolType'}) { |
813
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'protocolType' when calling SaveMailAccount"); |
814
|
|
|
|
|
|
|
} |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
# verify the required parameter 'description' is set |
817
|
0
|
0
|
|
|
|
|
unless (exists $args{'description'}) { |
818
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'description' when calling SaveMailAccount"); |
819
|
|
|
|
|
|
|
} |
820
|
|
|
|
|
|
|
|
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
# parse inputs |
823
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/SaveMailAccount/?appSid={appSid}&storage={storage}&accountName={accountName}&host={host}&port={port}&login={login}&password={password}&securityOptions={securityOptions}&protocolType={protocolType}&description={description}'; |
824
|
|
|
|
|
|
|
|
825
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
826
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
827
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
828
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
829
|
|
|
|
|
|
|
|
830
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
831
|
0
|
|
|
|
|
|
my $query_params = {}; |
832
|
0
|
|
|
|
|
|
my $header_params = {}; |
833
|
0
|
|
|
|
|
|
my $form_params = {}; |
834
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
836
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
837
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
838
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
839
|
|
|
|
|
|
|
} |
840
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
# query params |
843
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
844
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
845
|
|
|
|
|
|
|
}else{ |
846
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
847
|
|
|
|
|
|
|
}# query params |
848
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName'}) { |
849
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName}\E/$args{'accountName'}/g; |
850
|
|
|
|
|
|
|
}else{ |
851
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName.*?(?=&|\?|$)//g; |
852
|
|
|
|
|
|
|
}# query params |
853
|
0
|
0
|
|
|
|
|
if ( exists $args{'host'}) { |
854
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{host}\E/$args{'host'}/g; |
855
|
|
|
|
|
|
|
}else{ |
856
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]host.*?(?=&|\?|$)//g; |
857
|
|
|
|
|
|
|
}# query params |
858
|
0
|
0
|
|
|
|
|
if ( exists $args{'port'}) { |
859
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{port}\E/$args{'port'}/g; |
860
|
|
|
|
|
|
|
}else{ |
861
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]port.*?(?=&|\?|$)//g; |
862
|
|
|
|
|
|
|
}# query params |
863
|
0
|
0
|
|
|
|
|
if ( exists $args{'login'}) { |
864
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{login}\E/$args{'login'}/g; |
865
|
|
|
|
|
|
|
}else{ |
866
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]login.*?(?=&|\?|$)//g; |
867
|
|
|
|
|
|
|
}# query params |
868
|
0
|
0
|
|
|
|
|
if ( exists $args{'password'}) { |
869
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{password}\E/$args{'password'}/g; |
870
|
|
|
|
|
|
|
}else{ |
871
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]password.*?(?=&|\?|$)//g; |
872
|
|
|
|
|
|
|
}# query params |
873
|
0
|
0
|
|
|
|
|
if ( exists $args{'securityOptions'}) { |
874
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{securityOptions}\E/$args{'securityOptions'}/g; |
875
|
|
|
|
|
|
|
}else{ |
876
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]securityOptions.*?(?=&|\?|$)//g; |
877
|
|
|
|
|
|
|
}# query params |
878
|
0
|
0
|
|
|
|
|
if ( exists $args{'protocolType'}) { |
879
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{protocolType}\E/$args{'protocolType'}/g; |
880
|
|
|
|
|
|
|
}else{ |
881
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]protocolType.*?(?=&|\?|$)//g; |
882
|
|
|
|
|
|
|
}# query params |
883
|
0
|
0
|
|
|
|
|
if ( exists $args{'description'}) { |
884
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{description}\E/$args{'description'}/g; |
885
|
|
|
|
|
|
|
}else{ |
886
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]description.*?(?=&|\?|$)//g; |
887
|
|
|
|
|
|
|
} |
888
|
|
|
|
|
|
|
|
889
|
|
|
|
|
|
|
|
890
|
0
|
|
|
|
|
|
my $_body_data; |
891
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
|
893
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
# authentication setting, if any |
896
|
0
|
|
|
|
|
|
my $auth_settings = []; |
897
|
|
|
|
|
|
|
|
898
|
|
|
|
|
|
|
# make the API Call |
899
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
900
|
|
|
|
|
|
|
$query_params, $form_params, |
901
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
902
|
0
|
0
|
|
|
|
|
if (!$response) { |
903
|
0
|
|
|
|
|
|
return; |
904
|
|
|
|
|
|
|
} |
905
|
|
|
|
|
|
|
|
906
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
907
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
908
|
|
|
|
|
|
|
} |
909
|
|
|
|
|
|
|
|
910
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
911
|
0
|
|
|
|
|
|
return $_response_object; |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
# |
915
|
|
|
|
|
|
|
# SaveMailOAuthAccount |
916
|
|
|
|
|
|
|
# |
917
|
|
|
|
|
|
|
# Get mail common info. |
918
|
|
|
|
|
|
|
# |
919
|
|
|
|
|
|
|
# @param String $storage (required) |
920
|
|
|
|
|
|
|
# @param String $accountName (required) |
921
|
|
|
|
|
|
|
# @param String $host (required) |
922
|
|
|
|
|
|
|
# @param String $port (required) |
923
|
|
|
|
|
|
|
# @param String $login (required) |
924
|
|
|
|
|
|
|
# @param String $clientId (required) |
925
|
|
|
|
|
|
|
# @param String $clientSecret (required) |
926
|
|
|
|
|
|
|
# @param String $refreshToken (required) |
927
|
|
|
|
|
|
|
# @param String $securityOptions (required) |
928
|
|
|
|
|
|
|
# @param String $protocolType (required) |
929
|
|
|
|
|
|
|
# @param String $description (required) |
930
|
|
|
|
|
|
|
# @return SaaSposeResponse |
931
|
|
|
|
|
|
|
# |
932
|
|
|
|
|
|
|
sub SaveMailOAuthAccount { |
933
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
|
936
|
|
|
|
|
|
|
# verify the required parameter 'storage' is set |
937
|
0
|
0
|
|
|
|
|
unless (exists $args{'storage'}) { |
938
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'storage' when calling SaveMailOAuthAccount"); |
939
|
|
|
|
|
|
|
} |
940
|
|
|
|
|
|
|
|
941
|
|
|
|
|
|
|
# verify the required parameter 'accountName' is set |
942
|
0
|
0
|
|
|
|
|
unless (exists $args{'accountName'}) { |
943
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'accountName' when calling SaveMailOAuthAccount"); |
944
|
|
|
|
|
|
|
} |
945
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
# verify the required parameter 'host' is set |
947
|
0
|
0
|
|
|
|
|
unless (exists $args{'host'}) { |
948
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'host' when calling SaveMailOAuthAccount"); |
949
|
|
|
|
|
|
|
} |
950
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
# verify the required parameter 'port' is set |
952
|
0
|
0
|
|
|
|
|
unless (exists $args{'port'}) { |
953
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'port' when calling SaveMailOAuthAccount"); |
954
|
|
|
|
|
|
|
} |
955
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
# verify the required parameter 'login' is set |
957
|
0
|
0
|
|
|
|
|
unless (exists $args{'login'}) { |
958
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'login' when calling SaveMailOAuthAccount"); |
959
|
|
|
|
|
|
|
} |
960
|
|
|
|
|
|
|
|
961
|
|
|
|
|
|
|
# verify the required parameter 'clientId' is set |
962
|
0
|
0
|
|
|
|
|
unless (exists $args{'clientId'}) { |
963
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'clientId' when calling SaveMailOAuthAccount"); |
964
|
|
|
|
|
|
|
} |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
# verify the required parameter 'clientSecret' is set |
967
|
0
|
0
|
|
|
|
|
unless (exists $args{'clientSecret'}) { |
968
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'clientSecret' when calling SaveMailOAuthAccount"); |
969
|
|
|
|
|
|
|
} |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
# verify the required parameter 'refreshToken' is set |
972
|
0
|
0
|
|
|
|
|
unless (exists $args{'refreshToken'}) { |
973
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'refreshToken' when calling SaveMailOAuthAccount"); |
974
|
|
|
|
|
|
|
} |
975
|
|
|
|
|
|
|
|
976
|
|
|
|
|
|
|
# verify the required parameter 'securityOptions' is set |
977
|
0
|
0
|
|
|
|
|
unless (exists $args{'securityOptions'}) { |
978
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'securityOptions' when calling SaveMailOAuthAccount"); |
979
|
|
|
|
|
|
|
} |
980
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
# verify the required parameter 'protocolType' is set |
982
|
0
|
0
|
|
|
|
|
unless (exists $args{'protocolType'}) { |
983
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'protocolType' when calling SaveMailOAuthAccount"); |
984
|
|
|
|
|
|
|
} |
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
# verify the required parameter 'description' is set |
987
|
0
|
0
|
|
|
|
|
unless (exists $args{'description'}) { |
988
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'description' when calling SaveMailOAuthAccount"); |
989
|
|
|
|
|
|
|
} |
990
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
# parse inputs |
993
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/SaveMailOAuthAccount/?appSid={appSid}&storage={storage}&accountName={accountName}&host={host}&port={port}&login={login}&clientId={clientId}&clientSecret={clientSecret}&refreshToken={refreshToken}&securityOptions={securityOptions}&protocolType={protocolType}&description={description}'; |
994
|
|
|
|
|
|
|
|
995
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
996
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
997
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
998
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
999
|
|
|
|
|
|
|
|
1000
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
1001
|
0
|
|
|
|
|
|
my $query_params = {}; |
1002
|
0
|
|
|
|
|
|
my $header_params = {}; |
1003
|
0
|
|
|
|
|
|
my $form_params = {}; |
1004
|
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1006
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1007
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1008
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1009
|
|
|
|
|
|
|
} |
1010
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1011
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
# query params |
1013
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1014
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1015
|
|
|
|
|
|
|
}else{ |
1016
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1017
|
|
|
|
|
|
|
}# query params |
1018
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName'}) { |
1019
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName}\E/$args{'accountName'}/g; |
1020
|
|
|
|
|
|
|
}else{ |
1021
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName.*?(?=&|\?|$)//g; |
1022
|
|
|
|
|
|
|
}# query params |
1023
|
0
|
0
|
|
|
|
|
if ( exists $args{'host'}) { |
1024
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{host}\E/$args{'host'}/g; |
1025
|
|
|
|
|
|
|
}else{ |
1026
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]host.*?(?=&|\?|$)//g; |
1027
|
|
|
|
|
|
|
}# query params |
1028
|
0
|
0
|
|
|
|
|
if ( exists $args{'port'}) { |
1029
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{port}\E/$args{'port'}/g; |
1030
|
|
|
|
|
|
|
}else{ |
1031
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]port.*?(?=&|\?|$)//g; |
1032
|
|
|
|
|
|
|
}# query params |
1033
|
0
|
0
|
|
|
|
|
if ( exists $args{'login'}) { |
1034
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{login}\E/$args{'login'}/g; |
1035
|
|
|
|
|
|
|
}else{ |
1036
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]login.*?(?=&|\?|$)//g; |
1037
|
|
|
|
|
|
|
}# query params |
1038
|
0
|
0
|
|
|
|
|
if ( exists $args{'clientId'}) { |
1039
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{clientId}\E/$args{'clientId'}/g; |
1040
|
|
|
|
|
|
|
}else{ |
1041
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]clientId.*?(?=&|\?|$)//g; |
1042
|
|
|
|
|
|
|
}# query params |
1043
|
0
|
0
|
|
|
|
|
if ( exists $args{'clientSecret'}) { |
1044
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{clientSecret}\E/$args{'clientSecret'}/g; |
1045
|
|
|
|
|
|
|
}else{ |
1046
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]clientSecret.*?(?=&|\?|$)//g; |
1047
|
|
|
|
|
|
|
}# query params |
1048
|
0
|
0
|
|
|
|
|
if ( exists $args{'refreshToken'}) { |
1049
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{refreshToken}\E/$args{'refreshToken'}/g; |
1050
|
|
|
|
|
|
|
}else{ |
1051
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]refreshToken.*?(?=&|\?|$)//g; |
1052
|
|
|
|
|
|
|
}# query params |
1053
|
0
|
0
|
|
|
|
|
if ( exists $args{'securityOptions'}) { |
1054
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{securityOptions}\E/$args{'securityOptions'}/g; |
1055
|
|
|
|
|
|
|
}else{ |
1056
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]securityOptions.*?(?=&|\?|$)//g; |
1057
|
|
|
|
|
|
|
}# query params |
1058
|
0
|
0
|
|
|
|
|
if ( exists $args{'protocolType'}) { |
1059
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{protocolType}\E/$args{'protocolType'}/g; |
1060
|
|
|
|
|
|
|
}else{ |
1061
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]protocolType.*?(?=&|\?|$)//g; |
1062
|
|
|
|
|
|
|
}# query params |
1063
|
0
|
0
|
|
|
|
|
if ( exists $args{'description'}) { |
1064
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{description}\E/$args{'description'}/g; |
1065
|
|
|
|
|
|
|
}else{ |
1066
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]description.*?(?=&|\?|$)//g; |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
|
|
1070
|
0
|
|
|
|
|
|
my $_body_data; |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
|
1073
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
|
1075
|
|
|
|
|
|
|
# authentication setting, if any |
1076
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
# make the API Call |
1079
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1080
|
|
|
|
|
|
|
$query_params, $form_params, |
1081
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1082
|
0
|
0
|
|
|
|
|
if (!$response) { |
1083
|
0
|
|
|
|
|
|
return; |
1084
|
|
|
|
|
|
|
} |
1085
|
|
|
|
|
|
|
|
1086
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1087
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1088
|
|
|
|
|
|
|
} |
1089
|
|
|
|
|
|
|
|
1090
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
1091
|
0
|
|
|
|
|
|
return $_response_object; |
1092
|
|
|
|
|
|
|
|
1093
|
|
|
|
|
|
|
} |
1094
|
|
|
|
|
|
|
# |
1095
|
|
|
|
|
|
|
# Send |
1096
|
|
|
|
|
|
|
# |
1097
|
|
|
|
|
|
|
# Send mail message from a storage |
1098
|
|
|
|
|
|
|
# |
1099
|
|
|
|
|
|
|
# @param String $storage (optional) |
1100
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
1101
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
1102
|
|
|
|
|
|
|
# @param String $mailPath (optional) |
1103
|
|
|
|
|
|
|
# @return SaaSposeResponse |
1104
|
|
|
|
|
|
|
# |
1105
|
|
|
|
|
|
|
sub Send { |
1106
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1107
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
|
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
# parse inputs |
1111
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/Send/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&mailPath={mailPath}'; |
1112
|
|
|
|
|
|
|
|
1113
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1114
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1115
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1116
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1117
|
|
|
|
|
|
|
|
1118
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
1119
|
0
|
|
|
|
|
|
my $query_params = {}; |
1120
|
0
|
|
|
|
|
|
my $header_params = {}; |
1121
|
0
|
|
|
|
|
|
my $form_params = {}; |
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1124
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1125
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1126
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1127
|
|
|
|
|
|
|
} |
1128
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1129
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
# query params |
1131
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1132
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1133
|
|
|
|
|
|
|
}else{ |
1134
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1135
|
|
|
|
|
|
|
}# query params |
1136
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
1137
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
1138
|
|
|
|
|
|
|
}else{ |
1139
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
1140
|
|
|
|
|
|
|
}# query params |
1141
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
1142
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
1143
|
|
|
|
|
|
|
}else{ |
1144
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
1145
|
|
|
|
|
|
|
}# query params |
1146
|
0
|
0
|
|
|
|
|
if ( exists $args{'mailPath'}) { |
1147
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{mailPath}\E/$args{'mailPath'}/g; |
1148
|
|
|
|
|
|
|
}else{ |
1149
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]mailPath.*?(?=&|\?|$)//g; |
1150
|
|
|
|
|
|
|
} |
1151
|
|
|
|
|
|
|
|
1152
|
|
|
|
|
|
|
|
1153
|
0
|
|
|
|
|
|
my $_body_data; |
1154
|
|
|
|
|
|
|
|
1155
|
|
|
|
|
|
|
|
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
# authentication setting, if any |
1159
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1160
|
|
|
|
|
|
|
|
1161
|
|
|
|
|
|
|
# make the API Call |
1162
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1163
|
|
|
|
|
|
|
$query_params, $form_params, |
1164
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1165
|
0
|
0
|
|
|
|
|
if (!$response) { |
1166
|
0
|
|
|
|
|
|
return; |
1167
|
|
|
|
|
|
|
} |
1168
|
|
|
|
|
|
|
|
1169
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1170
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1171
|
|
|
|
|
|
|
} |
1172
|
|
|
|
|
|
|
|
1173
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
1174
|
0
|
|
|
|
|
|
return $_response_object; |
1175
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
} |
1177
|
|
|
|
|
|
|
# |
1178
|
|
|
|
|
|
|
# SendMime |
1179
|
|
|
|
|
|
|
# |
1180
|
|
|
|
|
|
|
# Send mail message |
1181
|
|
|
|
|
|
|
# |
1182
|
|
|
|
|
|
|
# @param String $storage (optional) |
1183
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
1184
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
1185
|
|
|
|
|
|
|
# @param $body (required) |
1186
|
|
|
|
|
|
|
# @return SaaSposeResponse |
1187
|
|
|
|
|
|
|
# |
1188
|
|
|
|
|
|
|
sub SendMime { |
1189
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1190
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
# verify the required parameter 'body' is set |
1193
|
0
|
0
|
|
|
|
|
unless (exists $args{'body'}) { |
1194
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'body' when calling SendMime"); |
1195
|
|
|
|
|
|
|
} |
1196
|
|
|
|
|
|
|
|
1197
|
|
|
|
|
|
|
|
1198
|
|
|
|
|
|
|
# parse inputs |
1199
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/SendMime/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}'; |
1200
|
|
|
|
|
|
|
|
1201
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1202
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1203
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1204
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1205
|
|
|
|
|
|
|
|
1206
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
1207
|
0
|
|
|
|
|
|
my $query_params = {}; |
1208
|
0
|
|
|
|
|
|
my $header_params = {}; |
1209
|
0
|
|
|
|
|
|
my $form_params = {}; |
1210
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1212
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1213
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1214
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1215
|
|
|
|
|
|
|
} |
1216
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1217
|
|
|
|
|
|
|
|
1218
|
|
|
|
|
|
|
# query params |
1219
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1220
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1221
|
|
|
|
|
|
|
}else{ |
1222
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1223
|
|
|
|
|
|
|
}# query params |
1224
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
1225
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
1226
|
|
|
|
|
|
|
}else{ |
1227
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
1228
|
|
|
|
|
|
|
}# query params |
1229
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
1230
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
1231
|
|
|
|
|
|
|
}else{ |
1232
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
|
1236
|
0
|
|
|
|
|
|
my $_body_data; |
1237
|
|
|
|
|
|
|
|
1238
|
|
|
|
|
|
|
|
1239
|
|
|
|
|
|
|
# body params |
1240
|
0
|
0
|
|
|
|
|
if ( exists $args{'body'}) { |
1241
|
0
|
|
|
|
|
|
$_body_data = $args{'body'}; |
1242
|
|
|
|
|
|
|
} |
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
# authentication setting, if any |
1245
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
# make the API Call |
1248
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1249
|
|
|
|
|
|
|
$query_params, $form_params, |
1250
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1251
|
0
|
0
|
|
|
|
|
if (!$response) { |
1252
|
0
|
|
|
|
|
|
return; |
1253
|
|
|
|
|
|
|
} |
1254
|
|
|
|
|
|
|
|
1255
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1256
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1257
|
|
|
|
|
|
|
} |
1258
|
|
|
|
|
|
|
|
1259
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
1260
|
0
|
|
|
|
|
|
return $_response_object; |
1261
|
|
|
|
|
|
|
|
1262
|
|
|
|
|
|
|
} |
1263
|
|
|
|
|
|
|
# |
1264
|
|
|
|
|
|
|
# SetReadFlag |
1265
|
|
|
|
|
|
|
# |
1266
|
|
|
|
|
|
|
# Marks the specifeid message as read. |
1267
|
|
|
|
|
|
|
# |
1268
|
|
|
|
|
|
|
# @param String $storage (optional) |
1269
|
|
|
|
|
|
|
# @param String $accountName1 (optional) |
1270
|
|
|
|
|
|
|
# @param String $accountName2 (optional) |
1271
|
|
|
|
|
|
|
# @param String $messageId (optional) |
1272
|
|
|
|
|
|
|
# @param Boolean $isRead (optional) |
1273
|
|
|
|
|
|
|
# @return SaaSposeResponse |
1274
|
|
|
|
|
|
|
# |
1275
|
|
|
|
|
|
|
sub SetReadFlag { |
1276
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
# parse inputs |
1281
|
0
|
|
|
|
|
|
my $_resource_path = '/email/client/SetReadFlag/?appSid={appSid}&storage={storage}&accountName1={accountName1}&accountName2={accountName2}&messageId={messageId}&isRead={isRead}'; |
1282
|
|
|
|
|
|
|
|
1283
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1284
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1285
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1286
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1287
|
|
|
|
|
|
|
|
1288
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
1289
|
0
|
|
|
|
|
|
my $query_params = {}; |
1290
|
0
|
|
|
|
|
|
my $header_params = {}; |
1291
|
0
|
|
|
|
|
|
my $form_params = {}; |
1292
|
|
|
|
|
|
|
|
1293
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1294
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1295
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1296
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1297
|
|
|
|
|
|
|
} |
1298
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1299
|
|
|
|
|
|
|
|
1300
|
|
|
|
|
|
|
# query params |
1301
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1302
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1303
|
|
|
|
|
|
|
}else{ |
1304
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1305
|
|
|
|
|
|
|
}# query params |
1306
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName1'}) { |
1307
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName1}\E/$args{'accountName1'}/g; |
1308
|
|
|
|
|
|
|
}else{ |
1309
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName1.*?(?=&|\?|$)//g; |
1310
|
|
|
|
|
|
|
}# query params |
1311
|
0
|
0
|
|
|
|
|
if ( exists $args{'accountName2'}) { |
1312
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{accountName2}\E/$args{'accountName2'}/g; |
1313
|
|
|
|
|
|
|
}else{ |
1314
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]accountName2.*?(?=&|\?|$)//g; |
1315
|
|
|
|
|
|
|
}# query params |
1316
|
0
|
0
|
|
|
|
|
if ( exists $args{'messageId'}) { |
1317
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{messageId}\E/$args{'messageId'}/g; |
1318
|
|
|
|
|
|
|
}else{ |
1319
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]messageId.*?(?=&|\?|$)//g; |
1320
|
|
|
|
|
|
|
}# query params |
1321
|
0
|
0
|
|
|
|
|
if ( exists $args{'isRead'}) { |
1322
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{isRead}\E/$args{'isRead'}/g; |
1323
|
|
|
|
|
|
|
}else{ |
1324
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]isRead.*?(?=&|\?|$)//g; |
1325
|
|
|
|
|
|
|
} |
1326
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
|
1328
|
0
|
|
|
|
|
|
my $_body_data; |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
|
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
# authentication setting, if any |
1334
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
# make the API Call |
1337
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1338
|
|
|
|
|
|
|
$query_params, $form_params, |
1339
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1340
|
0
|
0
|
|
|
|
|
if (!$response) { |
1341
|
0
|
|
|
|
|
|
return; |
1342
|
|
|
|
|
|
|
} |
1343
|
|
|
|
|
|
|
|
1344
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1345
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1346
|
|
|
|
|
|
|
} |
1347
|
|
|
|
|
|
|
|
1348
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'SaaSposeResponse', $response->header('content-type')); |
1349
|
0
|
|
|
|
|
|
return $_response_object; |
1350
|
|
|
|
|
|
|
|
1351
|
|
|
|
|
|
|
} |
1352
|
|
|
|
|
|
|
# |
1353
|
|
|
|
|
|
|
# GetDocument |
1354
|
|
|
|
|
|
|
# |
1355
|
|
|
|
|
|
|
# Get mail common info. |
1356
|
|
|
|
|
|
|
# |
1357
|
|
|
|
|
|
|
# @param String $name (required) |
1358
|
|
|
|
|
|
|
# @param String $storage (optional) |
1359
|
|
|
|
|
|
|
# @param String $folder (optional) |
1360
|
|
|
|
|
|
|
# @return ResponseMessage |
1361
|
|
|
|
|
|
|
# |
1362
|
|
|
|
|
|
|
sub GetDocument { |
1363
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1364
|
|
|
|
|
|
|
|
1365
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1367
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1368
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling GetDocument"); |
1369
|
|
|
|
|
|
|
} |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
# parse inputs |
1373
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1374
|
|
|
|
|
|
|
|
1375
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1376
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1377
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1378
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1379
|
|
|
|
|
|
|
|
1380
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
1381
|
0
|
|
|
|
|
|
my $query_params = {}; |
1382
|
0
|
|
|
|
|
|
my $header_params = {}; |
1383
|
0
|
|
|
|
|
|
my $form_params = {}; |
1384
|
|
|
|
|
|
|
|
1385
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1386
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/json'); |
1387
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1388
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1389
|
|
|
|
|
|
|
} |
1390
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1391
|
|
|
|
|
|
|
|
1392
|
|
|
|
|
|
|
# query params |
1393
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1394
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1395
|
|
|
|
|
|
|
}else{ |
1396
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1397
|
|
|
|
|
|
|
}# query params |
1398
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1399
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1400
|
|
|
|
|
|
|
}else{ |
1401
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1402
|
|
|
|
|
|
|
}# query params |
1403
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1404
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1405
|
|
|
|
|
|
|
}else{ |
1406
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1407
|
|
|
|
|
|
|
} |
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
|
1410
|
0
|
|
|
|
|
|
my $_body_data; |
1411
|
|
|
|
|
|
|
|
1412
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
|
1415
|
|
|
|
|
|
|
# authentication setting, if any |
1416
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
# make the API Call |
1419
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1420
|
|
|
|
|
|
|
$query_params, $form_params, |
1421
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1422
|
0
|
0
|
|
|
|
|
if (!$response) { |
1423
|
0
|
|
|
|
|
|
return; |
1424
|
|
|
|
|
|
|
} |
1425
|
|
|
|
|
|
|
|
1426
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1427
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1428
|
|
|
|
|
|
|
} |
1429
|
|
|
|
|
|
|
|
1430
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'EmailPropertiesResponse', $response->header('content-type')); |
1431
|
0
|
|
|
|
|
|
return $_response_object; |
1432
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
} |
1434
|
|
|
|
|
|
|
# |
1435
|
|
|
|
|
|
|
# PutCreateNewEmail |
1436
|
|
|
|
|
|
|
# |
1437
|
|
|
|
|
|
|
# Add new email. |
1438
|
|
|
|
|
|
|
# |
1439
|
|
|
|
|
|
|
# @param String $name (required) |
1440
|
|
|
|
|
|
|
# @param String $storage (optional) |
1441
|
|
|
|
|
|
|
# @param String $folder (optional) |
1442
|
|
|
|
|
|
|
# @param EmailDocument $body (required) |
1443
|
|
|
|
|
|
|
# @return EmailDocumentResponse |
1444
|
|
|
|
|
|
|
# |
1445
|
|
|
|
|
|
|
sub PutCreateNewEmail { |
1446
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
|
1449
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1450
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1451
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling PutCreateNewEmail"); |
1452
|
|
|
|
|
|
|
} |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
# verify the required parameter 'body' is set |
1455
|
0
|
0
|
|
|
|
|
unless (exists $args{'body'}) { |
1456
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'body' when calling PutCreateNewEmail"); |
1457
|
|
|
|
|
|
|
} |
1458
|
|
|
|
|
|
|
|
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
# parse inputs |
1461
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1462
|
|
|
|
|
|
|
|
1463
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1464
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1465
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1466
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1467
|
|
|
|
|
|
|
|
1468
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
1469
|
0
|
|
|
|
|
|
my $query_params = {}; |
1470
|
0
|
|
|
|
|
|
my $header_params = {}; |
1471
|
0
|
|
|
|
|
|
my $form_params = {}; |
1472
|
|
|
|
|
|
|
|
1473
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1474
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
1475
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1476
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1477
|
|
|
|
|
|
|
} |
1478
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1479
|
|
|
|
|
|
|
|
1480
|
|
|
|
|
|
|
# query params |
1481
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1482
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1483
|
|
|
|
|
|
|
}else{ |
1484
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1485
|
|
|
|
|
|
|
}# query params |
1486
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1487
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1488
|
|
|
|
|
|
|
}else{ |
1489
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1490
|
|
|
|
|
|
|
}# query params |
1491
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1492
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1493
|
|
|
|
|
|
|
}else{ |
1494
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1495
|
|
|
|
|
|
|
} |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
|
1498
|
0
|
|
|
|
|
|
my $_body_data; |
1499
|
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
|
|
1501
|
|
|
|
|
|
|
# body params |
1502
|
0
|
0
|
|
|
|
|
if ( exists $args{'body'}) { |
1503
|
0
|
|
|
|
|
|
$_body_data = $args{'body'}; |
1504
|
|
|
|
|
|
|
} |
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
# authentication setting, if any |
1507
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1508
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
# make the API Call |
1510
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1511
|
|
|
|
|
|
|
$query_params, $form_params, |
1512
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1513
|
0
|
0
|
|
|
|
|
if (!$response) { |
1514
|
0
|
|
|
|
|
|
return; |
1515
|
|
|
|
|
|
|
} |
1516
|
|
|
|
|
|
|
|
1517
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1518
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1519
|
|
|
|
|
|
|
} |
1520
|
|
|
|
|
|
|
|
1521
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'EmailDocumentResponse', $response->header('content-type')); |
1522
|
0
|
|
|
|
|
|
return $_response_object; |
1523
|
|
|
|
|
|
|
|
1524
|
|
|
|
|
|
|
} |
1525
|
|
|
|
|
|
|
# |
1526
|
|
|
|
|
|
|
# GetDocumentWithFormat |
1527
|
|
|
|
|
|
|
# |
1528
|
|
|
|
|
|
|
# Convert mail message to target format. |
1529
|
|
|
|
|
|
|
# |
1530
|
|
|
|
|
|
|
# @param String $name (required) |
1531
|
|
|
|
|
|
|
# @param String $format (required) |
1532
|
|
|
|
|
|
|
# @param String $storage (optional) |
1533
|
|
|
|
|
|
|
# @param String $folder (optional) |
1534
|
|
|
|
|
|
|
# @param String $outPath (optional) |
1535
|
|
|
|
|
|
|
# @return ResponseMessage |
1536
|
|
|
|
|
|
|
# |
1537
|
|
|
|
|
|
|
sub GetDocumentWithFormat { |
1538
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
|
1541
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1542
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1543
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling GetDocumentWithFormat"); |
1544
|
|
|
|
|
|
|
} |
1545
|
|
|
|
|
|
|
|
1546
|
|
|
|
|
|
|
# verify the required parameter 'format' is set |
1547
|
0
|
0
|
|
|
|
|
unless (exists $args{'format'}) { |
1548
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'format' when calling GetDocumentWithFormat"); |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
# parse inputs |
1553
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/?appSid={appSid}&toFormat={toFormat}&storage={storage}&folder={folder}&outPath={outPath}'; |
1554
|
|
|
|
|
|
|
|
1555
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1556
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1557
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1558
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1559
|
|
|
|
|
|
|
|
1560
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
1561
|
0
|
|
|
|
|
|
my $query_params = {}; |
1562
|
0
|
|
|
|
|
|
my $header_params = {}; |
1563
|
0
|
|
|
|
|
|
my $form_params = {}; |
1564
|
|
|
|
|
|
|
|
1565
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1566
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1567
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1568
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1569
|
|
|
|
|
|
|
} |
1570
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
# query params |
1573
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1574
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1575
|
|
|
|
|
|
|
}else{ |
1576
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1577
|
|
|
|
|
|
|
}# query params |
1578
|
0
|
0
|
|
|
|
|
if ( exists $args{'format'}) { |
1579
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{format}\E/$args{'format'}/g; |
1580
|
|
|
|
|
|
|
}else{ |
1581
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]format.*?(?=&|\?|$)//g; |
1582
|
|
|
|
|
|
|
}# query params |
1583
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1584
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1585
|
|
|
|
|
|
|
}else{ |
1586
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1587
|
|
|
|
|
|
|
}# query params |
1588
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1589
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1590
|
|
|
|
|
|
|
}else{ |
1591
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1592
|
|
|
|
|
|
|
}# query params |
1593
|
0
|
0
|
|
|
|
|
if ( exists $args{'outPath'}) { |
1594
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{outPath}\E/$args{'outPath'}/g; |
1595
|
|
|
|
|
|
|
}else{ |
1596
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]outPath.*?(?=&|\?|$)//g; |
1597
|
|
|
|
|
|
|
} |
1598
|
|
|
|
|
|
|
|
1599
|
|
|
|
|
|
|
|
1600
|
0
|
|
|
|
|
|
my $_body_data; |
1601
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
|
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
|
1605
|
|
|
|
|
|
|
# authentication setting, if any |
1606
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1607
|
|
|
|
|
|
|
|
1608
|
|
|
|
|
|
|
# make the API Call |
1609
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1610
|
|
|
|
|
|
|
$query_params, $form_params, |
1611
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1612
|
0
|
0
|
|
|
|
|
if (!$response) { |
1613
|
0
|
|
|
|
|
|
return; |
1614
|
|
|
|
|
|
|
} |
1615
|
|
|
|
|
|
|
|
1616
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1617
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1618
|
|
|
|
|
|
|
} |
1619
|
|
|
|
|
|
|
|
1620
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
1621
|
0
|
|
|
|
|
|
return $_response_object; |
1622
|
|
|
|
|
|
|
|
1623
|
|
|
|
|
|
|
} |
1624
|
|
|
|
|
|
|
# |
1625
|
|
|
|
|
|
|
# GetEmailAttachment |
1626
|
|
|
|
|
|
|
# |
1627
|
|
|
|
|
|
|
# Get email attachment by name. |
1628
|
|
|
|
|
|
|
# |
1629
|
|
|
|
|
|
|
# @param String $name (required) |
1630
|
|
|
|
|
|
|
# @param String $attachName (required) |
1631
|
|
|
|
|
|
|
# @param String $storage (optional) |
1632
|
|
|
|
|
|
|
# @param String $folder (optional) |
1633
|
|
|
|
|
|
|
# @return ResponseMessage |
1634
|
|
|
|
|
|
|
# |
1635
|
|
|
|
|
|
|
sub GetEmailAttachment { |
1636
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1637
|
|
|
|
|
|
|
|
1638
|
|
|
|
|
|
|
|
1639
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1640
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1641
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling GetEmailAttachment"); |
1642
|
|
|
|
|
|
|
} |
1643
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
# verify the required parameter 'attachName' is set |
1645
|
0
|
0
|
|
|
|
|
unless (exists $args{'attachName'}) { |
1646
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'attachName' when calling GetEmailAttachment"); |
1647
|
|
|
|
|
|
|
} |
1648
|
|
|
|
|
|
|
|
1649
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
# parse inputs |
1651
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/attachments/{attachName}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1652
|
|
|
|
|
|
|
|
1653
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1654
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1655
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1656
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1657
|
|
|
|
|
|
|
|
1658
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
1659
|
0
|
|
|
|
|
|
my $query_params = {}; |
1660
|
0
|
|
|
|
|
|
my $header_params = {}; |
1661
|
0
|
|
|
|
|
|
my $form_params = {}; |
1662
|
|
|
|
|
|
|
|
1663
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1664
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream'); |
1665
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1666
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1667
|
|
|
|
|
|
|
} |
1668
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1669
|
|
|
|
|
|
|
|
1670
|
|
|
|
|
|
|
# query params |
1671
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1672
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1673
|
|
|
|
|
|
|
}else{ |
1674
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1675
|
|
|
|
|
|
|
}# query params |
1676
|
0
|
0
|
|
|
|
|
if ( exists $args{'attachName'}) { |
1677
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{attachName}\E/$args{'attachName'}/g; |
1678
|
|
|
|
|
|
|
}else{ |
1679
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]attachName.*?(?=&|\?|$)//g; |
1680
|
|
|
|
|
|
|
}# query params |
1681
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1682
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1683
|
|
|
|
|
|
|
}else{ |
1684
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1685
|
|
|
|
|
|
|
}# query params |
1686
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1687
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1688
|
|
|
|
|
|
|
}else{ |
1689
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1690
|
|
|
|
|
|
|
} |
1691
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
|
1693
|
0
|
|
|
|
|
|
my $_body_data; |
1694
|
|
|
|
|
|
|
|
1695
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
|
1697
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
# authentication setting, if any |
1699
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1700
|
|
|
|
|
|
|
|
1701
|
|
|
|
|
|
|
# make the API Call |
1702
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1703
|
|
|
|
|
|
|
$query_params, $form_params, |
1704
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1705
|
0
|
0
|
|
|
|
|
if (!$response) { |
1706
|
0
|
|
|
|
|
|
return; |
1707
|
|
|
|
|
|
|
} |
1708
|
|
|
|
|
|
|
|
1709
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1710
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1711
|
|
|
|
|
|
|
} |
1712
|
|
|
|
|
|
|
|
1713
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type')); |
1714
|
0
|
|
|
|
|
|
return $_response_object; |
1715
|
|
|
|
|
|
|
|
1716
|
|
|
|
|
|
|
} |
1717
|
|
|
|
|
|
|
# |
1718
|
|
|
|
|
|
|
# PostAddEmailAttachment |
1719
|
|
|
|
|
|
|
# |
1720
|
|
|
|
|
|
|
# Add email attachment. |
1721
|
|
|
|
|
|
|
# |
1722
|
|
|
|
|
|
|
# @param String $name (required) |
1723
|
|
|
|
|
|
|
# @param String $attachName (required) |
1724
|
|
|
|
|
|
|
# @param String $storage (optional) |
1725
|
|
|
|
|
|
|
# @param String $folder (optional) |
1726
|
|
|
|
|
|
|
# @return EmailDocumentResponse |
1727
|
|
|
|
|
|
|
# |
1728
|
|
|
|
|
|
|
sub PostAddEmailAttachment { |
1729
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1730
|
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
|
|
1732
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1733
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1734
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling PostAddEmailAttachment"); |
1735
|
|
|
|
|
|
|
} |
1736
|
|
|
|
|
|
|
|
1737
|
|
|
|
|
|
|
# verify the required parameter 'attachName' is set |
1738
|
0
|
0
|
|
|
|
|
unless (exists $args{'attachName'}) { |
1739
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'attachName' when calling PostAddEmailAttachment"); |
1740
|
|
|
|
|
|
|
} |
1741
|
|
|
|
|
|
|
|
1742
|
|
|
|
|
|
|
|
1743
|
|
|
|
|
|
|
# parse inputs |
1744
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/attachments/{attachName}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1745
|
|
|
|
|
|
|
|
1746
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1747
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1748
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1749
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1750
|
|
|
|
|
|
|
|
1751
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
1752
|
0
|
|
|
|
|
|
my $query_params = {}; |
1753
|
0
|
|
|
|
|
|
my $header_params = {}; |
1754
|
0
|
|
|
|
|
|
my $form_params = {}; |
1755
|
|
|
|
|
|
|
|
1756
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1757
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
1758
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1759
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1760
|
|
|
|
|
|
|
} |
1761
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1762
|
|
|
|
|
|
|
|
1763
|
|
|
|
|
|
|
# query params |
1764
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1765
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1766
|
|
|
|
|
|
|
}else{ |
1767
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1768
|
|
|
|
|
|
|
}# query params |
1769
|
0
|
0
|
|
|
|
|
if ( exists $args{'attachName'}) { |
1770
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{attachName}\E/$args{'attachName'}/g; |
1771
|
|
|
|
|
|
|
}else{ |
1772
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]attachName.*?(?=&|\?|$)//g; |
1773
|
|
|
|
|
|
|
}# query params |
1774
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1775
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1776
|
|
|
|
|
|
|
}else{ |
1777
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1778
|
|
|
|
|
|
|
}# query params |
1779
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1780
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1781
|
|
|
|
|
|
|
}else{ |
1782
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1783
|
|
|
|
|
|
|
} |
1784
|
|
|
|
|
|
|
|
1785
|
|
|
|
|
|
|
|
1786
|
0
|
|
|
|
|
|
my $_body_data; |
1787
|
|
|
|
|
|
|
|
1788
|
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
# authentication setting, if any |
1792
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1793
|
|
|
|
|
|
|
|
1794
|
|
|
|
|
|
|
# make the API Call |
1795
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1796
|
|
|
|
|
|
|
$query_params, $form_params, |
1797
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1798
|
0
|
0
|
|
|
|
|
if (!$response) { |
1799
|
0
|
|
|
|
|
|
return; |
1800
|
|
|
|
|
|
|
} |
1801
|
|
|
|
|
|
|
|
1802
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1803
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1804
|
|
|
|
|
|
|
} |
1805
|
|
|
|
|
|
|
|
1806
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'EmailDocumentResponse', $response->header('content-type')); |
1807
|
0
|
|
|
|
|
|
return $_response_object; |
1808
|
|
|
|
|
|
|
|
1809
|
|
|
|
|
|
|
} |
1810
|
|
|
|
|
|
|
# |
1811
|
|
|
|
|
|
|
# GetEmailProperty |
1812
|
|
|
|
|
|
|
# |
1813
|
|
|
|
|
|
|
# Read document property by name. |
1814
|
|
|
|
|
|
|
# |
1815
|
|
|
|
|
|
|
# @param String $propertyName (required) |
1816
|
|
|
|
|
|
|
# @param String $name (required) |
1817
|
|
|
|
|
|
|
# @param String $storage (optional) |
1818
|
|
|
|
|
|
|
# @param String $folder (optional) |
1819
|
|
|
|
|
|
|
# @return ResponseMessage |
1820
|
|
|
|
|
|
|
# |
1821
|
|
|
|
|
|
|
sub GetEmailProperty { |
1822
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1823
|
|
|
|
|
|
|
|
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
# verify the required parameter 'propertyName' is set |
1826
|
0
|
0
|
|
|
|
|
unless (exists $args{'propertyName'}) { |
1827
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'propertyName' when calling GetEmailProperty"); |
1828
|
|
|
|
|
|
|
} |
1829
|
|
|
|
|
|
|
|
1830
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1831
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1832
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling GetEmailProperty"); |
1833
|
|
|
|
|
|
|
} |
1834
|
|
|
|
|
|
|
|
1835
|
|
|
|
|
|
|
|
1836
|
|
|
|
|
|
|
# parse inputs |
1837
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/properties/{propertyName}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1838
|
|
|
|
|
|
|
|
1839
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1840
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1841
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1842
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1843
|
|
|
|
|
|
|
|
1844
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
1845
|
0
|
|
|
|
|
|
my $query_params = {}; |
1846
|
0
|
|
|
|
|
|
my $header_params = {}; |
1847
|
0
|
|
|
|
|
|
my $form_params = {}; |
1848
|
|
|
|
|
|
|
|
1849
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1850
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/json'); |
1851
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1852
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1853
|
|
|
|
|
|
|
} |
1854
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1855
|
|
|
|
|
|
|
|
1856
|
|
|
|
|
|
|
# query params |
1857
|
0
|
0
|
|
|
|
|
if ( exists $args{'propertyName'}) { |
1858
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{propertyName}\E/$args{'propertyName'}/g; |
1859
|
|
|
|
|
|
|
}else{ |
1860
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]propertyName.*?(?=&|\?|$)//g; |
1861
|
|
|
|
|
|
|
}# query params |
1862
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1863
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1864
|
|
|
|
|
|
|
}else{ |
1865
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1866
|
|
|
|
|
|
|
}# query params |
1867
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1868
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1869
|
|
|
|
|
|
|
}else{ |
1870
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1871
|
|
|
|
|
|
|
}# query params |
1872
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1873
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1874
|
|
|
|
|
|
|
}else{ |
1875
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1876
|
|
|
|
|
|
|
} |
1877
|
|
|
|
|
|
|
|
1878
|
|
|
|
|
|
|
|
1879
|
0
|
|
|
|
|
|
my $_body_data; |
1880
|
|
|
|
|
|
|
|
1881
|
|
|
|
|
|
|
|
1882
|
|
|
|
|
|
|
|
1883
|
|
|
|
|
|
|
|
1884
|
|
|
|
|
|
|
# authentication setting, if any |
1885
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1886
|
|
|
|
|
|
|
|
1887
|
|
|
|
|
|
|
# make the API Call |
1888
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1889
|
|
|
|
|
|
|
$query_params, $form_params, |
1890
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1891
|
0
|
0
|
|
|
|
|
if (!$response) { |
1892
|
0
|
|
|
|
|
|
return; |
1893
|
|
|
|
|
|
|
} |
1894
|
|
|
|
|
|
|
|
1895
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1896
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1897
|
|
|
|
|
|
|
} |
1898
|
|
|
|
|
|
|
|
1899
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'EmailPropertyResponse', $response->header('content-type')); |
1900
|
0
|
|
|
|
|
|
return $_response_object; |
1901
|
|
|
|
|
|
|
|
1902
|
|
|
|
|
|
|
} |
1903
|
|
|
|
|
|
|
# |
1904
|
|
|
|
|
|
|
# PutSetEmailProperty |
1905
|
|
|
|
|
|
|
# |
1906
|
|
|
|
|
|
|
# Set document property. |
1907
|
|
|
|
|
|
|
# |
1908
|
|
|
|
|
|
|
# @param String $name (required) |
1909
|
|
|
|
|
|
|
# @param String $propertyName (required) |
1910
|
|
|
|
|
|
|
# @param String $storage (optional) |
1911
|
|
|
|
|
|
|
# @param String $folder (optional) |
1912
|
|
|
|
|
|
|
# @param EmailProperty $body (required) |
1913
|
|
|
|
|
|
|
# @return EmailPropertyResponse |
1914
|
|
|
|
|
|
|
# |
1915
|
|
|
|
|
|
|
sub PutSetEmailProperty { |
1916
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
1917
|
|
|
|
|
|
|
|
1918
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
1920
|
0
|
0
|
|
|
|
|
unless (exists $args{'name'}) { |
1921
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'name' when calling PutSetEmailProperty"); |
1922
|
|
|
|
|
|
|
} |
1923
|
|
|
|
|
|
|
|
1924
|
|
|
|
|
|
|
# verify the required parameter 'propertyName' is set |
1925
|
0
|
0
|
|
|
|
|
unless (exists $args{'propertyName'}) { |
1926
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'propertyName' when calling PutSetEmailProperty"); |
1927
|
|
|
|
|
|
|
} |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
# verify the required parameter 'body' is set |
1930
|
0
|
0
|
|
|
|
|
unless (exists $args{'body'}) { |
1931
|
0
|
|
|
|
|
|
croak("Missing the required parameter 'body' when calling PutSetEmailProperty"); |
1932
|
|
|
|
|
|
|
} |
1933
|
|
|
|
|
|
|
|
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
# parse inputs |
1936
|
0
|
|
|
|
|
|
my $_resource_path = '/email/{name}/properties/{propertyName}/?appSid={appSid}&storage={storage}&folder={folder}'; |
1937
|
|
|
|
|
|
|
|
1938
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q&\E/&/g; |
1939
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q\/?\E/?/g; |
1940
|
0
|
|
|
|
|
|
$_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g; |
1941
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{path}\E/{Path}/g; |
1942
|
|
|
|
|
|
|
|
1943
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
1944
|
0
|
|
|
|
|
|
my $query_params = {}; |
1945
|
0
|
|
|
|
|
|
my $header_params = {}; |
1946
|
0
|
|
|
|
|
|
my $form_params = {}; |
1947
|
|
|
|
|
|
|
|
1948
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
1949
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/json'); |
1950
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
1951
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
1952
|
|
|
|
|
|
|
} |
1953
|
0
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json'); |
1954
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
# query params |
1956
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'}) { |
1957
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{name}\E/$args{'name'}/g; |
1958
|
|
|
|
|
|
|
}else{ |
1959
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]name.*?(?=&|\?|$)//g; |
1960
|
|
|
|
|
|
|
}# query params |
1961
|
0
|
0
|
|
|
|
|
if ( exists $args{'propertyName'}) { |
1962
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{propertyName}\E/$args{'propertyName'}/g; |
1963
|
|
|
|
|
|
|
}else{ |
1964
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]propertyName.*?(?=&|\?|$)//g; |
1965
|
|
|
|
|
|
|
}# query params |
1966
|
0
|
0
|
|
|
|
|
if ( exists $args{'storage'}) { |
1967
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g; |
1968
|
|
|
|
|
|
|
}else{ |
1969
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]storage.*?(?=&|\?|$)//g; |
1970
|
|
|
|
|
|
|
}# query params |
1971
|
0
|
0
|
|
|
|
|
if ( exists $args{'folder'}) { |
1972
|
0
|
|
|
|
|
|
$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g; |
1973
|
|
|
|
|
|
|
}else{ |
1974
|
0
|
|
|
|
|
|
$_resource_path =~ s/[?&]folder.*?(?=&|\?|$)//g; |
1975
|
|
|
|
|
|
|
} |
1976
|
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
|
|
1978
|
0
|
|
|
|
|
|
my $_body_data; |
1979
|
|
|
|
|
|
|
|
1980
|
|
|
|
|
|
|
|
1981
|
|
|
|
|
|
|
# body params |
1982
|
0
|
0
|
|
|
|
|
if ( exists $args{'body'}) { |
1983
|
0
|
|
|
|
|
|
$_body_data = $args{'body'}; |
1984
|
|
|
|
|
|
|
} |
1985
|
|
|
|
|
|
|
|
1986
|
|
|
|
|
|
|
# authentication setting, if any |
1987
|
0
|
|
|
|
|
|
my $auth_settings = []; |
1988
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
# make the API Call |
1990
|
0
|
|
|
|
|
|
my $response = $self->{api_client}->call_api($_resource_path, $_method, |
1991
|
|
|
|
|
|
|
$query_params, $form_params, |
1992
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings); |
1993
|
0
|
0
|
|
|
|
|
if (!$response) { |
1994
|
0
|
|
|
|
|
|
return; |
1995
|
|
|
|
|
|
|
} |
1996
|
|
|
|
|
|
|
|
1997
|
0
|
0
|
|
|
|
|
if($AsposeEmailCloud::Configuration::debug){ |
1998
|
0
|
|
|
|
|
|
print "\nResponse Content: ".$response->content; |
1999
|
|
|
|
|
|
|
} |
2000
|
|
|
|
|
|
|
|
2001
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'EmailPropertyResponse', $response->header('content-type')); |
2002
|
0
|
|
|
|
|
|
return $_response_object; |
2003
|
|
|
|
|
|
|
|
2004
|
|
|
|
|
|
|
} |
2005
|
|
|
|
|
|
|
|
2006
|
|
|
|
|
|
|
|
2007
|
|
|
|
|
|
|
1; |