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
@@ -50,7 +50,7 @@ module AsposeEmailCloud
50
50
  attr_accessor :mark_as_sent
51
51
 
52
52
  # Email document
53
- # @return [Object]
53
+ # @return [EmailDto]
54
54
  attr_accessor :message
55
55
 
56
56
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -73,7 +73,7 @@ module AsposeEmailCloud
73
73
  :'storage_folder' => :'StorageFolderLocation',
74
74
  :'folder' => :'String',
75
75
  :'mark_as_sent' => :'BOOLEAN',
76
- :'message' => :'Object'
76
+ :'message' => :'EmailDto'
77
77
  }
78
78
  end
79
79
 
@@ -116,7 +116,7 @@ module AsposeEmailCloud
116
116
  # @param [StorageFolderLocation] storage_folder Storage folder location of account files
117
117
  # @param [String] folder Email account folder to store a message
118
118
  # @param [BOOLEAN] mark_as_sent Mark message as sent
119
- # @param [Object] message Email document
119
+ # @param [EmailDto] message Email document
120
120
  def initialize(first_account=nil, second_account=nil, storage_folder=nil, folder=nil, mark_as_sent=nil, message=nil)
121
121
  self.first_account = first_account if first_account
122
122
  self.second_account = second_account if second_account
@@ -81,10 +81,14 @@ module AsposeEmailCloud
81
81
  # @return [MailAddress]
82
82
  attr_accessor :organizer
83
83
 
84
- # String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\"
84
+ # Deprecated, use 'Recurrence' property. String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\"
85
85
  # @return [String]
86
86
  attr_accessor :recurrence_string
87
87
 
88
+ # Recurrence pattern
89
+ # @return [RecurrencePatternDto]
90
+ attr_accessor :recurrence
91
+
88
92
  # Reminders.
89
93
  # @return [Array<CalendarReminder>]
90
94
  attr_accessor :reminders
@@ -130,6 +134,7 @@ module AsposeEmailCloud
130
134
  :'optional_attendees' => :'optionalAttendees',
131
135
  :'organizer' => :'organizer',
132
136
  :'recurrence_string' => :'recurrenceString',
137
+ :'recurrence' => :'recurrence',
133
138
  :'reminders' => :'reminders',
134
139
  :'sequence_id' => :'sequenceId',
135
140
  :'start_date' => :'startDate',
@@ -157,6 +162,7 @@ module AsposeEmailCloud
157
162
  :'optional_attendees' => :'Array<MailAddress>',
158
163
  :'organizer' => :'MailAddress',
159
164
  :'recurrence_string' => :'String',
165
+ :'recurrence' => :'RecurrencePatternDto',
160
166
  :'reminders' => :'Array<CalendarReminder>',
161
167
  :'sequence_id' => :'String',
162
168
  :'start_date' => :'DateTime',
@@ -239,6 +245,10 @@ module AsposeEmailCloud
239
245
  self.recurrence_string = attributes[:'recurrenceString']
240
246
  end
241
247
 
248
+ if attributes.has_key?(:'recurrence')
249
+ self.recurrence = attributes[:'recurrence']
250
+ end
251
+
242
252
  if attributes.has_key?(:'reminders')
243
253
  if (value = attributes[:'reminders']).is_a?(Array)
244
254
  self.reminders = value
@@ -284,7 +294,8 @@ module AsposeEmailCloud
284
294
  # @param [String] microsoft_intended_status Specifies the INTENDED status. Enum, available values: NotDefined, Free, Tentative, Busy, Oof
285
295
  # @param [Array<MailAddress>] optional_attendees Optional attendees.
286
296
  # @param [MailAddress] organizer Event organizer.
287
- # @param [String] recurrence_string String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\"
297
+ # @param [String] recurrence_string Deprecated, use 'Recurrence' property. String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\"
298
+ # @param [RecurrencePatternDto] recurrence Recurrence pattern
288
299
  # @param [Array<CalendarReminder>] reminders Reminders.
289
300
  # @param [String] sequence_id The sequence id. Read only.
290
301
  # @param [DateTime] start_date Start date.
@@ -292,7 +303,7 @@ module AsposeEmailCloud
292
303
  # @param [String] status Defines the overall status or confirmation for the calendar document. Enum, available values: NotDefined, Cancelled, Tentative, Confirmed
293
304
  # @param [String] summary Summary.
294
305
  # @param [String] transparency Specifies whether or not this appointment is intended to be visible in availability searches. Enum, available values: NotDefined, Transparent, Opaque
295
- def initialize(attachments=nil, attendees=nil, description=nil, end_date=nil, end_time_zone=nil, flags=nil, is_description_html=nil, location=nil, method=nil, microsoft_busy_status=nil, microsoft_intended_status=nil, optional_attendees=nil, organizer=nil, recurrence_string=nil, reminders=nil, sequence_id=nil, start_date=nil, start_time_zone=nil, status=nil, summary=nil, transparency=nil)
306
+ def initialize(attachments=nil, attendees=nil, description=nil, end_date=nil, end_time_zone=nil, flags=nil, is_description_html=nil, location=nil, method=nil, microsoft_busy_status=nil, microsoft_intended_status=nil, optional_attendees=nil, organizer=nil, recurrence_string=nil, recurrence=nil, reminders=nil, sequence_id=nil, start_date=nil, start_time_zone=nil, status=nil, summary=nil, transparency=nil)
296
307
  self.attachments = attachments if attachments
297
308
  self.attendees = attendees if attendees
298
309
  self.description = description if description
@@ -307,6 +318,7 @@ module AsposeEmailCloud
307
318
  self.optional_attendees = optional_attendees if optional_attendees
308
319
  self.organizer = organizer if organizer
309
320
  self.recurrence_string = recurrence_string if recurrence_string
321
+ self.recurrence = recurrence if recurrence
310
322
  self.reminders = reminders if reminders
311
323
  self.sequence_id = sequence_id if sequence_id
312
324
  self.start_date = start_date if start_date
@@ -422,6 +434,7 @@ module AsposeEmailCloud
422
434
  optional_attendees == o.optional_attendees &&
423
435
  organizer == o.organizer &&
424
436
  recurrence_string == o.recurrence_string &&
437
+ recurrence == o.recurrence &&
425
438
  reminders == o.reminders &&
426
439
  sequence_id == o.sequence_id &&
427
440
  start_date == o.start_date &&
@@ -440,7 +453,7 @@ module AsposeEmailCloud
440
453
  # Calculates hash code according to all attributes.
441
454
  # @return [Fixnum] Hash code
442
455
  def hash
443
- [attachments, attendees, description, end_date, end_time_zone, flags, is_description_html, location, method, microsoft_busy_status, microsoft_intended_status, optional_attendees, organizer, recurrence_string, reminders, sequence_id, start_date, start_time_zone, status, summary, transparency].hash
456
+ [attachments, attendees, description, end_date, end_time_zone, flags, is_description_html, location, method, microsoft_busy_status, microsoft_intended_status, optional_attendees, organizer, recurrence_string, recurrence, reminders, sequence_id, start_date, start_time_zone, status, summary, transparency].hash
444
457
  end
445
458
 
446
459
  # Builds the object from hash
@@ -37,11 +37,22 @@ module AsposeEmailCloud
37
37
  # @return [String]
38
38
  attr_accessor :base64_data
39
39
 
40
+
41
+ # @return [String]
42
+ def discriminator #getter method
43
+ self.class.name.split('::').last
44
+ end
45
+
46
+ def discriminator=(discriminator) #setter method, parameter ignored
47
+ @discriminator = self.class.name.split('::').last
48
+ end
49
+
40
50
  # Attribute mapping from ruby-style variable name to JSON key.
41
51
  def self.attribute_map
42
52
  {
43
53
  :'photo_image_format' => :'photoImageFormat',
44
- :'base64_data' => :'base64Data'
54
+ :'base64_data' => :'base64Data',
55
+ :'discriminator' => :'discriminator'
45
56
  }
46
57
  end
47
58
 
@@ -49,7 +60,8 @@ module AsposeEmailCloud
49
60
  def self.swagger_types
50
61
  {
51
62
  :'photo_image_format' => :'String',
52
- :'base64_data' => :'String'
63
+ :'base64_data' => :'String',
64
+ :'discriminator' => :'String'
53
65
  }
54
66
  end
55
67
 
@@ -68,14 +80,20 @@ module AsposeEmailCloud
68
80
  if attributes.has_key?(:'base64Data')
69
81
  self.base64_data = attributes[:'base64Data']
70
82
  end
83
+
84
+ if attributes.has_key?(:'discriminator')
85
+ @discriminator = self.class.name.split('::').last
86
+ end
71
87
  end
72
88
 
73
89
  # Initializes the object
74
90
  # @param [String] photo_image_format MapiContact photo image format. Enum, available values: Undefined, Jpeg, Gif, Wmf, Bmp, Tiff
75
91
  # @param [String] base64_data Photo serialized as base64 string.
76
- def initialize(photo_image_format=nil, base64_data=nil)
92
+ # @param [String] discriminator
93
+ def initialize(photo_image_format=nil, base64_data=nil, discriminator=nil)
77
94
  self.photo_image_format = photo_image_format if photo_image_format
78
95
  self.base64_data = base64_data if base64_data
96
+ @discriminator = self.class.name.split('::').last
79
97
  end
80
98
 
81
99
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -86,6 +104,10 @@ module AsposeEmailCloud
86
104
  invalid_properties.push('invalid value for "photo_image_format", photo_image_format cannot be nil.')
87
105
  end
88
106
 
107
+ if @discriminator.nil?
108
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
109
+ end
110
+
89
111
  invalid_properties
90
112
  end
91
113
 
@@ -93,6 +115,7 @@ module AsposeEmailCloud
93
115
  # @return true if the model is valid
94
116
  def valid?
95
117
  return false if @photo_image_format.nil?
118
+ return false if @discriminator.nil?
96
119
  true
97
120
  end
98
121
 
@@ -102,7 +125,8 @@ module AsposeEmailCloud
102
125
  return true if self.equal?(o)
103
126
  self.class == o.class &&
104
127
  photo_image_format == o.photo_image_format &&
105
- base64_data == o.base64_data
128
+ base64_data == o.base64_data &&
129
+ discriminator == o.discriminator
106
130
  end
107
131
 
108
132
  # @see the `==` method
@@ -114,7 +138,7 @@ module AsposeEmailCloud
114
138
  # Calculates hash code according to all attributes.
115
139
  # @return [Fixnum] Hash code
116
140
  def hash
117
- [photo_image_format, base64_data].hash
141
+ [photo_image_format, base64_data, discriminator].hash
118
142
  end
119
143
 
120
144
  # Builds the object from hash
@@ -0,0 +1,296 @@
1
+ # ----------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="DailyRecurrencePatternDto.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
+ # Daily recurrence.
31
+ class DailyRecurrencePatternDto
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
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'interval' => :'interval',
62
+ :'occurs' => :'occurs',
63
+ :'end_date' => :'endDate',
64
+ :'week_start' => :'weekStart',
65
+ :'discriminator' => :'discriminator'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.swagger_types
71
+ {
72
+ :'interval' => :'Integer',
73
+ :'occurs' => :'Integer',
74
+ :'end_date' => :'DateTime',
75
+ :'week_start' => :'String',
76
+ :'discriminator' => :'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?(:'interval')
89
+ self.interval = attributes[:'interval']
90
+ end
91
+
92
+ if attributes.has_key?(:'occurs')
93
+ self.occurs = attributes[:'occurs']
94
+ end
95
+
96
+ if attributes.has_key?(:'endDate')
97
+ self.end_date = attributes[:'endDate']
98
+ end
99
+
100
+ if attributes.has_key?(:'weekStart')
101
+ self.week_start = attributes[:'weekStart']
102
+ end
103
+
104
+ if attributes.has_key?(:'discriminator')
105
+ @discriminator = self.class.name.split('::').last
106
+ end
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Integer] interval Number of recurrence units.
111
+ # @param [Integer] occurs Number of occurrences of the recurrence pattern.
112
+ # @param [DateTime] end_date End date.
113
+ # @param [String] week_start Represents the day of the week. Enum, available values: None, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Day, WeekDay, WeekendDay
114
+ # @param [String] discriminator
115
+ def initialize(interval=nil, occurs=nil, end_date=nil, week_start=nil, discriminator=nil)
116
+ self.interval = interval if interval
117
+ self.occurs = occurs if occurs
118
+ self.end_date = end_date if end_date
119
+ self.week_start = week_start if week_start
120
+ @discriminator = self.class.name.split('::').last
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ if @interval.nil?
128
+ invalid_properties.push('invalid value for "interval", interval cannot be nil.')
129
+ end
130
+
131
+ if @occurs.nil?
132
+ invalid_properties.push('invalid value for "occurs", occurs cannot be nil.')
133
+ end
134
+
135
+ if @end_date.nil?
136
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
137
+ end
138
+
139
+ if @week_start.nil?
140
+ invalid_properties.push('invalid value for "week_start", week_start cannot be nil.')
141
+ end
142
+
143
+ if @discriminator.nil?
144
+ invalid_properties.push('invalid value for "discriminator", discriminator cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ return false if @interval.nil?
154
+ return false if @occurs.nil?
155
+ return false if @end_date.nil?
156
+ return false if @week_start.nil?
157
+ return false if @discriminator.nil?
158
+ true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ interval == o.interval &&
167
+ occurs == o.occurs &&
168
+ end_date == o.end_date &&
169
+ week_start == o.week_start &&
170
+ discriminator == o.discriminator
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Fixnum] Hash code
181
+ def hash
182
+ [interval, occurs, end_date, week_start, discriminator].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ self.class.swagger_types.each_pair do |key, type|
191
+ attribute_key = self.class.attribute_map[key]
192
+ attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
193
+ if type =~ /\AArray<(.*)>/i
194
+ # check to ensure the input is an array given that the the attribute
195
+ # is documented as an array but the input is not
196
+ if attributes[attribute_key].is_a?(Array)
197
+ self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
198
+ end
199
+ elsif !attributes[attribute_key].nil?
200
+ self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
201
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
202
+ end
203
+
204
+ self
205
+ end
206
+
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :DateTime
214
+ DateTime.parse(value)
215
+ when :Date
216
+ Date.parse(value)
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :BOOLEAN
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else # model
244
+ sub_type = value[:type] || value[:discriminator] || type
245
+ if AsposeEmailCloud.const_defined?(sub_type)
246
+ type = sub_type
247
+ end
248
+ temp_model = AsposeEmailCloud.const_get(type).new
249
+ temp_model.build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ next if value.nil?
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+ end