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,311 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="WeeklyRecurrencePatternDto.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
+ # Weekly recurrence pattern.
31
+ class WeeklyRecurrencePatternDto
32
+ # Number of recurrence units.
33
+ # @return [Integer]
34
+ attr_accessor :interval
35
+
36
+ # Number of occurrences of the recurrence pattern.
37
+ # @return [Integer]
38
+ attr_accessor :occurs
39
+
40
+ # End date.
41
+ # @return [DateTime]
42
+ attr_accessor :end_date
43
+
44
+ # Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
45
+ # @return [String]
46
+ attr_accessor :week_start
47
+
48
+
49
+ # @return [String]
50
+ def discriminator #getter method
51
+ self.class.name.split('::').last
52
+ end
53
+
54
+ def discriminator=(discriminator) #setter method, parameter ignored
55
+ @discriminator = self.class.name.split('::').last
56
+ end
57
+
58
+ # Start days Items: Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
59
+ # @return [Array<String>]
60
+ attr_accessor :start_days
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'interval' => :'interval',
66
+ :'occurs' => :'occurs',
67
+ :'end_date' => :'endDate',
68
+ :'week_start' => :'weekStart',
69
+ :'discriminator' => :'discriminator',
70
+ :'start_days' => :'startDays'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ :'interval' => :'Integer',
78
+ :'occurs' => :'Integer',
79
+ :'end_date' => :'DateTime',
80
+ :'week_start' => :'String',
81
+ :'discriminator' => :'String',
82
+ :'start_days' => :'Array<String>'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
93
+
94
+ if attributes.has_key?(:'interval')
95
+ self.interval = attributes[:'interval']
96
+ end
97
+
98
+ if attributes.has_key?(:'occurs')
99
+ self.occurs = attributes[:'occurs']
100
+ end
101
+
102
+ if attributes.has_key?(:'endDate')
103
+ self.end_date = attributes[:'endDate']
104
+ end
105
+
106
+ if attributes.has_key?(:'weekStart')
107
+ self.week_start = attributes[:'weekStart']
108
+ end
109
+
110
+ if attributes.has_key?(:'discriminator')
111
+ @discriminator = self.class.name.split('::').last
112
+ end
113
+
114
+ if attributes.has_key?(:'startDays')
115
+ if (value = attributes[:'startDays']).is_a?(Array)
116
+ self.start_days = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Initializes the object
122
+ # @param [Integer] interval Number of recurrence units.
123
+ # @param [Integer] occurs Number of occurrences of the recurrence pattern.
124
+ # @param [DateTime] end_date End date.
125
+ # @param [String] week_start Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
126
+ # @param [String] discriminator
127
+ # @param [Array<String>] start_days Start days Items: Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
128
+ def initialize(interval=nil, occurs=nil, end_date=nil, week_start=nil, discriminator=nil, start_days=nil)
129
+ self.interval = interval if interval
130
+ self.occurs = occurs if occurs
131
+ self.end_date = end_date if end_date
132
+ self.week_start = week_start if week_start
133
+ @discriminator = self.class.name.split('::').last
134
+ self.start_days = start_days if start_days
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+ if @interval.nil?
142
+ invalid_properties.push('invalid value for "interval", interval cannot be nil.')
143
+ end
144
+
145
+ if @occurs.nil?
146
+ invalid_properties.push('invalid value for "occurs", occurs cannot be nil.')
147
+ end
148
+
149
+ if @end_date.nil?
150
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
151
+ end
152
+
153
+ if @week_start.nil?
154
+ invalid_properties.push('invalid value for "week_start", week_start cannot be nil.')
155
+ end
156
+
157
+ if @discriminator.nil?
158
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ return false if @interval.nil?
168
+ return false if @occurs.nil?
169
+ return false if @end_date.nil?
170
+ return false if @week_start.nil?
171
+ return false if @discriminator.nil?
172
+ true
173
+ end
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] Object to be compared
177
+ def ==(o)
178
+ return true if self.equal?(o)
179
+ self.class == o.class &&
180
+ interval == o.interval &&
181
+ occurs == o.occurs &&
182
+ end_date == o.end_date &&
183
+ week_start == o.week_start &&
184
+ discriminator == o.discriminator &&
185
+ start_days == o.start_days
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Fixnum] Hash code
196
+ def hash
197
+ [interval, occurs, end_date, week_start, discriminator, start_days].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ self.class.swagger_types.each_pair do |key, type|
206
+ attribute_key = self.class.attribute_map[key]
207
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
208
+ if type =~ /\AArray<(.*)>/i
209
+ # check to ensure the input is an array given that the the attribute
210
+ # is documented as an array but the input is not
211
+ if attributes[attribute_key].is_a?(Array)
212
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
213
+ end
214
+ elsif !attributes[attribute_key].nil?
215
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
216
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
217
+ end
218
+
219
+ self
220
+ end
221
+
222
+ # Deserializes the data based on type
223
+ # @param string type Data type
224
+ # @param string value Value to be deserialized
225
+ # @return [Object] Deserialized data
226
+ def _deserialize(type, value)
227
+ case type.to_sym
228
+ when :DateTime
229
+ DateTime.parse(value)
230
+ when :Date
231
+ Date.parse(value)
232
+ when :String
233
+ value.to_s
234
+ when :Integer
235
+ value.to_i
236
+ when :Float
237
+ value.to_f
238
+ when :BOOLEAN
239
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
240
+ true
241
+ else
242
+ false
243
+ end
244
+ when :Object
245
+ # generic object (usually a Hash), return directly
246
+ value
247
+ when /\AArray<(?<inner_type>.+)>\z/
248
+ inner_type = Regexp.last_match[:inner_type]
249
+ value.map { |v| _deserialize(inner_type, v) }
250
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
251
+ k_type = Regexp.last_match[:k_type]
252
+ v_type = Regexp.last_match[:v_type]
253
+ {}.tap do |hash|
254
+ value.each do |k, v|
255
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
256
+ end
257
+ end
258
+ else # model
259
+ sub_type = value[:type] || value[:discriminator] || type
260
+ if AsposeEmailCloud.const_defined?(sub_type)
261
+ type = sub_type
262
+ end
263
+ temp_model = AsposeEmailCloud.const_get(type).new
264
+ temp_model.build_from_hash(value)
265
+ end
266
+ end
267
+
268
+ # Returns the string representation of the object
269
+ # @return [String] String presentation of the object
270
+ def to_s
271
+ to_hash.to_s
272
+ end
273
+
274
+ # to_body is an alias to to_hash (backward compatibility)
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_body
277
+ to_hash
278
+ end
279
+
280
+ # Returns the object in the form of hash
281
+ # @return [Hash] Returns the object in the form of hash
282
+ def to_hash
283
+ hash = {}
284
+ self.class.attribute_map.each_pair do |attr, param|
285
+ value = self.send(attr)
286
+ next if value.nil?
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+
310
+ end
311
+ end
@@ -0,0 +1,368 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="YearlyRecurrencePatternDto.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
+ # Yearly recurrence pattern.
31
+ class YearlyRecurrencePatternDto
32
+ # Number of recurrence units.
33
+ # @return [Integer]
34
+ attr_accessor :interval
35
+
36
+ # Number of occurrences of the recurrence pattern.
37
+ # @return [Integer]
38
+ attr_accessor :occurs
39
+
40
+ # End date.
41
+ # @return [DateTime]
42
+ attr_accessor :end_date
43
+
44
+ # Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
45
+ # @return [String]
46
+ attr_accessor :week_start
47
+
48
+
49
+ # @return [String]
50
+ def discriminator #getter method
51
+ self.class.name.split('::').last
52
+ end
53
+
54
+ def discriminator=(discriminator) #setter method, parameter ignored
55
+ @discriminator = self.class.name.split('::').last
56
+ end
57
+
58
+ # Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
59
+ # @return [String]
60
+ attr_accessor :start_day
61
+
62
+ # Represents a calendar month. Enum, available values: None, January, February, March, April, May, June, July, August, September, October, November, December
63
+ # @return [String]
64
+ attr_accessor :start_month
65
+
66
+ # Start offset.
67
+ # @return [Integer]
68
+ attr_accessor :start_offset
69
+
70
+ # Day positions, typically found in a month. Enum, available values: None, First, Second, Third, Fourth, Last
71
+ # @return [String]
72
+ attr_accessor :start_position
73
+
74
+ # Attribute mapping from ruby-style variable name to JSON key.
75
+ def self.attribute_map
76
+ {
77
+ :'interval' => :'interval',
78
+ :'occurs' => :'occurs',
79
+ :'end_date' => :'endDate',
80
+ :'week_start' => :'weekStart',
81
+ :'discriminator' => :'discriminator',
82
+ :'start_day' => :'startDay',
83
+ :'start_month' => :'startMonth',
84
+ :'start_offset' => :'startOffset',
85
+ :'start_position' => :'startPosition'
86
+ }
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.swagger_types
91
+ {
92
+ :'interval' => :'Integer',
93
+ :'occurs' => :'Integer',
94
+ :'end_date' => :'DateTime',
95
+ :'week_start' => :'String',
96
+ :'discriminator' => :'String',
97
+ :'start_day' => :'String',
98
+ :'start_month' => :'String',
99
+ :'start_offset' => :'Integer',
100
+ :'start_position' => :'String'
101
+ }
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ return unless attributes.is_a?(Hash)
108
+
109
+ # convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
111
+
112
+ if attributes.has_key?(:'interval')
113
+ self.interval = attributes[:'interval']
114
+ end
115
+
116
+ if attributes.has_key?(:'occurs')
117
+ self.occurs = attributes[:'occurs']
118
+ end
119
+
120
+ if attributes.has_key?(:'endDate')
121
+ self.end_date = attributes[:'endDate']
122
+ end
123
+
124
+ if attributes.has_key?(:'weekStart')
125
+ self.week_start = attributes[:'weekStart']
126
+ end
127
+
128
+ if attributes.has_key?(:'discriminator')
129
+ @discriminator = self.class.name.split('::').last
130
+ end
131
+
132
+ if attributes.has_key?(:'startDay')
133
+ self.start_day = attributes[:'startDay']
134
+ end
135
+
136
+ if attributes.has_key?(:'startMonth')
137
+ self.start_month = attributes[:'startMonth']
138
+ end
139
+
140
+ if attributes.has_key?(:'startOffset')
141
+ self.start_offset = attributes[:'startOffset']
142
+ end
143
+
144
+ if attributes.has_key?(:'startPosition')
145
+ self.start_position = attributes[:'startPosition']
146
+ end
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Integer] interval Number of recurrence units.
151
+ # @param [Integer] occurs Number of occurrences of the recurrence pattern.
152
+ # @param [DateTime] end_date End date.
153
+ # @param [String] week_start Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
154
+ # @param [String] discriminator
155
+ # @param [String] start_day Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
156
+ # @param [String] start_month Represents a calendar month. Enum, available values: None, January, February, March, April, May, June, July, August, September, October, November, December
157
+ # @param [Integer] start_offset Start offset.
158
+ # @param [String] start_position Day positions, typically found in a month. Enum, available values: None, First, Second, Third, Fourth, Last
159
+ def initialize(interval=nil, occurs=nil, end_date=nil, week_start=nil, discriminator=nil, start_day=nil, start_month=nil, start_offset=nil, start_position=nil)
160
+ self.interval = interval if interval
161
+ self.occurs = occurs if occurs
162
+ self.end_date = end_date if end_date
163
+ self.week_start = week_start if week_start
164
+ @discriminator = self.class.name.split('::').last
165
+ self.start_day = start_day if start_day
166
+ self.start_month = start_month if start_month
167
+ self.start_offset = start_offset if start_offset
168
+ self.start_position = start_position if start_position
169
+ end
170
+
171
+ # Show invalid properties with the reasons. Usually used together with valid?
172
+ # @return Array for valid properties with the reasons
173
+ def list_invalid_properties
174
+ invalid_properties = Array.new
175
+ if @interval.nil?
176
+ invalid_properties.push('invalid value for "interval", interval cannot be nil.')
177
+ end
178
+
179
+ if @occurs.nil?
180
+ invalid_properties.push('invalid value for "occurs", occurs cannot be nil.')
181
+ end
182
+
183
+ if @end_date.nil?
184
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
185
+ end
186
+
187
+ if @week_start.nil?
188
+ invalid_properties.push('invalid value for "week_start", week_start cannot be nil.')
189
+ end
190
+
191
+ if @discriminator.nil?
192
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
193
+ end
194
+
195
+ if @start_day.nil?
196
+ invalid_properties.push('invalid value for "start_day", start_day cannot be nil.')
197
+ end
198
+
199
+ if @start_month.nil?
200
+ invalid_properties.push('invalid value for "start_month", start_month cannot be nil.')
201
+ end
202
+
203
+ if @start_offset.nil?
204
+ invalid_properties.push('invalid value for "start_offset", start_offset cannot be nil.')
205
+ end
206
+
207
+ if @start_position.nil?
208
+ invalid_properties.push('invalid value for "start_position", start_position cannot be nil.')
209
+ end
210
+
211
+ invalid_properties
212
+ end
213
+
214
+ # Check to see if the all the properties in the model are valid
215
+ # @return true if the model is valid
216
+ def valid?
217
+ return false if @interval.nil?
218
+ return false if @occurs.nil?
219
+ return false if @end_date.nil?
220
+ return false if @week_start.nil?
221
+ return false if @discriminator.nil?
222
+ return false if @start_day.nil?
223
+ return false if @start_month.nil?
224
+ return false if @start_offset.nil?
225
+ return false if @start_position.nil?
226
+ true
227
+ end
228
+
229
+ # Checks equality by comparing each attribute.
230
+ # @param [Object] Object to be compared
231
+ def ==(o)
232
+ return true if self.equal?(o)
233
+ self.class == o.class &&
234
+ interval == o.interval &&
235
+ occurs == o.occurs &&
236
+ end_date == o.end_date &&
237
+ week_start == o.week_start &&
238
+ discriminator == o.discriminator &&
239
+ start_day == o.start_day &&
240
+ start_month == o.start_month &&
241
+ start_offset == o.start_offset &&
242
+ start_position == o.start_position
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Fixnum] Hash code
253
+ def hash
254
+ [interval, occurs, end_date, week_start, discriminator, start_day, start_month, start_offset, start_position].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def build_from_hash(attributes)
261
+ return nil unless attributes.is_a?(Hash)
262
+ self.class.swagger_types.each_pair do |key, type|
263
+ attribute_key = self.class.attribute_map[key]
264
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
265
+ if type =~ /\AArray<(.*)>/i
266
+ # check to ensure the input is an array given that the the attribute
267
+ # is documented as an array but the input is not
268
+ if attributes[attribute_key].is_a?(Array)
269
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
270
+ end
271
+ elsif !attributes[attribute_key].nil?
272
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
273
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
274
+ end
275
+
276
+ self
277
+ end
278
+
279
+ # Deserializes the data based on type
280
+ # @param string type Data type
281
+ # @param string value Value to be deserialized
282
+ # @return [Object] Deserialized data
283
+ def _deserialize(type, value)
284
+ case type.to_sym
285
+ when :DateTime
286
+ DateTime.parse(value)
287
+ when :Date
288
+ Date.parse(value)
289
+ when :String
290
+ value.to_s
291
+ when :Integer
292
+ value.to_i
293
+ when :Float
294
+ value.to_f
295
+ when :BOOLEAN
296
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
297
+ true
298
+ else
299
+ false
300
+ end
301
+ when :Object
302
+ # generic object (usually a Hash), return directly
303
+ value
304
+ when /\AArray<(?<inner_type>.+)>\z/
305
+ inner_type = Regexp.last_match[:inner_type]
306
+ value.map { |v| _deserialize(inner_type, v) }
307
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
308
+ k_type = Regexp.last_match[:k_type]
309
+ v_type = Regexp.last_match[:v_type]
310
+ {}.tap do |hash|
311
+ value.each do |k, v|
312
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
313
+ end
314
+ end
315
+ else # model
316
+ sub_type = value[:type] || value[:discriminator] || type
317
+ if AsposeEmailCloud.const_defined?(sub_type)
318
+ type = sub_type
319
+ end
320
+ temp_model = AsposeEmailCloud.const_get(type).new
321
+ temp_model.build_from_hash(value)
322
+ end
323
+ end
324
+
325
+ # Returns the string representation of the object
326
+ # @return [String] String presentation of the object
327
+ def to_s
328
+ to_hash.to_s
329
+ end
330
+
331
+ # to_body is an alias to to_hash (backward compatibility)
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_body
334
+ to_hash
335
+ end
336
+
337
+ # Returns the object in the form of hash
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_hash
340
+ hash = {}
341
+ self.class.attribute_map.each_pair do |attr, param|
342
+ value = self.send(attr)
343
+ next if value.nil?
344
+ hash[param] = _to_hash(value)
345
+ end
346
+ hash
347
+ end
348
+
349
+ # Outputs non-array value in the form of hash
350
+ # For object, use to_hash. Otherwise, just return the value
351
+ # @param [Object] value Any valid value
352
+ # @return [Hash] Returns the value in the form of hash
353
+ def _to_hash(value)
354
+ if value.is_a?(Array)
355
+ value.compact.map { |v| _to_hash(v) }
356
+ elsif value.is_a?(Hash)
357
+ {}.tap do |hash|
358
+ value.each { |k, v| hash[k] = _to_hash(v) }
359
+ end
360
+ elsif value.respond_to? :to_hash
361
+ value.to_hash
362
+ else
363
+ value
364
+ end
365
+ end
366
+
367
+ end
368
+ end