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,229 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="DiscUsage.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
|
+
# Class for disc space information.
|
31
|
+
class DiscUsage
|
32
|
+
# Application used disc space.
|
33
|
+
attr_accessor :used_size
|
34
|
+
|
35
|
+
# Total disc space.
|
36
|
+
attr_accessor :total_size
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'used_size' => :'usedSize',
|
42
|
+
:'total_size' => :'totalSize'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'used_size' => :'Integer',
|
50
|
+
:'total_size' => :'Integer'
|
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?(:'usedSize')
|
63
|
+
self.used_size = attributes[:'usedSize']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'totalSize')
|
67
|
+
self.total_size = attributes[:'totalSize']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
def initialize(used_size=nil, total_size=nil)
|
73
|
+
self.used_size = used_size
|
74
|
+
self.total_size = total_size
|
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 @used_size.nil?
|
82
|
+
invalid_properties.push('invalid value for "used_size", used_size cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
if @total_size.nil?
|
86
|
+
invalid_properties.push('invalid value for "total_size", total_size cannot be nil.')
|
87
|
+
end
|
88
|
+
|
89
|
+
invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
return false if @used_size.nil?
|
96
|
+
return false if @total_size.nil?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if self.equal?(o)
|
104
|
+
self.class == o.class &&
|
105
|
+
used_size == o.used_size &&
|
106
|
+
total_size == o.total_size
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(o)
|
112
|
+
self == o
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Fixnum] Hash code
|
117
|
+
def hash
|
118
|
+
[used_size, total_size].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.swagger_types.each_pair do |key, type|
|
127
|
+
attribute_key = self.class.attribute_map[key]
|
128
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
129
|
+
if type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[attribute_key].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[attribute_key].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
137
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :DateTime
|
150
|
+
DateTime.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :BOOLEAN
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
type = value[:type] || type
|
181
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
182
|
+
temp_model.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
next if value.nil?
|
205
|
+
hash[param] = _to_hash(value)
|
206
|
+
end
|
207
|
+
hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Outputs non-array value in the form of hash
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
212
|
+
# @param [Object] value Any valid value
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,342 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="EmailAccountRequest.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
|
+
# Email account settings request
|
31
|
+
class EmailAccountRequest
|
32
|
+
# Email account host
|
33
|
+
attr_accessor :host
|
34
|
+
|
35
|
+
# Email account port
|
36
|
+
attr_accessor :port
|
37
|
+
|
38
|
+
# Email account login
|
39
|
+
attr_accessor :login
|
40
|
+
|
41
|
+
# Email account security options
|
42
|
+
attr_accessor :security_options
|
43
|
+
|
44
|
+
# Email account protocol type
|
45
|
+
attr_accessor :protocol_type
|
46
|
+
|
47
|
+
# Email account description
|
48
|
+
attr_accessor :description
|
49
|
+
|
50
|
+
# A storage file location info to store email account
|
51
|
+
attr_accessor :storage_file
|
52
|
+
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'host' => :'host',
|
57
|
+
:'port' => :'port',
|
58
|
+
:'login' => :'login',
|
59
|
+
:'security_options' => :'securityOptions',
|
60
|
+
:'protocol_type' => :'protocolType',
|
61
|
+
:'description' => :'description',
|
62
|
+
:'storage_file' => :'storageFile'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute type mapping.
|
67
|
+
def self.swagger_types
|
68
|
+
{
|
69
|
+
:'host' => :'String',
|
70
|
+
:'port' => :'Integer',
|
71
|
+
:'login' => :'String',
|
72
|
+
:'security_options' => :'Object',
|
73
|
+
:'protocol_type' => :'Object',
|
74
|
+
:'description' => :'String',
|
75
|
+
:'storage_file' => :'StorageFileLocation'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
return unless attributes.is_a?(Hash)
|
83
|
+
|
84
|
+
# convert string to symbol for hash key
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
86
|
+
|
87
|
+
if attributes.has_key?(:'host')
|
88
|
+
self.host = attributes[:'host']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'port')
|
92
|
+
self.port = attributes[:'port']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'login')
|
96
|
+
self.login = attributes[:'login']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'securityOptions')
|
100
|
+
self.security_options = attributes[:'securityOptions']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'protocolType')
|
104
|
+
self.protocol_type = attributes[:'protocolType']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'description')
|
108
|
+
self.description = attributes[:'description']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'storageFile')
|
112
|
+
self.storage_file = attributes[:'storageFile']
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# Initializes the object
|
117
|
+
def initialize(host=nil, port=nil, login=nil, security_options=nil, protocol_type=nil, description=nil, storage_file=nil)
|
118
|
+
self.host = host
|
119
|
+
self.port = port
|
120
|
+
self.login = login
|
121
|
+
self.security_options = security_options
|
122
|
+
self.protocol_type = protocol_type
|
123
|
+
self.description = description
|
124
|
+
self.storage_file = storage_file
|
125
|
+
end
|
126
|
+
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
128
|
+
# @return Array for valid properties with the reasons
|
129
|
+
def list_invalid_properties
|
130
|
+
invalid_properties = Array.new
|
131
|
+
if @host.nil?
|
132
|
+
invalid_properties.push('invalid value for "host", host cannot be nil.')
|
133
|
+
end
|
134
|
+
|
135
|
+
if @host.to_s.length < 1
|
136
|
+
invalid_properties.push('invalid value for "host", the character length must be great than or equal to 1.')
|
137
|
+
end
|
138
|
+
|
139
|
+
if @port.nil?
|
140
|
+
invalid_properties.push('invalid value for "port", port cannot be nil.')
|
141
|
+
end
|
142
|
+
|
143
|
+
if @login.nil?
|
144
|
+
invalid_properties.push('invalid value for "login", login cannot be nil.')
|
145
|
+
end
|
146
|
+
|
147
|
+
if @login.to_s.length < 1
|
148
|
+
invalid_properties.push('invalid value for "login", the character length must be great than or equal to 1.')
|
149
|
+
end
|
150
|
+
|
151
|
+
if @security_options.nil?
|
152
|
+
invalid_properties.push('invalid value for "security_options", security_options cannot be nil.')
|
153
|
+
end
|
154
|
+
|
155
|
+
if @protocol_type.nil?
|
156
|
+
invalid_properties.push('invalid value for "protocol_type", protocol_type cannot be nil.')
|
157
|
+
end
|
158
|
+
|
159
|
+
if @storage_file.nil?
|
160
|
+
invalid_properties.push('invalid value for "storage_file", storage_file cannot be nil.')
|
161
|
+
end
|
162
|
+
|
163
|
+
invalid_properties
|
164
|
+
end
|
165
|
+
|
166
|
+
# Check to see if the all the properties in the model are valid
|
167
|
+
# @return true if the model is valid
|
168
|
+
def valid?
|
169
|
+
return false if @host.nil?
|
170
|
+
return false if @host.to_s.length < 1
|
171
|
+
return false if @port.nil?
|
172
|
+
return false if @login.nil?
|
173
|
+
return false if @login.to_s.length < 1
|
174
|
+
return false if @security_options.nil?
|
175
|
+
return false if @protocol_type.nil?
|
176
|
+
return false if @storage_file.nil?
|
177
|
+
true
|
178
|
+
end
|
179
|
+
|
180
|
+
# Custom attribute writer method with validation
|
181
|
+
# @param [Object] host Value to be assigned
|
182
|
+
def host=(host)
|
183
|
+
if host.nil?
|
184
|
+
fail ArgumentError, 'host cannot be nil'
|
185
|
+
end
|
186
|
+
|
187
|
+
if host.to_s.length < 1
|
188
|
+
fail ArgumentError, 'invalid value for "host", the character length must be great than or equal to 1.'
|
189
|
+
end
|
190
|
+
|
191
|
+
@host = host
|
192
|
+
end
|
193
|
+
|
194
|
+
# Custom attribute writer method with validation
|
195
|
+
# @param [Object] login Value to be assigned
|
196
|
+
def login=(login)
|
197
|
+
if login.nil?
|
198
|
+
fail ArgumentError, 'login cannot be nil'
|
199
|
+
end
|
200
|
+
|
201
|
+
if login.to_s.length < 1
|
202
|
+
fail ArgumentError, 'invalid value for "login", the character length must be great than or equal to 1.'
|
203
|
+
end
|
204
|
+
|
205
|
+
@login = login
|
206
|
+
end
|
207
|
+
|
208
|
+
# Checks equality by comparing each attribute.
|
209
|
+
# @param [Object] Object to be compared
|
210
|
+
def ==(o)
|
211
|
+
return true if self.equal?(o)
|
212
|
+
self.class == o.class &&
|
213
|
+
host == o.host &&
|
214
|
+
port == o.port &&
|
215
|
+
login == o.login &&
|
216
|
+
security_options == o.security_options &&
|
217
|
+
protocol_type == o.protocol_type &&
|
218
|
+
description == o.description &&
|
219
|
+
storage_file == o.storage_file
|
220
|
+
end
|
221
|
+
|
222
|
+
# @see the `==` method
|
223
|
+
# @param [Object] Object to be compared
|
224
|
+
def eql?(o)
|
225
|
+
self == o
|
226
|
+
end
|
227
|
+
|
228
|
+
# Calculates hash code according to all attributes.
|
229
|
+
# @return [Fixnum] Hash code
|
230
|
+
def hash
|
231
|
+
[host, port, login, security_options, protocol_type, description, storage_file].hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Builds the object from hash
|
235
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
236
|
+
# @return [Object] Returns the model itself
|
237
|
+
def build_from_hash(attributes)
|
238
|
+
return nil unless attributes.is_a?(Hash)
|
239
|
+
self.class.swagger_types.each_pair do |key, type|
|
240
|
+
attribute_key = self.class.attribute_map[key]
|
241
|
+
attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
|
242
|
+
if type =~ /\AArray<(.*)>/i
|
243
|
+
# check to ensure the input is an array given that the the attribute
|
244
|
+
# is documented as an array but the input is not
|
245
|
+
if attributes[attribute_key].is_a?(Array)
|
246
|
+
self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
|
247
|
+
end
|
248
|
+
elsif !attributes[attribute_key].nil?
|
249
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
|
250
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
251
|
+
end
|
252
|
+
|
253
|
+
self
|
254
|
+
end
|
255
|
+
|
256
|
+
# Deserializes the data based on type
|
257
|
+
# @param string type Data type
|
258
|
+
# @param string value Value to be deserialized
|
259
|
+
# @return [Object] Deserialized data
|
260
|
+
def _deserialize(type, value)
|
261
|
+
case type.to_sym
|
262
|
+
when :DateTime
|
263
|
+
DateTime.parse(value)
|
264
|
+
when :Date
|
265
|
+
Date.parse(value)
|
266
|
+
when :String
|
267
|
+
value.to_s
|
268
|
+
when :Integer
|
269
|
+
value.to_i
|
270
|
+
when :Float
|
271
|
+
value.to_f
|
272
|
+
when :BOOLEAN
|
273
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
274
|
+
true
|
275
|
+
else
|
276
|
+
false
|
277
|
+
end
|
278
|
+
when :Object
|
279
|
+
# generic object (usually a Hash), return directly
|
280
|
+
value
|
281
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
282
|
+
inner_type = Regexp.last_match[:inner_type]
|
283
|
+
value.map { |v| _deserialize(inner_type, v) }
|
284
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
285
|
+
k_type = Regexp.last_match[:k_type]
|
286
|
+
v_type = Regexp.last_match[:v_type]
|
287
|
+
{}.tap do |hash|
|
288
|
+
value.each do |k, v|
|
289
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
else # model
|
293
|
+
type = value[:type] || type
|
294
|
+
temp_model = AsposeEmailCloud.const_get(type).new
|
295
|
+
temp_model.build_from_hash(value)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
# Returns the string representation of the object
|
300
|
+
# @return [String] String presentation of the object
|
301
|
+
def to_s
|
302
|
+
to_hash.to_s
|
303
|
+
end
|
304
|
+
|
305
|
+
# to_body is an alias to to_hash (backward compatibility)
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_body
|
308
|
+
to_hash
|
309
|
+
end
|
310
|
+
|
311
|
+
# Returns the object in the form of hash
|
312
|
+
# @return [Hash] Returns the object in the form of hash
|
313
|
+
def to_hash
|
314
|
+
hash = {}
|
315
|
+
self.class.attribute_map.each_pair do |attr, param|
|
316
|
+
value = self.send(attr)
|
317
|
+
next if value.nil?
|
318
|
+
hash[param] = _to_hash(value)
|
319
|
+
end
|
320
|
+
hash
|
321
|
+
end
|
322
|
+
|
323
|
+
# Outputs non-array value in the form of hash
|
324
|
+
# For object, use to_hash. Otherwise, just return the value
|
325
|
+
# @param [Object] value Any valid value
|
326
|
+
# @return [Hash] Returns the value in the form of hash
|
327
|
+
def _to_hash(value)
|
328
|
+
if value.is_a?(Array)
|
329
|
+
value.compact.map { |v| _to_hash(v) }
|
330
|
+
elsif value.is_a?(Hash)
|
331
|
+
{}.tap do |hash|
|
332
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
333
|
+
end
|
334
|
+
elsif value.respond_to? :to_hash
|
335
|
+
value.to_hash
|
336
|
+
else
|
337
|
+
value
|
338
|
+
end
|
339
|
+
end
|
340
|
+
|
341
|
+
end
|
342
|
+
end
|