aspose_email_cloud 20.1.0 → 20.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +10 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +24 -0
  4. data/lib/aspose-email-cloud/models/discover_email_config_oauth.rb +388 -0
  5. data/lib/aspose-email-cloud/models/discover_email_config_password.rb +301 -0
  6. data/lib/aspose-email-cloud/models/discover_email_config_rq.rb +265 -0
  7. data/lib/aspose-email-cloud/models/email_account_config.rb +320 -0
  8. data/lib/aspose-email-cloud/models/email_account_config_list.rb +212 -0
  9. data/lib/aspose-email-cloud/models/list_response_of_email_account_config.rb +211 -0
  10. data/lib/aspose-email-cloud/models/name_value_pair.rb +222 -0
  11. data/lib/aspose-email-cloud/models/requests/add_calendar_attachment_request_data.rb +18 -8
  12. data/lib/aspose-email-cloud/models/requests/add_contact_attachment_request_data.rb +23 -10
  13. data/lib/aspose-email-cloud/models/requests/add_email_attachment_request_data.rb +18 -8
  14. data/lib/aspose-email-cloud/models/requests/add_mapi_attachment_request_data.rb +18 -8
  15. data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_request_data.rb +7 -3
  16. data/lib/aspose-email-cloud/models/requests/ai_bcr_ocr_storage_request_data.rb +7 -3
  17. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_model_request_data.rb +7 -3
  18. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_ocr_data_model_request_data.rb +7 -3
  19. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_request_data.rb +7 -3
  20. data/lib/aspose-email-cloud/models/requests/ai_bcr_parse_storage_request_data.rb +7 -3
  21. data/lib/aspose-email-cloud/models/requests/ai_name_complete_request_data.rb +32 -13
  22. data/lib/aspose-email-cloud/models/requests/ai_name_expand_parsed_request_data.rb +7 -3
  23. data/lib/aspose-email-cloud/models/requests/ai_name_expand_request_data.rb +32 -13
  24. data/lib/aspose-email-cloud/models/requests/ai_name_format_parsed_request_data.rb +7 -3
  25. data/lib/aspose-email-cloud/models/requests/ai_name_format_request_data.rb +37 -15
  26. data/lib/aspose-email-cloud/models/requests/ai_name_genderize_parsed_request_data.rb +7 -3
  27. data/lib/aspose-email-cloud/models/requests/ai_name_genderize_request_data.rb +32 -13
  28. data/lib/aspose-email-cloud/models/requests/ai_name_match_parsed_request_data.rb +7 -3
  29. data/lib/aspose-email-cloud/models/requests/ai_name_match_request_data.rb +38 -16
  30. data/lib/aspose-email-cloud/models/requests/ai_name_parse_email_address_request_data.rb +32 -13
  31. data/lib/aspose-email-cloud/models/requests/ai_name_parse_request_data.rb +32 -13
  32. data/lib/aspose-email-cloud/models/requests/append_email_message_request_data.rb +7 -3
  33. data/lib/aspose-email-cloud/models/requests/append_email_model_message_request_data.rb +7 -3
  34. data/lib/aspose-email-cloud/models/requests/append_mime_message_request_data.rb +7 -3
  35. data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_alternate_request_data.rb +7 -3
  36. data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +13 -6
  37. data/lib/aspose-email-cloud/models/requests/copy_file_request_data.rb +28 -12
  38. data/lib/aspose-email-cloud/models/requests/copy_folder_request_data.rb +23 -10
  39. data/lib/aspose-email-cloud/models/requests/create_calendar_request_data.rb +13 -6
  40. data/lib/aspose-email-cloud/models/requests/create_contact_request_data.rb +18 -8
  41. data/lib/aspose-email-cloud/models/requests/create_email_folder_request_data.rb +7 -3
  42. data/lib/aspose-email-cloud/models/requests/create_email_request_data.rb +14 -7
  43. data/lib/aspose-email-cloud/models/requests/create_folder_request_data.rb +12 -5
  44. data/lib/aspose-email-cloud/models/requests/create_mapi_request_data.rb +13 -6
  45. data/lib/aspose-email-cloud/models/requests/delete_calendar_property_request_data.rb +23 -10
  46. data/lib/aspose-email-cloud/models/requests/delete_contact_property_request_data.rb +28 -12
  47. data/lib/aspose-email-cloud/models/requests/delete_email_folder_request_data.rb +7 -3
  48. data/lib/aspose-email-cloud/models/requests/delete_email_message_request_data.rb +7 -3
  49. data/lib/aspose-email-cloud/models/requests/delete_file_request_data.rb +17 -7
  50. data/lib/aspose-email-cloud/models/requests/delete_folder_request_data.rb +17 -7
  51. data/lib/aspose-email-cloud/models/requests/delete_mapi_attachment_request_data.rb +18 -8
  52. data/lib/aspose-email-cloud/models/requests/delete_mapi_properties_request_data.rb +13 -6
  53. data/lib/aspose-email-cloud/models/requests/discover_email_config_oauth_request_data.rb +79 -0
  54. data/lib/aspose-email-cloud/models/requests/discover_email_config_password_request_data.rb +79 -0
  55. data/lib/aspose-email-cloud/models/requests/discover_email_config_request_data.rb +86 -0
  56. data/lib/aspose-email-cloud/models/requests/download_file_request_data.rb +17 -7
  57. data/lib/aspose-email-cloud/models/requests/fetch_email_message_request_data.rb +28 -12
  58. data/lib/aspose-email-cloud/models/requests/fetch_email_model_request_data.rb +28 -12
  59. data/lib/aspose-email-cloud/models/requests/get_calendar_attachment_request_data.rb +23 -10
  60. data/lib/aspose-email-cloud/models/requests/get_calendar_list_request_data.rb +24 -11
  61. data/lib/aspose-email-cloud/models/requests/get_calendar_model_as_alternate_request_data.rb +27 -11
  62. data/lib/aspose-email-cloud/models/requests/get_calendar_model_list_request_data.rb +22 -9
  63. data/lib/aspose-email-cloud/models/requests/get_calendar_model_request_data.rb +17 -7
  64. data/lib/aspose-email-cloud/models/requests/get_calendar_request_data.rb +17 -7
  65. data/lib/aspose-email-cloud/models/requests/get_contact_attachment_request_data.rb +28 -12
  66. data/lib/aspose-email-cloud/models/requests/get_contact_list_request_data.rb +27 -11
  67. data/lib/aspose-email-cloud/models/requests/get_contact_model_list_request_data.rb +27 -11
  68. data/lib/aspose-email-cloud/models/requests/get_contact_model_request_data.rb +22 -9
  69. data/lib/aspose-email-cloud/models/requests/get_contact_properties_request_data.rb +22 -9
  70. data/lib/aspose-email-cloud/models/requests/get_disc_usage_request_data.rb +6 -2
  71. data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +23 -10
  72. data/lib/aspose-email-cloud/models/requests/get_email_attachment_request_data.rb +23 -10
  73. data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +27 -11
  74. data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +22 -9
  75. data/lib/aspose-email-cloud/models/requests/get_email_property_request_data.rb +22 -9
  76. data/lib/aspose-email-cloud/models/requests/get_email_request_data.rb +17 -7
  77. data/lib/aspose-email-cloud/models/requests/get_file_versions_request_data.rb +12 -5
  78. data/lib/aspose-email-cloud/models/requests/get_files_list_request_data.rb +12 -5
  79. data/lib/aspose-email-cloud/models/requests/get_mapi_attachment_request_data.rb +23 -10
  80. data/lib/aspose-email-cloud/models/requests/get_mapi_attachments_request_data.rb +17 -7
  81. data/lib/aspose-email-cloud/models/requests/get_mapi_list_request_data.rb +21 -8
  82. data/lib/aspose-email-cloud/models/requests/get_mapi_properties_request_data.rb +17 -7
  83. data/lib/aspose-email-cloud/models/requests/list_email_folders_request_data.rb +27 -11
  84. data/lib/aspose-email-cloud/models/requests/list_email_messages_request_data.rb +39 -17
  85. data/lib/aspose-email-cloud/models/requests/list_email_models_request_data.rb +39 -17
  86. data/lib/aspose-email-cloud/models/requests/move_file_request_data.rb +28 -12
  87. data/lib/aspose-email-cloud/models/requests/move_folder_request_data.rb +23 -10
  88. data/lib/aspose-email-cloud/models/requests/object_exists_request_data.rb +17 -7
  89. data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +13 -6
  90. data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +18 -8
  91. data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +18 -8
  92. data/lib/aspose-email-cloud/models/requests/save_mail_account_request_data.rb +7 -3
  93. data/lib/aspose-email-cloud/models/requests/save_mail_o_auth_account_request_data.rb +7 -3
  94. data/lib/aspose-email-cloud/models/requests/send_email_mime_request_data.rb +7 -3
  95. data/lib/aspose-email-cloud/models/requests/send_email_model_request_data.rb +7 -3
  96. data/lib/aspose-email-cloud/models/requests/send_email_request_data.rb +7 -3
  97. data/lib/aspose-email-cloud/models/requests/set_email_property_request_data.rb +18 -8
  98. data/lib/aspose-email-cloud/models/requests/set_email_read_flag_request_data.rb +7 -3
  99. data/lib/aspose-email-cloud/models/requests/storage_exists_request_data.rb +7 -3
  100. data/lib/aspose-email-cloud/models/requests/update_calendar_properties_request_data.rb +13 -6
  101. data/lib/aspose-email-cloud/models/requests/update_contact_properties_request_data.rb +18 -8
  102. data/lib/aspose-email-cloud/models/requests/update_mapi_properties_request_data.rb +13 -6
  103. data/lib/aspose-email-cloud/models/requests/upload_file_request_data.rb +18 -8
  104. data/lib/aspose-email-cloud/version.rb +1 -1
  105. metadata +12 -2
@@ -0,0 +1,301 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="DiscoverEmailConfigPassword.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 DiscoverEmailConfigPassword
31
+ # Email address to discover.
32
+ # @return [String]
33
+ attr_accessor :address
34
+
35
+ # Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
36
+ # @return [BOOLEAN]
37
+ attr_accessor :fast_processing
38
+
39
+ # Email account login. If not specified, address used as a login.
40
+ # @return [String]
41
+ attr_accessor :login
42
+
43
+ # Email account password.
44
+ # @return [String]
45
+ attr_accessor :password
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'address' => :'address',
51
+ :'fast_processing' => :'fastProcessing',
52
+ :'login' => :'login',
53
+ :'password' => :'password'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ :'address' => :'String',
61
+ :'fast_processing' => :'BOOLEAN',
62
+ :'login' => :'String',
63
+ :'password' => :'String'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
74
+
75
+ if attributes.has_key?(:'address')
76
+ self.address = attributes[:'address']
77
+ end
78
+
79
+ if attributes.has_key?(:'fastProcessing')
80
+ self.fast_processing = attributes[:'fastProcessing']
81
+ end
82
+
83
+ if attributes.has_key?(:'login')
84
+ self.login = attributes[:'login']
85
+ end
86
+
87
+ if attributes.has_key?(:'password')
88
+ self.password = attributes[:'password']
89
+ end
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [String] address Email address to discover.
94
+ # @param [BOOLEAN] fast_processing Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
95
+ # @param [String] login Email account login. If not specified, address used as a login.
96
+ # @param [String] password Email account password.
97
+ def initialize(address=nil, fast_processing=nil, login=nil, password=nil)
98
+ self.address = address if address
99
+ self.fast_processing = fast_processing if fast_processing
100
+ self.login = login if login
101
+ self.password = password if password
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ if @address.nil?
109
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
110
+ end
111
+
112
+ if @address.to_s.length < 1
113
+ invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.')
114
+ end
115
+
116
+ if @fast_processing.nil?
117
+ invalid_properties.push('invalid value for "fast_processing", fast_processing cannot be nil.')
118
+ end
119
+
120
+ if @password.nil?
121
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
122
+ end
123
+
124
+ if @password.to_s.length < 1
125
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return false if @address.nil?
135
+ return false if @address.to_s.length < 1
136
+ return false if @fast_processing.nil?
137
+ return false if @password.nil?
138
+ return false if @password.to_s.length < 1
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] address Value to be assigned
144
+ def address=(address)
145
+ if address.nil?
146
+ fail ArgumentError, 'address cannot be nil'
147
+ end
148
+
149
+ if address.to_s.length < 1
150
+ fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.'
151
+ end
152
+
153
+ @address = address
154
+ end
155
+
156
+ # Custom attribute writer method with validation
157
+ # @param [Object] password Value to be assigned
158
+ def password=(password)
159
+ if password.nil?
160
+ fail ArgumentError, 'password cannot be nil'
161
+ end
162
+
163
+ if password.to_s.length < 1
164
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
165
+ end
166
+
167
+ @password = password
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ address == o.address &&
176
+ fast_processing == o.fast_processing &&
177
+ login == o.login &&
178
+ password == o.password
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Fixnum] Hash code
189
+ def hash
190
+ [address, fast_processing, login, password].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.swagger_types.each_pair do |key, type|
199
+ attribute_key = self.class.attribute_map[key]
200
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
201
+ if type =~ /\AArray<(.*)>/i
202
+ # check to ensure the input is an array given that the the attribute
203
+ # is documented as an array but the input is not
204
+ if attributes[attribute_key].is_a?(Array)
205
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
206
+ end
207
+ elsif !attributes[attribute_key].nil?
208
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
209
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
210
+ end
211
+
212
+ self
213
+ end
214
+
215
+ # Deserializes the data based on type
216
+ # @param string type Data type
217
+ # @param string value Value to be deserialized
218
+ # @return [Object] Deserialized data
219
+ def _deserialize(type, value)
220
+ case type.to_sym
221
+ when :DateTime
222
+ DateTime.parse(value)
223
+ when :Date
224
+ Date.parse(value)
225
+ when :String
226
+ value.to_s
227
+ when :Integer
228
+ value.to_i
229
+ when :Float
230
+ value.to_f
231
+ when :BOOLEAN
232
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233
+ true
234
+ else
235
+ false
236
+ end
237
+ when :Object
238
+ # generic object (usually a Hash), return directly
239
+ value
240
+ when /\AArray<(?<inner_type>.+)>\z/
241
+ inner_type = Regexp.last_match[:inner_type]
242
+ value.map { |v| _deserialize(inner_type, v) }
243
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244
+ k_type = Regexp.last_match[:k_type]
245
+ v_type = Regexp.last_match[:v_type]
246
+ {}.tap do |hash|
247
+ value.each do |k, v|
248
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249
+ end
250
+ end
251
+ else # model
252
+ type = value[:type] || type
253
+ temp_model = AsposeEmailCloud.const_get(type).new
254
+ temp_model.build_from_hash(value)
255
+ end
256
+ end
257
+
258
+ # Returns the string representation of the object
259
+ # @return [String] String presentation of the object
260
+ def to_s
261
+ to_hash.to_s
262
+ end
263
+
264
+ # to_body is an alias to to_hash (backward compatibility)
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_body
267
+ to_hash
268
+ end
269
+
270
+ # Returns the object in the form of hash
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_hash
273
+ hash = {}
274
+ self.class.attribute_map.each_pair do |attr, param|
275
+ value = self.send(attr)
276
+ next if value.nil?
277
+ hash[param] = _to_hash(value)
278
+ end
279
+ hash
280
+ end
281
+
282
+ # Outputs non-array value in the form of hash
283
+ # For object, use to_hash. Otherwise, just return the value
284
+ # @param [Object] value Any valid value
285
+ # @return [Hash] Returns the value in the form of hash
286
+ def _to_hash(value)
287
+ if value.is_a?(Array)
288
+ value.compact.map { |v| _to_hash(v) }
289
+ elsif value.is_a?(Hash)
290
+ {}.tap do |hash|
291
+ value.each { |k, v| hash[k] = _to_hash(v) }
292
+ end
293
+ elsif value.respond_to? :to_hash
294
+ value.to_hash
295
+ else
296
+ value
297
+ end
298
+ end
299
+
300
+ end
301
+ end
@@ -0,0 +1,265 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="DiscoverEmailConfigRq.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
+ # Discover email configuration request.
31
+ class DiscoverEmailConfigRq
32
+ # Email address to discover.
33
+ # @return [String]
34
+ attr_accessor :address
35
+
36
+ # Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
37
+ # @return [BOOLEAN]
38
+ attr_accessor :fast_processing
39
+
40
+ # Email account login. If not specified, address used as a login.
41
+ # @return [String]
42
+ attr_accessor :login
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'address' => :'address',
48
+ :'fast_processing' => :'fastProcessing',
49
+ :'login' => :'login'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'address' => :'String',
57
+ :'fast_processing' => :'BOOLEAN',
58
+ :'login' => :'String'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
69
+
70
+ if attributes.has_key?(:'address')
71
+ self.address = attributes[:'address']
72
+ end
73
+
74
+ if attributes.has_key?(:'fastProcessing')
75
+ self.fast_processing = attributes[:'fastProcessing']
76
+ end
77
+
78
+ if attributes.has_key?(:'login')
79
+ self.login = attributes[:'login']
80
+ end
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [String] address Email address to discover.
85
+ # @param [BOOLEAN] fast_processing Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned.
86
+ # @param [String] login Email account login. If not specified, address used as a login.
87
+ def initialize(address=nil, fast_processing=nil, login=nil)
88
+ self.address = address if address
89
+ self.fast_processing = fast_processing if fast_processing
90
+ self.login = login if login
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if @address.nil?
98
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
99
+ end
100
+
101
+ if @address.to_s.length < 1
102
+ invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.')
103
+ end
104
+
105
+ if @fast_processing.nil?
106
+ invalid_properties.push('invalid value for "fast_processing", fast_processing cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @address.nil?
116
+ return false if @address.to_s.length < 1
117
+ return false if @fast_processing.nil?
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] address Value to be assigned
123
+ def address=(address)
124
+ if address.nil?
125
+ fail ArgumentError, 'address cannot be nil'
126
+ end
127
+
128
+ if address.to_s.length < 1
129
+ fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.'
130
+ end
131
+
132
+ @address = address
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ address == o.address &&
141
+ fast_processing == o.fast_processing &&
142
+ login == o.login
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Fixnum] Hash code
153
+ def hash
154
+ [address, fast_processing, login].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ self.class.swagger_types.each_pair do |key, type|
163
+ attribute_key = self.class.attribute_map[key]
164
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[attribute_key].is_a?(Array)
169
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[attribute_key].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
173
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ DateTime.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ type = value[:type] || type
217
+ temp_model = AsposeEmailCloud.const_get(type).new
218
+ temp_model.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ next if value.nil?
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+ end