aspose_email_cloud 20.5.0 → 20.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose-email-cloud.rb +74 -0
  3. data/lib/aspose-email-cloud/api/email_api.rb +147 -0
  4. data/lib/aspose-email-cloud/models/ai_bcr_image_storage_file.rb +3 -3
  5. data/lib/aspose-email-cloud/models/ai_bcr_parse_storage_rq.rb +3 -3
  6. data/lib/aspose-email-cloud/models/append_email_base_request.rb +3 -3
  7. data/lib/aspose-email-cloud/models/append_email_model_rq.rb +3 -3
  8. data/lib/aspose-email-cloud/models/calendar_dto.rb +17 -4
  9. data/lib/aspose-email-cloud/models/contact_photo.rb +29 -5
  10. data/lib/aspose-email-cloud/models/daily_recurrence_pattern_dto.rb +296 -0
  11. data/lib/aspose-email-cloud/models/mapi_attachment_dto.rb +226 -0
  12. data/lib/aspose-email-cloud/models/mapi_binary_property_dto.rb +250 -0
  13. data/lib/aspose-email-cloud/models/mapi_boolean_property_dto.rb +255 -0
  14. data/lib/aspose-email-cloud/models/mapi_calendar_attendees_dto.rb +266 -0
  15. data/lib/aspose-email-cloud/models/mapi_calendar_daily_recurrence_pattern_dto.rb +464 -0
  16. data/lib/aspose-email-cloud/models/mapi_calendar_dto.rb +728 -0
  17. data/lib/aspose-email-cloud/models/mapi_calendar_event_recurrence_dto.rb +293 -0
  18. data/lib/aspose-email-cloud/models/mapi_calendar_exception_info_dto.rb +431 -0
  19. data/lib/aspose-email-cloud/models/mapi_calendar_recurrence_pattern_dto.rb +449 -0
  20. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_dto.rb +228 -0
  21. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_info_dto.rb +313 -0
  22. data/lib/aspose-email-cloud/models/mapi_calendar_time_zone_rule_dto.rb +362 -0
  23. data/lib/aspose-email-cloud/models/mapi_calendar_weekly_recurrence_pattern_dto.rb +464 -0
  24. data/lib/aspose-email-cloud/models/mapi_calendar_yearly_and_monthly_recurrence_pattern_dto.rb +500 -0
  25. data/lib/aspose-email-cloud/models/mapi_contact_dto.rb +569 -0
  26. data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_dto.rb +283 -0
  27. data/lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb +327 -0
  28. data/lib/aspose-email-cloud/models/mapi_contact_event_property_set_dto.rb +236 -0
  29. data/lib/aspose-email-cloud/models/mapi_contact_name_property_set_dto.rb +335 -0
  30. data/lib/aspose-email-cloud/models/mapi_contact_other_property_set_dto.rb +319 -0
  31. data/lib/aspose-email-cloud/models/mapi_contact_personal_info_property_set_dto.rb +454 -0
  32. data/lib/aspose-email-cloud/models/mapi_contact_photo_dto.rb +255 -0
  33. data/lib/aspose-email-cloud/models/mapi_contact_physical_address_dto.rb +322 -0
  34. data/lib/aspose-email-cloud/models/mapi_contact_physical_address_property_set_dto.rb +239 -0
  35. data/lib/aspose-email-cloud/models/mapi_contact_professional_property_set_dto.rb +291 -0
  36. data/lib/aspose-email-cloud/models/mapi_contact_telephone_property_set_dto.rb +457 -0
  37. data/lib/aspose-email-cloud/models/mapi_date_time_property_dto.rb +255 -0
  38. data/lib/aspose-email-cloud/models/mapi_electronic_address_dto.rb +265 -0
  39. data/lib/aspose-email-cloud/models/mapi_file_as_property_dto.rb +255 -0
  40. data/lib/aspose-email-cloud/models/mapi_importance_property_dto.rb +255 -0
  41. data/lib/aspose-email-cloud/models/mapi_int_property_dto.rb +255 -0
  42. data/lib/aspose-email-cloud/models/mapi_known_property_descriptor.rb +237 -0
  43. data/lib/aspose-email-cloud/models/mapi_legacy_free_busy_property_dto.rb +255 -0
  44. data/lib/aspose-email-cloud/models/mapi_message_dto.rb +801 -0
  45. data/lib/aspose-email-cloud/models/mapi_message_item_base_dto.rb +452 -0
  46. data/lib/aspose-email-cloud/models/mapi_multi_int_property_dto.rb +252 -0
  47. data/lib/aspose-email-cloud/models/mapi_multi_string_property_dto.rb +252 -0
  48. data/lib/aspose-email-cloud/models/mapi_physical_address_index_property_dto.rb +255 -0
  49. data/lib/aspose-email-cloud/models/mapi_pid_lid_property_descriptor.rb +322 -0
  50. data/lib/aspose-email-cloud/models/mapi_pid_name_property_descriptor.rb +304 -0
  51. data/lib/aspose-email-cloud/models/mapi_pid_property_descriptor.rb +286 -0
  52. data/lib/aspose-email-cloud/models/mapi_pid_tag_property_descriptor.rb +322 -0
  53. data/lib/aspose-email-cloud/models/mapi_property_descriptor.rb +224 -0
  54. data/lib/aspose-email-cloud/models/mapi_property_dto.rb +237 -0
  55. data/lib/aspose-email-cloud/models/mapi_recipient_dto.rb +257 -0
  56. data/lib/aspose-email-cloud/models/mapi_response_type_property_dto.rb +255 -0
  57. data/lib/aspose-email-cloud/models/mapi_string_property_dto.rb +250 -0
  58. data/lib/aspose-email-cloud/models/monthly_recurrence_pattern_dto.rb +350 -0
  59. data/lib/aspose-email-cloud/models/recurrence_pattern_dto.rb +296 -0
  60. data/lib/aspose-email-cloud/models/requests/convert_calendar_model_to_mapi_model_request_data.rb +79 -0
  61. data/lib/aspose-email-cloud/models/requests/convert_contact_model_to_mapi_model_request_data.rb +79 -0
  62. data/lib/aspose-email-cloud/models/requests/convert_email_model_to_file_request_data.rb +2 -2
  63. data/lib/aspose-email-cloud/models/requests/convert_email_model_to_mapi_model_request_data.rb +79 -0
  64. data/lib/aspose-email-cloud/models/requests/convert_email_request_data.rb +2 -2
  65. data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_calendar_model_request_data.rb +79 -0
  66. data/lib/aspose-email-cloud/models/requests/convert_mapi_calendar_model_to_file_request_data.rb +89 -0
  67. data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_contact_model_request_data.rb +79 -0
  68. data/lib/aspose-email-cloud/models/requests/convert_mapi_contact_model_to_file_request_data.rb +89 -0
  69. data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_email_model_request_data.rb +79 -0
  70. data/lib/aspose-email-cloud/models/requests/convert_mapi_message_model_to_file_request_data.rb +89 -0
  71. data/lib/aspose-email-cloud/models/requests/get_calendar_file_as_mapi_model_request_data.rb +80 -0
  72. data/lib/aspose-email-cloud/models/requests/get_contact_file_as_mapi_model_request_data.rb +90 -0
  73. data/lib/aspose-email-cloud/models/requests/get_email_as_file_request_data.rb +2 -2
  74. data/lib/aspose-email-cloud/models/requests/get_email_file_as_mapi_model_request_data.rb +90 -0
  75. data/lib/aspose-email-cloud/models/requests/get_email_model_list_request_data.rb +2 -2
  76. data/lib/aspose-email-cloud/models/requests/get_email_model_request_data.rb +2 -2
  77. data/lib/aspose-email-cloud/models/requests/get_mapi_calendar_model_request_data.rb +91 -0
  78. data/lib/aspose-email-cloud/models/requests/get_mapi_contact_model_request_data.rb +101 -0
  79. data/lib/aspose-email-cloud/models/requests/get_mapi_message_model_request_data.rb +101 -0
  80. data/lib/aspose-email-cloud/models/requests/save_calendar_model_request_data.rb +2 -2
  81. data/lib/aspose-email-cloud/models/requests/save_contact_model_request_data.rb +2 -2
  82. data/lib/aspose-email-cloud/models/requests/save_email_model_request_data.rb +4 -4
  83. data/lib/aspose-email-cloud/models/requests/save_mapi_calendar_model_request_data.rb +99 -0
  84. data/lib/aspose-email-cloud/models/requests/save_mapi_contact_model_request_data.rb +99 -0
  85. data/lib/aspose-email-cloud/models/requests/save_mapi_message_model_request_data.rb +99 -0
  86. data/lib/aspose-email-cloud/models/send_email_base_request.rb +3 -3
  87. data/lib/aspose-email-cloud/models/send_email_model_rq.rb +3 -3
  88. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_calendar_dto.rb +225 -0
  89. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_contact_dto.rb +225 -0
  90. data/lib/aspose-email-cloud/models/storage_model_rq_of_mapi_message_dto.rb +225 -0
  91. data/lib/aspose-email-cloud/models/task_regenerating_pattern_dto.rb +314 -0
  92. data/lib/aspose-email-cloud/models/weekly_recurrence_pattern_dto.rb +311 -0
  93. data/lib/aspose-email-cloud/models/yearly_recurrence_pattern_dto.rb +368 -0
  94. data/lib/aspose-email-cloud/version.rb +1 -1
  95. metadata +76 -2
@@ -0,0 +1,283 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="MapiContactElectronicAddressDto.rb">
3
+ # Copyright (c) 2018-2020 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
+ # Refers to the group of properties that define the e-mail address or fax address for a contact.
31
+ class MapiContactElectronicAddressDto
32
+ # Address type of an electronic address
33
+ # @return [String]
34
+ attr_accessor :address_type
35
+
36
+ # User-readable display name for the e-mail address
37
+ # @return [String]
38
+ attr_accessor :display_name
39
+
40
+ # E-mail address of the contact
41
+ # @return [String]
42
+ attr_accessor :email_address
43
+
44
+ # Telephone number of the mail user's primary fax machine
45
+ # @return [String]
46
+ attr_accessor :fax_number
47
+
48
+ # Shows if MapiContactElectronicAddress is empty
49
+ # @return [BOOLEAN]
50
+ attr_accessor :is_empty
51
+
52
+ # SMTP e-mail address that corresponds to the e-mail address for the Contact object.
53
+ # @return [String]
54
+ attr_accessor :original_display_name
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'address_type' => :'addressType',
60
+ :'display_name' => :'displayName',
61
+ :'email_address' => :'emailAddress',
62
+ :'fax_number' => :'faxNumber',
63
+ :'is_empty' => :'isEmpty',
64
+ :'original_display_name' => :'originalDisplayName'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'address_type' => :'String',
72
+ :'display_name' => :'String',
73
+ :'email_address' => :'String',
74
+ :'fax_number' => :'String',
75
+ :'is_empty' => :'BOOLEAN',
76
+ :'original_display_name' => :'String'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
87
+
88
+ if attributes.has_key?(:'addressType')
89
+ self.address_type = attributes[:'addressType']
90
+ end
91
+
92
+ if attributes.has_key?(:'displayName')
93
+ self.display_name = attributes[:'displayName']
94
+ end
95
+
96
+ if attributes.has_key?(:'emailAddress')
97
+ self.email_address = attributes[:'emailAddress']
98
+ end
99
+
100
+ if attributes.has_key?(:'faxNumber')
101
+ self.fax_number = attributes[:'faxNumber']
102
+ end
103
+
104
+ if attributes.has_key?(:'isEmpty')
105
+ self.is_empty = attributes[:'isEmpty']
106
+ end
107
+
108
+ if attributes.has_key?(:'originalDisplayName')
109
+ self.original_display_name = attributes[:'originalDisplayName']
110
+ end
111
+ end
112
+
113
+ # Initializes the object
114
+ # @param [String] address_type Address type of an electronic address
115
+ # @param [String] display_name User-readable display name for the e-mail address
116
+ # @param [String] email_address E-mail address of the contact
117
+ # @param [String] fax_number Telephone number of the mail user's primary fax machine
118
+ # @param [BOOLEAN] is_empty Shows if MapiContactElectronicAddress is empty
119
+ # @param [String] original_display_name SMTP e-mail address that corresponds to the e-mail address for the Contact object.
120
+ def initialize(address_type=nil, display_name=nil, email_address=nil, fax_number=nil, is_empty=nil, original_display_name=nil)
121
+ self.address_type = address_type if address_type
122
+ self.display_name = display_name if display_name
123
+ self.email_address = email_address if email_address
124
+ self.fax_number = fax_number if fax_number
125
+ self.is_empty = is_empty if is_empty
126
+ self.original_display_name = original_display_name if original_display_name
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ if @is_empty.nil?
134
+ invalid_properties.push('invalid value for "is_empty", is_empty cannot be nil.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ return false if @is_empty.nil?
144
+ true
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ address_type == o.address_type &&
153
+ display_name == o.display_name &&
154
+ email_address == o.email_address &&
155
+ fax_number == o.fax_number &&
156
+ is_empty == o.is_empty &&
157
+ original_display_name == o.original_display_name
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [address_type, display_name, email_address, fax_number, is_empty, original_display_name].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ attribute_key = self.class.attribute_map[key]
179
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
180
+ if type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[attribute_key].is_a?(Array)
184
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[attribute_key].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
188
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ DateTime.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ sub_type = value[:type] || value[:discriminator] || type
232
+ if AsposeEmailCloud.const_defined?(sub_type)
233
+ type = sub_type
234
+ end
235
+ temp_model = AsposeEmailCloud.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+
282
+ end
283
+ end
@@ -0,0 +1,327 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="MapiContactElectronicAddressPropertySetDto.rb">
3
+ # Copyright (c) 2018-2020 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
+ # Specify properties for up to three different e-mail addresses (Email1, Email2, and Email3) and three different fax addresses (Primary Fax, Business Fax, and Home Fax)
31
+ class MapiContactElectronicAddressPropertySetDto
32
+ # Refers to the group of properties that define the business fax address for a contact.
33
+ # @return [MapiContactElectronicAddressDto]
34
+ attr_accessor :business_fax
35
+
36
+ # Default value of electronic address Uses when user does not set any electronic address if UseAutocomplete property is set 'true'
37
+ # @return [MapiContactElectronicAddressDto]
38
+ attr_accessor :default_email_address
39
+
40
+ # Refers to the group of properties that define the first e-mail address for a contact.
41
+ # @return [MapiContactElectronicAddressDto]
42
+ attr_accessor :email1
43
+
44
+ # Refers to the group of properties that define the second e-mail address for a contact.
45
+ # @return [MapiContactElectronicAddressDto]
46
+ attr_accessor :email2
47
+
48
+ # Refers to the group of properties that define the third e-mail address for a contact.
49
+ # @return [MapiContactElectronicAddressDto]
50
+ attr_accessor :email3
51
+
52
+ # Refers to the group of properties that define the home fax address for a contact.
53
+ # @return [MapiContactElectronicAddressDto]
54
+ attr_accessor :home_fax
55
+
56
+ # Shows if MapiContactElectronicAddressPropertySetDto is empty
57
+ # @return [BOOLEAN]
58
+ attr_accessor :is_empty
59
+
60
+ # Refers to the group of properties that define the primary fax address for a contact.
61
+ # @return [MapiContactElectronicAddressDto]
62
+ attr_accessor :primary_fax
63
+
64
+ # Indicates that one electronic address is completed automatically in case if user does not set any electronic address
65
+ # @return [BOOLEAN]
66
+ attr_accessor :use_autocomplete
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'business_fax' => :'businessFax',
72
+ :'default_email_address' => :'defaultEmailAddress',
73
+ :'email1' => :'email1',
74
+ :'email2' => :'email2',
75
+ :'email3' => :'email3',
76
+ :'home_fax' => :'homeFax',
77
+ :'is_empty' => :'isEmpty',
78
+ :'primary_fax' => :'primaryFax',
79
+ :'use_autocomplete' => :'useAutocomplete'
80
+ }
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.swagger_types
85
+ {
86
+ :'business_fax' => :'MapiContactElectronicAddressDto',
87
+ :'default_email_address' => :'MapiContactElectronicAddressDto',
88
+ :'email1' => :'MapiContactElectronicAddressDto',
89
+ :'email2' => :'MapiContactElectronicAddressDto',
90
+ :'email3' => :'MapiContactElectronicAddressDto',
91
+ :'home_fax' => :'MapiContactElectronicAddressDto',
92
+ :'is_empty' => :'BOOLEAN',
93
+ :'primary_fax' => :'MapiContactElectronicAddressDto',
94
+ :'use_autocomplete' => :'BOOLEAN'
95
+ }
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ return unless attributes.is_a?(Hash)
102
+
103
+ # convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
105
+
106
+ if attributes.has_key?(:'businessFax')
107
+ self.business_fax = attributes[:'businessFax']
108
+ end
109
+
110
+ if attributes.has_key?(:'defaultEmailAddress')
111
+ self.default_email_address = attributes[:'defaultEmailAddress']
112
+ end
113
+
114
+ if attributes.has_key?(:'email1')
115
+ self.email1 = attributes[:'email1']
116
+ end
117
+
118
+ if attributes.has_key?(:'email2')
119
+ self.email2 = attributes[:'email2']
120
+ end
121
+
122
+ if attributes.has_key?(:'email3')
123
+ self.email3 = attributes[:'email3']
124
+ end
125
+
126
+ if attributes.has_key?(:'homeFax')
127
+ self.home_fax = attributes[:'homeFax']
128
+ end
129
+
130
+ if attributes.has_key?(:'isEmpty')
131
+ self.is_empty = attributes[:'isEmpty']
132
+ end
133
+
134
+ if attributes.has_key?(:'primaryFax')
135
+ self.primary_fax = attributes[:'primaryFax']
136
+ end
137
+
138
+ if attributes.has_key?(:'useAutocomplete')
139
+ self.use_autocomplete = attributes[:'useAutocomplete']
140
+ end
141
+ end
142
+
143
+ # Initializes the object
144
+ # @param [MapiContactElectronicAddressDto] business_fax Refers to the group of properties that define the business fax address for a contact.
145
+ # @param [MapiContactElectronicAddressDto] default_email_address Default value of electronic address Uses when user does not set any electronic address if UseAutocomplete property is set 'true'
146
+ # @param [MapiContactElectronicAddressDto] email1 Refers to the group of properties that define the first e-mail address for a contact.
147
+ # @param [MapiContactElectronicAddressDto] email2 Refers to the group of properties that define the second e-mail address for a contact.
148
+ # @param [MapiContactElectronicAddressDto] email3 Refers to the group of properties that define the third e-mail address for a contact.
149
+ # @param [MapiContactElectronicAddressDto] home_fax Refers to the group of properties that define the home fax address for a contact.
150
+ # @param [BOOLEAN] is_empty Shows if MapiContactElectronicAddressPropertySetDto is empty
151
+ # @param [MapiContactElectronicAddressDto] primary_fax Refers to the group of properties that define the primary fax address for a contact.
152
+ # @param [BOOLEAN] use_autocomplete Indicates that one electronic address is completed automatically in case if user does not set any electronic address
153
+ def initialize(business_fax=nil, default_email_address=nil, email1=nil, email2=nil, email3=nil, home_fax=nil, is_empty=nil, primary_fax=nil, use_autocomplete=nil)
154
+ self.business_fax = business_fax if business_fax
155
+ self.default_email_address = default_email_address if default_email_address
156
+ self.email1 = email1 if email1
157
+ self.email2 = email2 if email2
158
+ self.email3 = email3 if email3
159
+ self.home_fax = home_fax if home_fax
160
+ self.is_empty = is_empty if is_empty
161
+ self.primary_fax = primary_fax if primary_fax
162
+ self.use_autocomplete = use_autocomplete if use_autocomplete
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ invalid_properties = Array.new
169
+ if @is_empty.nil?
170
+ invalid_properties.push('invalid value for "is_empty", is_empty cannot be nil.')
171
+ end
172
+
173
+ if @use_autocomplete.nil?
174
+ invalid_properties.push('invalid value for "use_autocomplete", use_autocomplete cannot be nil.')
175
+ end
176
+
177
+ invalid_properties
178
+ end
179
+
180
+ # Check to see if the all the properties in the model are valid
181
+ # @return true if the model is valid
182
+ def valid?
183
+ return false if @is_empty.nil?
184
+ return false if @use_autocomplete.nil?
185
+ true
186
+ end
187
+
188
+ # Checks equality by comparing each attribute.
189
+ # @param [Object] Object to be compared
190
+ def ==(o)
191
+ return true if self.equal?(o)
192
+ self.class == o.class &&
193
+ business_fax == o.business_fax &&
194
+ default_email_address == o.default_email_address &&
195
+ email1 == o.email1 &&
196
+ email2 == o.email2 &&
197
+ email3 == o.email3 &&
198
+ home_fax == o.home_fax &&
199
+ is_empty == o.is_empty &&
200
+ primary_fax == o.primary_fax &&
201
+ use_autocomplete == o.use_autocomplete
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Fixnum] Hash code
212
+ def hash
213
+ [business_fax, default_email_address, email1, email2, email3, home_fax, is_empty, primary_fax, use_autocomplete].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ self.class.swagger_types.each_pair do |key, type|
222
+ attribute_key = self.class.attribute_map[key]
223
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
224
+ if type =~ /\AArray<(.*)>/i
225
+ # check to ensure the input is an array given that the the attribute
226
+ # is documented as an array but the input is not
227
+ if attributes[attribute_key].is_a?(Array)
228
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
229
+ end
230
+ elsif !attributes[attribute_key].nil?
231
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
232
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
233
+ end
234
+
235
+ self
236
+ end
237
+
238
+ # Deserializes the data based on type
239
+ # @param string type Data type
240
+ # @param string value Value to be deserialized
241
+ # @return [Object] Deserialized data
242
+ def _deserialize(type, value)
243
+ case type.to_sym
244
+ when :DateTime
245
+ DateTime.parse(value)
246
+ when :Date
247
+ Date.parse(value)
248
+ when :String
249
+ value.to_s
250
+ when :Integer
251
+ value.to_i
252
+ when :Float
253
+ value.to_f
254
+ when :BOOLEAN
255
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
256
+ true
257
+ else
258
+ false
259
+ end
260
+ when :Object
261
+ # generic object (usually a Hash), return directly
262
+ value
263
+ when /\AArray<(?<inner_type>.+)>\z/
264
+ inner_type = Regexp.last_match[:inner_type]
265
+ value.map { |v| _deserialize(inner_type, v) }
266
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
267
+ k_type = Regexp.last_match[:k_type]
268
+ v_type = Regexp.last_match[:v_type]
269
+ {}.tap do |hash|
270
+ value.each do |k, v|
271
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
272
+ end
273
+ end
274
+ else # model
275
+ sub_type = value[:type] || value[:discriminator] || type
276
+ if AsposeEmailCloud.const_defined?(sub_type)
277
+ type = sub_type
278
+ end
279
+ temp_model = AsposeEmailCloud.const_get(type).new
280
+ temp_model.build_from_hash(value)
281
+ end
282
+ end
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # to_body is an alias to to_hash (backward compatibility)
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_body
293
+ to_hash
294
+ end
295
+
296
+ # Returns the object in the form of hash
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_hash
299
+ hash = {}
300
+ self.class.attribute_map.each_pair do |attr, param|
301
+ value = self.send(attr)
302
+ next if value.nil?
303
+ hash[param] = _to_hash(value)
304
+ end
305
+ hash
306
+ end
307
+
308
+ # Outputs non-array value in the form of hash
309
+ # For object, use to_hash. Otherwise, just return the value
310
+ # @param [Object] value Any valid value
311
+ # @return [Hash] Returns the value in the form of hash
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map { |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+
326
+ end
327
+ end