aspose_email_cloud 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +48 -0
- data/aspose_email_cloud.gemspec +26 -0
- data/lib/aspose_email_cloud.rb +38 -0
- data/lib/aspose_email_cloud/api/email_api.rb +431 -0
- data/lib/aspose_email_cloud/api_client.rb +335 -0
- data/lib/aspose_email_cloud/api_error.rb +24 -0
- data/lib/aspose_email_cloud/configuration.rb +166 -0
- data/lib/aspose_email_cloud/models/base_object.rb +88 -0
- data/lib/aspose_email_cloud/models/email_document.rb +63 -0
- data/lib/aspose_email_cloud/models/email_document_response.rb +79 -0
- data/lib/aspose_email_cloud/models/email_properties.rb +47 -0
- data/lib/aspose_email_cloud/models/email_property.rb +53 -0
- data/lib/aspose_email_cloud/models/email_property_response.rb +61 -0
- data/lib/aspose_email_cloud/models/link.rb +61 -0
- data/lib/aspose_email_cloud/models/stream.rb +37 -0
- data/lib/aspose_email_cloud/version.rb +3 -0
- data/test/data/README.TXT +1 -0
- data/test/data/email_test.eml +21 -0
- data/test/data/email_test2.eml +40 -0
- data/test/email_tests.rb +111 -0
- metadata +139 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f6617d7348582e8a7b024461472cc9d273a358bd
|
4
|
+
data.tar.gz: c3a01adb46dcaa7487c7a110fe53b061746e4f7e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 88f51cd23a71e8a822ce50844fcb5780bef752f55bdc3ba96c9458bffa0fd2e1ff1d67578f2b1e34d5958aec653758b23237bffb89b29f797f3219c146ceda03
|
7
|
+
data.tar.gz: eb14de8cf9881d5e6f1b32164d0de68c992510cf95809d8ef11ed44f7c586c8fb11aee431d585f7629f42b10fc09cb87b2475936a9ccf99acdfdb852e9ef9c21
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2001-2016 Aspose Pty Ltd
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Aspose.Email Cloud SDK For Ruby
|
2
|
+
This SDK lets you use [Aspose Cloud Email APIs](http://www.aspose.com/cloud/email-api.aspx) in your Ruby web apps.
|
3
|
+
|
4
|
+
## Installing
|
5
|
+
You can simply install Aspose Email Cloud SDK with gem:
|
6
|
+
|
7
|
+
`gem install aspose_email_cloud`
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
APIs of this SDK can be called as follows:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'aspose_email_cloud'
|
14
|
+
|
15
|
+
class EmailUsage
|
16
|
+
|
17
|
+
include AsposeEmailCloud
|
18
|
+
include AsposeStorageCloud
|
19
|
+
|
20
|
+
def initialize
|
21
|
+
#Get App key and App SID from https://cloud.aspose.com
|
22
|
+
AsposeApp.app_key_and_sid("APP_KEY", "APP_SID")
|
23
|
+
@email_api = EmailApi.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def upload_file(file_name)
|
27
|
+
@storage_api = StorageApi.new
|
28
|
+
response = @storage_api.put_create(file_name, File.open("data/" << file_name,"r") { |io| io.read } )
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_document_with_format
|
32
|
+
#Get mail in specified format
|
33
|
+
file_name = "email_test.eml"
|
34
|
+
upload_file(file_name)
|
35
|
+
|
36
|
+
response = @email_api.get_document_with_format(file_name, "msg")
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
```
|
41
|
+
## Unit Tests
|
42
|
+
Aspose Email SDK includes a suite of unit tests within the [test](https://github.com/asposeemail/Aspose_Email_Cloud/blob/master/SDKs/Aspose.Email_Cloud_SDK_for_Ruby/test/email_tests.rb) subdirectory. These Unit Tests also serves as examples of how to use the Aspose Email SDK.
|
43
|
+
|
44
|
+
## Contact
|
45
|
+
Your feedback is very important to us. Please email us all your queries and feedback at marketplace@aspose.com.
|
46
|
+
|
47
|
+
## License
|
48
|
+
Aspose Email SDK is available under the MIT license. See the [LICENSE](https://github.com/asposeemail/Aspose_Email_Cloud/blob/master/SDKs/Aspose.Email_Cloud_SDK_for_Ruby/LICENSE) file for more info.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "aspose_email_cloud/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "aspose_email_cloud"
|
7
|
+
s.version = AsposeEmailCloud::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["M. Sohail Ismail"]
|
10
|
+
s.email = ["muhammad.sohail@aspose.com"]
|
11
|
+
s.homepage = "http://www.aspose.com/cloud/email-api.aspx"
|
12
|
+
s.summary = %q{Aspose.Email for Cloud}
|
13
|
+
s.description = %q{Aspose.Email for Cloud is a REST API for creating email archiving applications that work with common email file formats. It lets developers manipulate message formats such as MSG, EML, and MHT files. The API supports many common tasks, for example accessing messages, reading message properties such as sender, receiver, message sent date, and message details. It also supports converting messages back and forth between EML, MSG and MHT formats. With Aspose.Email for Cloud, it is further possible to access messages and retrieve attachments that can then be saved to a local disc. The robust API saves developers time and effort when programming with emails in the cloud.}
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
s.add_runtime_dependency 'typhoeus', '~> 0.8'
|
17
|
+
s.add_runtime_dependency 'json', '~> 1.7'
|
18
|
+
s.add_runtime_dependency 'aspose_storage_cloud', '~> 1.0', '>= 1.0.0'
|
19
|
+
|
20
|
+
s.add_development_dependency 'minitest', '~> 5.8'
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.test_files = `git ls-files -- test/*`.split("\n")
|
24
|
+
s.executables = []
|
25
|
+
s.require_paths = ["lib"]
|
26
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'aspose_storage_cloud'
|
2
|
+
|
3
|
+
# Common files
|
4
|
+
require_relative 'aspose_email_cloud/api_client'
|
5
|
+
require_relative 'aspose_email_cloud/api_error'
|
6
|
+
require_relative 'aspose_email_cloud/version'
|
7
|
+
require_relative 'aspose_email_cloud/configuration'
|
8
|
+
|
9
|
+
# Models
|
10
|
+
require_relative 'aspose_email_cloud/models/base_object'
|
11
|
+
require_relative 'aspose_email_cloud/models/email_document'
|
12
|
+
require_relative 'aspose_email_cloud/models/email_properties'
|
13
|
+
require_relative 'aspose_email_cloud/models/stream'
|
14
|
+
require_relative 'aspose_email_cloud/models/email_property'
|
15
|
+
require_relative 'aspose_email_cloud/models/email_document_response'
|
16
|
+
require_relative 'aspose_email_cloud/models/email_property_response'
|
17
|
+
require_relative 'aspose_email_cloud/models/link'
|
18
|
+
|
19
|
+
# APIs
|
20
|
+
require_relative 'aspose_email_cloud/api/email_api'
|
21
|
+
|
22
|
+
module AsposeEmailCloud
|
23
|
+
class << self
|
24
|
+
# Configure sdk using block.
|
25
|
+
# AsposeEmailCloud.configure do |config|
|
26
|
+
# config.username = "xxx"
|
27
|
+
# config.password = "xxx"
|
28
|
+
# end
|
29
|
+
# If no block given, return the configuration singleton instance.
|
30
|
+
def configure
|
31
|
+
if block_given?
|
32
|
+
yield Configuration.instance
|
33
|
+
else
|
34
|
+
Configuration.instance
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,431 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
module AsposeEmailCloud
|
4
|
+
class EmailApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = nil)
|
8
|
+
@api_client = api_client || Configuration.api_client
|
9
|
+
end
|
10
|
+
|
11
|
+
# Get mail common info.
|
12
|
+
#
|
13
|
+
# @param name File name.
|
14
|
+
# @param [Hash] opts the optional parameters
|
15
|
+
# @option opts [String] :storage The document storage.
|
16
|
+
# @option opts [String] :folder Folder path.
|
17
|
+
# @return [File]
|
18
|
+
def get_document(name, opts = {})
|
19
|
+
if Configuration.debugging
|
20
|
+
Configuration.logger.debug "Calling API: EmailApi#get_document ..."
|
21
|
+
end
|
22
|
+
|
23
|
+
# verify the required parameter 'name' is set
|
24
|
+
fail "Missing the required parameter 'name' when calling get_document" if name.nil?
|
25
|
+
|
26
|
+
# resource path
|
27
|
+
path = "/email/{name}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
|
28
|
+
|
29
|
+
# query parameters
|
30
|
+
query_params = {}
|
31
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
32
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
33
|
+
|
34
|
+
# header parameters
|
35
|
+
header_params = {}
|
36
|
+
|
37
|
+
# HTTP header 'Accept' (if needed)
|
38
|
+
_header_accept = []
|
39
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
40
|
+
|
41
|
+
# HTTP header 'Content-Type'
|
42
|
+
_header_content_type = ['application/json']
|
43
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
44
|
+
|
45
|
+
# form parameters
|
46
|
+
form_params = {}
|
47
|
+
|
48
|
+
# http body (model)
|
49
|
+
post_body = nil
|
50
|
+
|
51
|
+
|
52
|
+
auth_names = []
|
53
|
+
result = @api_client.call_api(:GET, path,
|
54
|
+
:header_params => header_params,
|
55
|
+
:query_params => query_params,
|
56
|
+
:form_params => form_params,
|
57
|
+
:body => post_body,
|
58
|
+
:auth_names => auth_names,
|
59
|
+
:return_type => 'File')
|
60
|
+
if Configuration.debugging
|
61
|
+
Configuration.logger.debug "API called: EmailApi#get_document. Result: #{result.inspect}"
|
62
|
+
end
|
63
|
+
return result
|
64
|
+
end
|
65
|
+
|
66
|
+
# Get mail in specified format
|
67
|
+
#
|
68
|
+
# @param name File name.
|
69
|
+
# @param format
|
70
|
+
# @param [Hash] opts the optional parameters
|
71
|
+
# @option opts [String] :out_path
|
72
|
+
# @option opts [String] :storage The document storage.
|
73
|
+
# @option opts [String] :folder Folder path.
|
74
|
+
# @return [File]
|
75
|
+
def get_document_with_format(name, format, opts = {})
|
76
|
+
if Configuration.debugging
|
77
|
+
Configuration.logger.debug "Calling API: EmailApi#get_document_with_format ..."
|
78
|
+
end
|
79
|
+
|
80
|
+
# verify the required parameter 'name' is set
|
81
|
+
fail "Missing the required parameter 'name' when calling get_document_with_format" if name.nil?
|
82
|
+
|
83
|
+
# verify the required parameter 'format' is set
|
84
|
+
fail "Missing the required parameter 'format' when calling get_document_with_format" if format.nil?
|
85
|
+
|
86
|
+
# resource path
|
87
|
+
path = "/email/{name}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
|
88
|
+
|
89
|
+
# query parameters
|
90
|
+
query_params = {}
|
91
|
+
query_params[:'format'] = format
|
92
|
+
query_params[:'outPath'] = opts[:'out_path'] if opts[:'out_path']
|
93
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
94
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
95
|
+
|
96
|
+
# header parameters
|
97
|
+
header_params = {}
|
98
|
+
|
99
|
+
# HTTP header 'Accept' (if needed)
|
100
|
+
_header_accept = []
|
101
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
102
|
+
|
103
|
+
# HTTP header 'Content-Type'
|
104
|
+
_header_content_type = ['application/json']
|
105
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
106
|
+
|
107
|
+
# form parameters
|
108
|
+
form_params = {}
|
109
|
+
|
110
|
+
# http body (model)
|
111
|
+
post_body = nil
|
112
|
+
|
113
|
+
|
114
|
+
auth_names = []
|
115
|
+
result = @api_client.call_api(:GET, path,
|
116
|
+
:header_params => header_params,
|
117
|
+
:query_params => query_params,
|
118
|
+
:form_params => form_params,
|
119
|
+
:body => post_body,
|
120
|
+
:auth_names => auth_names,
|
121
|
+
:return_type => 'File')
|
122
|
+
if Configuration.debugging
|
123
|
+
Configuration.logger.debug "API called: EmailApi#get_document_with_format. Result: #{result.inspect}"
|
124
|
+
end
|
125
|
+
return result
|
126
|
+
end
|
127
|
+
|
128
|
+
# Add new email.
|
129
|
+
#
|
130
|
+
# @param name The email name.
|
131
|
+
# @param email Email data.
|
132
|
+
# @param [Hash] opts the optional parameters
|
133
|
+
# @option opts [String] :storage The document storage.
|
134
|
+
# @option opts [String] :folder The email folder.
|
135
|
+
# @return [EmailDocumentResponse]
|
136
|
+
def put_create_new_email(name, email, opts = {})
|
137
|
+
if Configuration.debugging
|
138
|
+
Configuration.logger.debug "Calling API: EmailApi#put_create_new_email ..."
|
139
|
+
end
|
140
|
+
|
141
|
+
# verify the required parameter 'name' is set
|
142
|
+
fail "Missing the required parameter 'name' when calling put_create_new_email" if name.nil?
|
143
|
+
|
144
|
+
# verify the required parameter 'email' is set
|
145
|
+
fail "Missing the required parameter 'email' when calling put_create_new_email" if email.nil?
|
146
|
+
|
147
|
+
# resource path
|
148
|
+
path = "/email/{name}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
|
149
|
+
|
150
|
+
# query parameters
|
151
|
+
query_params = {}
|
152
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
153
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
154
|
+
|
155
|
+
# header parameters
|
156
|
+
header_params = {}
|
157
|
+
|
158
|
+
# HTTP header 'Accept' (if needed)
|
159
|
+
_header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
|
160
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
161
|
+
|
162
|
+
# HTTP header 'Content-Type'
|
163
|
+
_header_content_type = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript', 'application/x-www-form-urlencoded']
|
164
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
165
|
+
|
166
|
+
# form parameters
|
167
|
+
form_params = {}
|
168
|
+
|
169
|
+
# http body (model)
|
170
|
+
post_body = @api_client.object_to_http_body(email)
|
171
|
+
|
172
|
+
|
173
|
+
auth_names = []
|
174
|
+
result = @api_client.call_api(:PUT, path,
|
175
|
+
:header_params => header_params,
|
176
|
+
:query_params => query_params,
|
177
|
+
:form_params => form_params,
|
178
|
+
:body => post_body,
|
179
|
+
:auth_names => auth_names,
|
180
|
+
:return_type => 'EmailDocumentResponse')
|
181
|
+
if Configuration.debugging
|
182
|
+
Configuration.logger.debug "API called: EmailApi#put_create_new_email. Result: #{result.inspect}"
|
183
|
+
end
|
184
|
+
return result
|
185
|
+
end
|
186
|
+
|
187
|
+
# Get email attachment by name.
|
188
|
+
#
|
189
|
+
# @param name The email message name.
|
190
|
+
# @param attach_name Attachment name.
|
191
|
+
# @param [Hash] opts the optional parameters
|
192
|
+
# @option opts [String] :storage Message storage.
|
193
|
+
# @option opts [String] :folder Message folder.
|
194
|
+
# @return [File]
|
195
|
+
def get_email_attachment(name, attach_name, opts = {})
|
196
|
+
if Configuration.debugging
|
197
|
+
Configuration.logger.debug "Calling API: EmailApi#get_email_attachment ..."
|
198
|
+
end
|
199
|
+
|
200
|
+
# verify the required parameter 'name' is set
|
201
|
+
fail "Missing the required parameter 'name' when calling get_email_attachment" if name.nil?
|
202
|
+
|
203
|
+
# verify the required parameter 'attach_name' is set
|
204
|
+
fail "Missing the required parameter 'attach_name' when calling get_email_attachment" if attach_name.nil?
|
205
|
+
|
206
|
+
# resource path
|
207
|
+
path = "/email/{name}/attachments/{attachName}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'attachName' + '}', attach_name.to_s)
|
208
|
+
|
209
|
+
# query parameters
|
210
|
+
query_params = {}
|
211
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
212
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
213
|
+
|
214
|
+
# header parameters
|
215
|
+
header_params = {}
|
216
|
+
|
217
|
+
# HTTP header 'Accept' (if needed)
|
218
|
+
_header_accept = []
|
219
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
220
|
+
|
221
|
+
# HTTP header 'Content-Type'
|
222
|
+
_header_content_type = []
|
223
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
224
|
+
|
225
|
+
# form parameters
|
226
|
+
form_params = {}
|
227
|
+
|
228
|
+
# http body (model)
|
229
|
+
post_body = nil
|
230
|
+
|
231
|
+
|
232
|
+
auth_names = []
|
233
|
+
result = @api_client.call_api(:GET, path,
|
234
|
+
:header_params => header_params,
|
235
|
+
:query_params => query_params,
|
236
|
+
:form_params => form_params,
|
237
|
+
:body => post_body,
|
238
|
+
:auth_names => auth_names,
|
239
|
+
:return_type => 'File')
|
240
|
+
if Configuration.debugging
|
241
|
+
Configuration.logger.debug "API called: EmailApi#get_email_attachment. Result: #{result.inspect}"
|
242
|
+
end
|
243
|
+
return result
|
244
|
+
end
|
245
|
+
|
246
|
+
# Add email attachment.
|
247
|
+
#
|
248
|
+
# @param name Email name.
|
249
|
+
# @param attach_name Attachment path.
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @option opts [String] :storage Email's storage.
|
252
|
+
# @option opts [String] :folder Email's folder.
|
253
|
+
# @return [EmailDocumentResponse]
|
254
|
+
def post_add_email_attachment(name, attach_name, opts = {})
|
255
|
+
if Configuration.debugging
|
256
|
+
Configuration.logger.debug "Calling API: EmailApi#post_add_email_attachment ..."
|
257
|
+
end
|
258
|
+
|
259
|
+
# verify the required parameter 'name' is set
|
260
|
+
fail "Missing the required parameter 'name' when calling post_add_email_attachment" if name.nil?
|
261
|
+
|
262
|
+
# verify the required parameter 'attach_name' is set
|
263
|
+
fail "Missing the required parameter 'attach_name' when calling post_add_email_attachment" if attach_name.nil?
|
264
|
+
|
265
|
+
# resource path
|
266
|
+
path = "/email/{name}/attachments/{attachName}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'attachName' + '}', attach_name.to_s)
|
267
|
+
|
268
|
+
# query parameters
|
269
|
+
query_params = {}
|
270
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
271
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
272
|
+
|
273
|
+
# header parameters
|
274
|
+
header_params = {}
|
275
|
+
|
276
|
+
# HTTP header 'Accept' (if needed)
|
277
|
+
_header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
|
278
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
279
|
+
|
280
|
+
# HTTP header 'Content-Type'
|
281
|
+
_header_content_type = []
|
282
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
283
|
+
|
284
|
+
# form parameters
|
285
|
+
form_params = {}
|
286
|
+
|
287
|
+
# http body (model)
|
288
|
+
post_body = nil
|
289
|
+
|
290
|
+
|
291
|
+
auth_names = []
|
292
|
+
result = @api_client.call_api(:POST, path,
|
293
|
+
:header_params => header_params,
|
294
|
+
:query_params => query_params,
|
295
|
+
:form_params => form_params,
|
296
|
+
:body => post_body,
|
297
|
+
:auth_names => auth_names,
|
298
|
+
:return_type => 'EmailDocumentResponse')
|
299
|
+
if Configuration.debugging
|
300
|
+
Configuration.logger.debug "API called: EmailApi#post_add_email_attachment. Result: #{result.inspect}"
|
301
|
+
end
|
302
|
+
return result
|
303
|
+
end
|
304
|
+
|
305
|
+
# Read document property by name.
|
306
|
+
#
|
307
|
+
# @param property_name Name of document property
|
308
|
+
# @param name File name
|
309
|
+
# @param [Hash] opts the optional parameters
|
310
|
+
# @option opts [String] :storage The document storage.
|
311
|
+
# @option opts [String] :folder Folder path
|
312
|
+
# @return [EmailPropertyResponse]
|
313
|
+
def get_email_property(property_name, name, opts = {})
|
314
|
+
if Configuration.debugging
|
315
|
+
Configuration.logger.debug "Calling API: EmailApi#get_email_property ..."
|
316
|
+
end
|
317
|
+
|
318
|
+
# verify the required parameter 'property_name' is set
|
319
|
+
fail "Missing the required parameter 'property_name' when calling get_email_property" if property_name.nil?
|
320
|
+
|
321
|
+
# verify the required parameter 'name' is set
|
322
|
+
fail "Missing the required parameter 'name' when calling get_email_property" if name.nil?
|
323
|
+
|
324
|
+
# resource path
|
325
|
+
path = "/email/{name}/properties/{propertyName}".sub('{format}','json').sub('{' + 'propertyName' + '}', property_name.to_s).sub('{' + 'name' + '}', name.to_s)
|
326
|
+
|
327
|
+
# query parameters
|
328
|
+
query_params = {}
|
329
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
330
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
331
|
+
|
332
|
+
# header parameters
|
333
|
+
header_params = {}
|
334
|
+
|
335
|
+
# HTTP header 'Accept' (if needed)
|
336
|
+
_header_accept = ['application/json']
|
337
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
338
|
+
|
339
|
+
# HTTP header 'Content-Type'
|
340
|
+
_header_content_type = []
|
341
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
342
|
+
|
343
|
+
# form parameters
|
344
|
+
form_params = {}
|
345
|
+
|
346
|
+
# http body (model)
|
347
|
+
post_body = nil
|
348
|
+
|
349
|
+
|
350
|
+
auth_names = []
|
351
|
+
result = @api_client.call_api(:GET, path,
|
352
|
+
:header_params => header_params,
|
353
|
+
:query_params => query_params,
|
354
|
+
:form_params => form_params,
|
355
|
+
:body => post_body,
|
356
|
+
:auth_names => auth_names,
|
357
|
+
:return_type => 'EmailPropertyResponse')
|
358
|
+
if Configuration.debugging
|
359
|
+
Configuration.logger.debug "API called: EmailApi#get_email_property. Result: #{result.inspect}"
|
360
|
+
end
|
361
|
+
return result
|
362
|
+
end
|
363
|
+
|
364
|
+
# Set document property.
|
365
|
+
#
|
366
|
+
# @param name
|
367
|
+
# @param property_name
|
368
|
+
# @param property
|
369
|
+
# @param [Hash] opts the optional parameters
|
370
|
+
# @option opts [String] :storage
|
371
|
+
# @option opts [String] :folder
|
372
|
+
# @return [EmailPropertyResponse]
|
373
|
+
def put_set_email_property(name, property_name, property, opts = {})
|
374
|
+
if Configuration.debugging
|
375
|
+
Configuration.logger.debug "Calling API: EmailApi#put_set_email_property ..."
|
376
|
+
end
|
377
|
+
|
378
|
+
# verify the required parameter 'name' is set
|
379
|
+
fail "Missing the required parameter 'name' when calling put_set_email_property" if name.nil?
|
380
|
+
|
381
|
+
# verify the required parameter 'property_name' is set
|
382
|
+
fail "Missing the required parameter 'property_name' when calling put_set_email_property" if property_name.nil?
|
383
|
+
|
384
|
+
# verify the required parameter 'property' is set
|
385
|
+
fail "Missing the required parameter 'property' when calling put_set_email_property" if property.nil?
|
386
|
+
|
387
|
+
# resource path
|
388
|
+
path = "/email/{name}/properties/{propertyName}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'propertyName' + '}', property_name.to_s)
|
389
|
+
|
390
|
+
# query parameters
|
391
|
+
query_params = {}
|
392
|
+
query_params[:'storage'] = opts[:'storage'] if opts[:'storage']
|
393
|
+
query_params[:'folder'] = opts[:'folder'] if opts[:'folder']
|
394
|
+
|
395
|
+
# header parameters
|
396
|
+
header_params = {}
|
397
|
+
|
398
|
+
# HTTP header 'Accept' (if needed)
|
399
|
+
_header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']
|
400
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
401
|
+
|
402
|
+
# HTTP header 'Content-Type'
|
403
|
+
_header_content_type = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript', 'application/x-www-form-urlencoded']
|
404
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
405
|
+
|
406
|
+
# form parameters
|
407
|
+
form_params = {}
|
408
|
+
|
409
|
+
# http body (model)
|
410
|
+
post_body = @api_client.object_to_http_body(property)
|
411
|
+
|
412
|
+
|
413
|
+
auth_names = []
|
414
|
+
result = @api_client.call_api(:PUT, path,
|
415
|
+
:header_params => header_params,
|
416
|
+
:query_params => query_params,
|
417
|
+
:form_params => form_params,
|
418
|
+
:body => post_body,
|
419
|
+
:auth_names => auth_names,
|
420
|
+
:return_type => 'EmailPropertyResponse')
|
421
|
+
if Configuration.debugging
|
422
|
+
Configuration.logger.debug "API called: EmailApi#put_set_email_property. Result: #{result.inspect}"
|
423
|
+
end
|
424
|
+
return result
|
425
|
+
end
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|