aspose_email_cloud 18.7.0 → 19.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose-email-cloud.rb +145 -0
- data/lib/aspose-email-cloud/api/email_api.rb +577 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/api_client.rb +125 -133
- data/lib/aspose-email-cloud/api_error.rb +42 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/configuration.rb +56 -43
- data/lib/aspose-email-cloud/models/account_base_request.rb +250 -0
- data/lib/aspose-email-cloud/models/add_attachment_request.rb +219 -0
- data/lib/aspose-email-cloud/models/append_email_account_base_request.rb +300 -0
- data/lib/aspose-email-cloud/models/append_email_base_request.rb +316 -0
- data/lib/aspose-email-cloud/models/append_email_mime_base_request.rb +335 -0
- data/lib/aspose-email-cloud/models/base_object.rb +225 -0
- data/lib/aspose-email-cloud/models/contact_format.rb +45 -0
- data/lib/aspose-email-cloud/models/create_email_request.rb +224 -0
- data/lib/aspose-email-cloud/models/create_folder_base_request.rb +297 -0
- data/lib/aspose-email-cloud/models/delete_folder_base_request.rb +302 -0
- data/lib/aspose-email-cloud/models/delete_message_base_request.rb +302 -0
- data/lib/aspose-email-cloud/models/disc_usage.rb +229 -0
- data/lib/aspose-email-cloud/models/email_account_request.rb +342 -0
- data/lib/aspose-email-cloud/models/email_document.rb +226 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_document_response.rb +105 -109
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_properties.rb +122 -97
- data/lib/aspose-email-cloud/models/email_property.rb +256 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/email_property_response.rb +105 -109
- data/lib/aspose-email-cloud/models/error.rb +241 -0
- data/lib/aspose-email-cloud/models/error_details.rb +224 -0
- data/lib/aspose-email-cloud/models/file_version.rb +289 -0
- data/lib/aspose-email-cloud/models/file_versions.rb +210 -0
- data/lib/aspose-email-cloud/models/files_list.rb +210 -0
- data/lib/aspose-email-cloud/models/files_upload_result.rb +223 -0
- data/lib/aspose-email-cloud/models/hierarchical_object.rb +238 -0
- data/lib/aspose-email-cloud/models/hierarchical_object_request.rb +224 -0
- data/lib/aspose-email-cloud/models/hierarchical_object_response.rb +219 -0
- data/lib/aspose-email-cloud/models/indexed_hierarchical_object.rb +254 -0
- data/lib/aspose-email-cloud/models/indexed_primitive_object.rb +252 -0
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/link.rb +138 -116
- data/lib/aspose-email-cloud/models/list_response_of_hierarchical_object_response.rb +208 -0
- data/{src/asposeemailcloud/models/email_document.rb → lib/aspose-email-cloud/models/list_response_of_mail_server_folder.rb} +105 -98
- data/{src/asposeemailcloud/models/list_folders_response.rb → lib/aspose-email-cloud/models/list_response_of_string.rb} +105 -111
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mail_server_folder.rb +116 -96
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/models/mime_response.rb +105 -109
- data/lib/aspose-email-cloud/models/object_exist.rb +229 -0
- data/lib/aspose-email-cloud/models/primitive_object.rb +236 -0
- data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +101 -0
- data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +94 -0
- data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +96 -0
- data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +108 -0
- data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/email_request.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +93 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +95 -0
- data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +100 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +93 -0
- data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +71 -0
- data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +78 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +80 -0
- data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/http_request.rb +51 -0
- data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +88 -0
- data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +105 -0
- data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +92 -0
- data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +81 -0
- data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +89 -0
- data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +75 -0
- data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +94 -0
- data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +82 -0
- data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +87 -0
- data/lib/aspose-email-cloud/models/save_email_account_request.rb +377 -0
- data/lib/aspose-email-cloud/models/save_o_auth_email_account_request.rb +447 -0
- data/lib/aspose-email-cloud/models/send_email_base_request.rb +267 -0
- data/lib/aspose-email-cloud/models/send_email_mime_base_request.rb +286 -0
- data/lib/aspose-email-cloud/models/set_email_property_request.rb +224 -0
- data/lib/aspose-email-cloud/models/set_message_read_flag_account_base_request.rb +302 -0
- data/{src/asposeemailcloud/models/email_property.rb → lib/aspose-email-cloud/models/storage_exist.rb} +110 -96
- data/lib/aspose-email-cloud/models/storage_file.rb +262 -0
- data/lib/aspose-email-cloud/models/storage_file_location.rb +254 -0
- data/lib/aspose-email-cloud/models/storage_folder_location.rb +219 -0
- data/{src/asposeemailcloud/models/list_response.rb → lib/aspose-email-cloud/models/value_response.rb} +105 -111
- data/{src/asposeemailcloud → lib/aspose-email-cloud}/version.rb +4 -4
- metadata +128 -38
- data/src/asposeemailcloud.rb +0 -55
- data/src/asposeemailcloud/api/email_api.rb +0 -418
- data/src/asposeemailcloud/api/email_client_api.rb +0 -960
- data/src/asposeemailcloud/api_error.rb +0 -38
- data/src/asposeemailcloud/models/http_status_code.rb +0 -76
- data/src/asposeemailcloud/models/protocol_type.rb +0 -34
- data/src/asposeemailcloud/models/saa_spose_response.rb +0 -202
- data/src/asposeemailcloud/models/security_options.rb +0 -33
@@ -0,0 +1,286 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="SendEmailMimeBaseRequest.rb">
|
3
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
4
|
+
# </copyright>
|
5
|
+
# <summary>
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
7
|
+
# copy of this software and associated documentation files (the "Software"),
|
8
|
+
# to deal in the Software without restriction, including without limitation
|
9
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
10
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
11
|
+
# Software is furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
22
|
+
# DEALINGS IN THE SOFTWARE.
|
23
|
+
# </summary>
|
24
|
+
# ----------------------------------------------------------------------------
|
25
|
+
|
26
|
+
|
27
|
+
require 'date'
|
28
|
+
|
29
|
+
module AsposeEmailCloud
|
30
|
+
# Send email MIME request
|
31
|
+
class SendEmailMimeBaseRequest
|
32
|
+
attr_accessor :first_account
|
33
|
+
|
34
|
+
attr_accessor :second_account
|
35
|
+
|
36
|
+
attr_accessor :storage_folder
|
37
|
+
|
38
|
+
# Email document serialized as MIME
|
39
|
+
attr_accessor :base64_mime_message
|
40
|
+
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
42
|
+
def self.attribute_map
|
43
|
+
{
|
44
|
+
:'first_account' => :'firstAccount',
|
45
|
+
:'second_account' => :'secondAccount',
|
46
|
+
:'storage_folder' => :'storageFolder',
|
47
|
+
:'base64_mime_message' => :'base64MimeMessage'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.swagger_types
|
53
|
+
{
|
54
|
+
:'first_account' => :'String',
|
55
|
+
:'second_account' => :'String',
|
56
|
+
:'storage_folder' => :'StorageFolderLocation',
|
57
|
+
:'base64_mime_message' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return unless attributes.is_a?(Hash)
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
|
+
|
69
|
+
if attributes.has_key?(:'firstAccount')
|
70
|
+
self.first_account = attributes[:'firstAccount']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'secondAccount')
|
74
|
+
self.second_account = attributes[:'secondAccount']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'storageFolder')
|
78
|
+
self.storage_folder = attributes[:'storageFolder']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'base64MimeMessage')
|
82
|
+
self.base64_mime_message = attributes[:'base64MimeMessage']
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
def initialize(first_account=nil, second_account=nil, storage_folder=nil, base64_mime_message=nil)
|
88
|
+
self.first_account = first_account
|
89
|
+
self.second_account = second_account
|
90
|
+
self.storage_folder = storage_folder
|
91
|
+
self.base64_mime_message = base64_mime_message
|
92
|
+
end
|
93
|
+
|
94
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
95
|
+
# @return Array for valid properties with the reasons
|
96
|
+
def list_invalid_properties
|
97
|
+
invalid_properties = Array.new
|
98
|
+
if @first_account.nil?
|
99
|
+
invalid_properties.push('invalid value for "first_account", first_account cannot be nil.')
|
100
|
+
end
|
101
|
+
|
102
|
+
if @first_account.to_s.length < 1
|
103
|
+
invalid_properties.push('invalid value for "first_account", the character length must be great than or equal to 1.')
|
104
|
+
end
|
105
|
+
|
106
|
+
if @base64_mime_message.nil?
|
107
|
+
invalid_properties.push('invalid value for "base64_mime_message", base64_mime_message cannot be nil.')
|
108
|
+
end
|
109
|
+
|
110
|
+
if @base64_mime_message.to_s.length < 1
|
111
|
+
invalid_properties.push('invalid value for "base64_mime_message", the character length must be great than or equal to 1.')
|
112
|
+
end
|
113
|
+
|
114
|
+
invalid_properties
|
115
|
+
end
|
116
|
+
|
117
|
+
# Check to see if the all the properties in the model are valid
|
118
|
+
# @return true if the model is valid
|
119
|
+
def valid?
|
120
|
+
return false if @first_account.nil?
|
121
|
+
return false if @first_account.to_s.length < 1
|
122
|
+
return false if @base64_mime_message.nil?
|
123
|
+
return false if @base64_mime_message.to_s.length < 1
|
124
|
+
true
|
125
|
+
end
|
126
|
+
|
127
|
+
# Custom attribute writer method with validation
|
128
|
+
# @param [Object] first_account Value to be assigned
|
129
|
+
def first_account=(first_account)
|
130
|
+
if first_account.nil?
|
131
|
+
fail ArgumentError, 'first_account cannot be nil'
|
132
|
+
end
|
133
|
+
|
134
|
+
if first_account.to_s.length < 1
|
135
|
+
fail ArgumentError, 'invalid value for "first_account", the character length must be great than or equal to 1.'
|
136
|
+
end
|
137
|
+
|
138
|
+
@first_account = first_account
|
139
|
+
end
|
140
|
+
|
141
|
+
# Custom attribute writer method with validation
|
142
|
+
# @param [Object] base64_mime_message Value to be assigned
|
143
|
+
def base64_mime_message=(base64_mime_message)
|
144
|
+
if base64_mime_message.nil?
|
145
|
+
fail ArgumentError, 'base64_mime_message cannot be nil'
|
146
|
+
end
|
147
|
+
|
148
|
+
if base64_mime_message.to_s.length < 1
|
149
|
+
fail ArgumentError, 'invalid value for "base64_mime_message", the character length must be great than or equal to 1.'
|
150
|
+
end
|
151
|
+
|
152
|
+
@base64_mime_message = base64_mime_message
|
153
|
+
end
|
154
|
+
|
155
|
+
# Checks equality by comparing each attribute.
|
156
|
+
# @param [Object] Object to be compared
|
157
|
+
def ==(o)
|
158
|
+
return true if self.equal?(o)
|
159
|
+
self.class == o.class &&
|
160
|
+
first_account == o.first_account &&
|
161
|
+
second_account == o.second_account &&
|
162
|
+
storage_folder == o.storage_folder &&
|
163
|
+
base64_mime_message == o.base64_mime_message
|
164
|
+
end
|
165
|
+
|
166
|
+
# @see the `==` method
|
167
|
+
# @param [Object] Object to be compared
|
168
|
+
def eql?(o)
|
169
|
+
self == o
|
170
|
+
end
|
171
|
+
|
172
|
+
# Calculates hash code according to all attributes.
|
173
|
+
# @return [Fixnum] Hash code
|
174
|
+
def hash
|
175
|
+
[first_account, second_account, storage_folder, base64_mime_message].hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Builds the object from hash
|
179
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
180
|
+
# @return [Object] Returns the model itself
|
181
|
+
def build_from_hash(attributes)
|
182
|
+
return nil unless attributes.is_a?(Hash)
|
183
|
+
self.class.swagger_types.each_pair do |key, type|
|
184
|
+
attribute_key = self.class.attribute_map[key]
|
185
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
186
|
+
if type =~ /\AArray<(.*)>/i
|
187
|
+
# check to ensure the input is an array given that the the attribute
|
188
|
+
# is documented as an array but the input is not
|
189
|
+
if attributes[attribute_key].is_a?(Array)
|
190
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
191
|
+
end
|
192
|
+
elsif !attributes[attribute_key].nil?
|
193
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
194
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
195
|
+
end
|
196
|
+
|
197
|
+
self
|
198
|
+
end
|
199
|
+
|
200
|
+
# Deserializes the data based on type
|
201
|
+
# @param string type Data type
|
202
|
+
# @param string value Value to be deserialized
|
203
|
+
# @return [Object] Deserialized data
|
204
|
+
def _deserialize(type, value)
|
205
|
+
case type.to_sym
|
206
|
+
when :DateTime
|
207
|
+
DateTime.parse(value)
|
208
|
+
when :Date
|
209
|
+
Date.parse(value)
|
210
|
+
when :String
|
211
|
+
value.to_s
|
212
|
+
when :Integer
|
213
|
+
value.to_i
|
214
|
+
when :Float
|
215
|
+
value.to_f
|
216
|
+
when :BOOLEAN
|
217
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
218
|
+
true
|
219
|
+
else
|
220
|
+
false
|
221
|
+
end
|
222
|
+
when :Object
|
223
|
+
# generic object (usually a Hash), return directly
|
224
|
+
value
|
225
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
226
|
+
inner_type = Regexp.last_match[:inner_type]
|
227
|
+
value.map { |v| _deserialize(inner_type, v) }
|
228
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
229
|
+
k_type = Regexp.last_match[:k_type]
|
230
|
+
v_type = Regexp.last_match[:v_type]
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each do |k, v|
|
233
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
else # model
|
237
|
+
type = value[:type] || type
|
238
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
239
|
+
temp_model.build_from_hash(value)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the string representation of the object
|
244
|
+
# @return [String] String presentation of the object
|
245
|
+
def to_s
|
246
|
+
to_hash.to_s
|
247
|
+
end
|
248
|
+
|
249
|
+
# to_body is an alias to to_hash (backward compatibility)
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_body
|
252
|
+
to_hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Returns the object in the form of hash
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
257
|
+
def to_hash
|
258
|
+
hash = {}
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
260
|
+
value = self.send(attr)
|
261
|
+
next if value.nil?
|
262
|
+
hash[param] = _to_hash(value)
|
263
|
+
end
|
264
|
+
hash
|
265
|
+
end
|
266
|
+
|
267
|
+
# Outputs non-array value in the form of hash
|
268
|
+
# For object, use to_hash. Otherwise, just return the value
|
269
|
+
# @param [Object] value Any valid value
|
270
|
+
# @return [Hash] Returns the value in the form of hash
|
271
|
+
def _to_hash(value)
|
272
|
+
if value.is_a?(Array)
|
273
|
+
value.compact.map { |v| _to_hash(v) }
|
274
|
+
elsif value.is_a?(Hash)
|
275
|
+
{}.tap do |hash|
|
276
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
277
|
+
end
|
278
|
+
elsif value.respond_to? :to_hash
|
279
|
+
value.to_hash
|
280
|
+
else
|
281
|
+
value
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|
286
|
+
end
|
@@ -0,0 +1,224 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="SetEmailPropertyRequest.rb">
|
3
|
+
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
|
4
|
+
# </copyright>
|
5
|
+
# <summary>
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
7
|
+
# copy of this software and associated documentation files (the "Software"),
|
8
|
+
# to deal in the Software without restriction, including without limitation
|
9
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
10
|
+
# and/or sell copies of the Software, and to permit persons to whom the
|
11
|
+
# Software is furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
22
|
+
# DEALINGS IN THE SOFTWARE.
|
23
|
+
# </summary>
|
24
|
+
# ----------------------------------------------------------------------------
|
25
|
+
|
26
|
+
|
27
|
+
require 'date'
|
28
|
+
|
29
|
+
module AsposeEmailCloud
|
30
|
+
# Update email document property request
|
31
|
+
class SetEmailPropertyRequest
|
32
|
+
# An email property that should be updated
|
33
|
+
attr_accessor :email_property
|
34
|
+
|
35
|
+
# An email document location in storage
|
36
|
+
attr_accessor :storage_folder
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'email_property' => :'emailProperty',
|
42
|
+
:'storage_folder' => :'storageFolder'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'email_property' => :'EmailProperty',
|
50
|
+
:'storage_folder' => :'StorageFolderLocation'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
return unless attributes.is_a?(Hash)
|
58
|
+
|
59
|
+
# convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
61
|
+
|
62
|
+
if attributes.has_key?(:'emailProperty')
|
63
|
+
self.email_property = attributes[:'emailProperty']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'storageFolder')
|
67
|
+
self.storage_folder = attributes[:'storageFolder']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
def initialize(email_property=nil, storage_folder=nil)
|
73
|
+
self.email_property = email_property
|
74
|
+
self.storage_folder = storage_folder
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
if @email_property.nil?
|
82
|
+
invalid_properties.push('invalid value for "email_property", email_property cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
return false if @email_property.nil?
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def ==(o)
|
98
|
+
return true if self.equal?(o)
|
99
|
+
self.class == o.class &&
|
100
|
+
email_property == o.email_property &&
|
101
|
+
storage_folder == o.storage_folder
|
102
|
+
end
|
103
|
+
|
104
|
+
# @see the `==` method
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def eql?(o)
|
107
|
+
self == o
|
108
|
+
end
|
109
|
+
|
110
|
+
# Calculates hash code according to all attributes.
|
111
|
+
# @return [Fixnum] Hash code
|
112
|
+
def hash
|
113
|
+
[email_property, storage_folder].hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.swagger_types.each_pair do |key, type|
|
122
|
+
attribute_key = self.class.attribute_map[key]
|
123
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
124
|
+
if type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[attribute_key].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[attribute_key].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
132
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
133
|
+
end
|
134
|
+
|
135
|
+
self
|
136
|
+
end
|
137
|
+
|
138
|
+
# Deserializes the data based on type
|
139
|
+
# @param string type Data type
|
140
|
+
# @param string value Value to be deserialized
|
141
|
+
# @return [Object] Deserialized data
|
142
|
+
def _deserialize(type, value)
|
143
|
+
case type.to_sym
|
144
|
+
when :DateTime
|
145
|
+
DateTime.parse(value)
|
146
|
+
when :Date
|
147
|
+
Date.parse(value)
|
148
|
+
when :String
|
149
|
+
value.to_s
|
150
|
+
when :Integer
|
151
|
+
value.to_i
|
152
|
+
when :Float
|
153
|
+
value.to_f
|
154
|
+
when :BOOLEAN
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
type = value[:type] || type
|
176
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
177
|
+
temp_model.build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
next if value.nil?
|
200
|
+
hash[param] = _to_hash(value)
|
201
|
+
end
|
202
|
+
hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Outputs non-array value in the form of hash
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
207
|
+
# @param [Object] value Any valid value
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
209
|
+
def _to_hash(value)
|
210
|
+
if value.is_a?(Array)
|
211
|
+
value.compact.map { |v| _to_hash(v) }
|
212
|
+
elsif value.is_a?(Hash)
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
215
|
+
end
|
216
|
+
elsif value.respond_to? :to_hash
|
217
|
+
value.to_hash
|
218
|
+
else
|
219
|
+
value
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
end
|