messente_api 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +74 -0
  3. data/README.md +2 -2
  4. data/docs/BulkMessagingApi.md +1 -1
  5. data/docs/OmnimessageApi.md +1 -1
  6. data/docs/OmnimessageMessagesInner.md +46 -45
  7. data/docs/Rcs.md +32 -0
  8. data/docs/RcsCardContent.md +24 -0
  9. data/docs/RcsCardOrientation.md +15 -0
  10. data/docs/RcsCardWidth.md +15 -0
  11. data/docs/RcsCarouselCard.md +20 -0
  12. data/docs/RcsContentInfo.md +22 -0
  13. data/docs/RcsCreateCalendarEventAction.md +24 -0
  14. data/docs/RcsDialAction.md +18 -0
  15. data/docs/RcsImageAlignment.md +15 -0
  16. data/docs/RcsLatLng.md +20 -0
  17. data/docs/RcsMedia.md +20 -0
  18. data/docs/RcsMediaHeight.md +15 -0
  19. data/docs/RcsOpenUrlAction.md +24 -0
  20. data/docs/RcsOpenUrlApplication.md +15 -0
  21. data/docs/RcsRichCard.md +20 -0
  22. data/docs/RcsStandaloneCard.md +22 -0
  23. data/docs/RcsSuggestedAction.md +32 -0
  24. data/docs/RcsSuggestedReply.md +20 -0
  25. data/docs/RcsSuggestion.md +20 -0
  26. data/docs/RcsViewLocationAction.md +22 -0
  27. data/docs/RcsWebviewViewMode.md +15 -0
  28. data/docs/StatisticsReportSettings.md +1 -1
  29. data/lib/messente_api/api/account_balance_api.rb +1 -1
  30. data/lib/messente_api/api/blacklist_api.rb +1 -1
  31. data/lib/messente_api/api/bulk_messaging_api.rb +1 -1
  32. data/lib/messente_api/api/contacts_api.rb +1 -1
  33. data/lib/messente_api/api/delivery_report_api.rb +1 -1
  34. data/lib/messente_api/api/groups_api.rb +1 -1
  35. data/lib/messente_api/api/number_lookup_api.rb +1 -1
  36. data/lib/messente_api/api/number_verification_api.rb +1 -1
  37. data/lib/messente_api/api/omnimessage_api.rb +1 -1
  38. data/lib/messente_api/api/pricing_api.rb +1 -1
  39. data/lib/messente_api/api/statistics_api.rb +1 -1
  40. data/lib/messente_api/api/whats_app_templates_api.rb +1 -1
  41. data/lib/messente_api/api_client.rb +1 -1
  42. data/lib/messente_api/api_error.rb +1 -1
  43. data/lib/messente_api/configuration.rb +1 -1
  44. data/lib/messente_api/models/bulk_omni_message_create_success_response.rb +1 -1
  45. data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +1 -1
  46. data/lib/messente_api/models/bulk_omnimessage.rb +1 -1
  47. data/lib/messente_api/models/channel.rb +3 -3
  48. data/lib/messente_api/models/contact_envelope.rb +1 -1
  49. data/lib/messente_api/models/contact_fields.rb +1 -1
  50. data/lib/messente_api/models/contact_list_envelope.rb +1 -1
  51. data/lib/messente_api/models/contact_response_fields.rb +1 -1
  52. data/lib/messente_api/models/contact_update_fields.rb +1 -1
  53. data/lib/messente_api/models/delivery_report_response.rb +1 -1
  54. data/lib/messente_api/models/delivery_result.rb +1 -1
  55. data/lib/messente_api/models/error_code_omnichannel.rb +1 -1
  56. data/lib/messente_api/models/error_code_omnichannel_machine.rb +1 -1
  57. data/lib/messente_api/models/error_code_phonebook.rb +1 -1
  58. data/lib/messente_api/models/error_code_statistics.rb +1 -1
  59. data/lib/messente_api/models/error_item_number_lookup.rb +1 -1
  60. data/lib/messente_api/models/error_item_number_lookup_error.rb +1 -1
  61. data/lib/messente_api/models/error_item_omnichannel.rb +1 -1
  62. data/lib/messente_api/models/error_item_phonebook.rb +1 -1
  63. data/lib/messente_api/models/error_item_statistics.rb +1 -1
  64. data/lib/messente_api/models/error_number_lookup.rb +1 -1
  65. data/lib/messente_api/models/error_omnichannel.rb +1 -1
  66. data/lib/messente_api/models/error_phonebook.rb +1 -1
  67. data/lib/messente_api/models/error_statistics.rb +1 -1
  68. data/lib/messente_api/models/error_title_omnichannel.rb +1 -1
  69. data/lib/messente_api/models/error_title_phonebook.rb +1 -1
  70. data/lib/messente_api/models/fetch_blacklist_success.rb +1 -1
  71. data/lib/messente_api/models/group_envelope.rb +1 -1
  72. data/lib/messente_api/models/group_list_envelope.rb +1 -1
  73. data/lib/messente_api/models/group_name.rb +1 -1
  74. data/lib/messente_api/models/group_response_fields.rb +1 -1
  75. data/lib/messente_api/models/message_result.rb +1 -1
  76. data/lib/messente_api/models/mobile_network.rb +1 -1
  77. data/lib/messente_api/models/number_to_blacklist.rb +1 -1
  78. data/lib/messente_api/models/numbers_to_investigate.rb +1 -1
  79. data/lib/messente_api/models/omni_message_create_success_response.rb +1 -1
  80. data/lib/messente_api/models/omnimessage.rb +1 -1
  81. data/lib/messente_api/models/omnimessage_messages_inner.rb +9 -10
  82. data/lib/messente_api/models/price.rb +1 -1
  83. data/lib/messente_api/models/price_info.rb +1 -1
  84. data/lib/messente_api/models/price_networks_inner.rb +1 -1
  85. data/lib/messente_api/models/priority.rb +1 -1
  86. data/lib/messente_api/models/{telegram.rb → rcs.rb} +98 -43
  87. data/lib/messente_api/models/rcs_card_content.rb +298 -0
  88. data/lib/messente_api/models/rcs_card_orientation.rb +40 -0
  89. data/lib/messente_api/models/rcs_card_width.rb +40 -0
  90. data/lib/messente_api/models/rcs_carousel_card.rb +291 -0
  91. data/lib/messente_api/models/rcs_content_info.rb +251 -0
  92. data/lib/messente_api/models/rcs_create_calendar_event_action.rb +312 -0
  93. data/lib/messente_api/models/rcs_dial_action.rb +223 -0
  94. data/lib/messente_api/models/rcs_image_alignment.rb +40 -0
  95. data/lib/messente_api/models/rcs_lat_lng.rb +240 -0
  96. data/lib/messente_api/models/rcs_media.rb +260 -0
  97. data/lib/messente_api/models/rcs_media_height.rb +41 -0
  98. data/lib/messente_api/models/rcs_open_url_action.rb +299 -0
  99. data/lib/messente_api/models/rcs_open_url_application.rb +40 -0
  100. data/lib/messente_api/models/rcs_rich_card.rb +224 -0
  101. data/lib/messente_api/models/rcs_standalone_card.rb +276 -0
  102. data/lib/messente_api/models/rcs_suggested_action.rb +350 -0
  103. data/lib/messente_api/models/rcs_suggested_reply.rb +278 -0
  104. data/lib/messente_api/models/rcs_suggestion.rb +224 -0
  105. data/lib/messente_api/models/rcs_view_location_action.rb +237 -0
  106. data/lib/messente_api/models/rcs_webview_view_mode.rb +41 -0
  107. data/lib/messente_api/models/sms.rb +1 -1
  108. data/lib/messente_api/models/statistics_report.rb +1 -1
  109. data/lib/messente_api/models/statistics_report_settings.rb +2 -2
  110. data/lib/messente_api/models/statistics_report_success.rb +1 -1
  111. data/lib/messente_api/models/status.rb +1 -1
  112. data/lib/messente_api/models/sync_number_lookup_result.rb +1 -1
  113. data/lib/messente_api/models/sync_number_lookup_success.rb +1 -1
  114. data/lib/messente_api/models/text_store.rb +1 -1
  115. data/lib/messente_api/models/viber.rb +1 -1
  116. data/lib/messente_api/models/viber_video.rb +1 -1
  117. data/lib/messente_api/models/whats_app.rb +1 -1
  118. data/lib/messente_api/models/whats_app_audio.rb +1 -1
  119. data/lib/messente_api/models/whats_app_component.rb +1 -1
  120. data/lib/messente_api/models/whats_app_currency.rb +1 -1
  121. data/lib/messente_api/models/whats_app_datetime.rb +1 -1
  122. data/lib/messente_api/models/whats_app_document.rb +1 -1
  123. data/lib/messente_api/models/whats_app_image.rb +1 -1
  124. data/lib/messente_api/models/whats_app_language.rb +1 -1
  125. data/lib/messente_api/models/whats_app_media.rb +1 -1
  126. data/lib/messente_api/models/whats_app_parameter.rb +1 -1
  127. data/lib/messente_api/models/whats_app_sticker.rb +1 -1
  128. data/lib/messente_api/models/whats_app_template.rb +1 -1
  129. data/lib/messente_api/models/whats_app_text.rb +1 -1
  130. data/lib/messente_api/models/whats_app_video.rb +1 -1
  131. data/lib/messente_api/models/whatsapp_button_type.rb +1 -1
  132. data/lib/messente_api/models/whatsapp_component_type.rb +1 -1
  133. data/lib/messente_api/models/whatsapp_create_template_request.rb +1 -1
  134. data/lib/messente_api/models/whatsapp_create_template_response.rb +1 -1
  135. data/lib/messente_api/models/whatsapp_header_format.rb +1 -1
  136. data/lib/messente_api/models/whatsapp_list_templates_response.rb +1 -1
  137. data/lib/messente_api/models/whatsapp_otp_button_type.rb +1 -1
  138. data/lib/messente_api/models/whatsapp_pagination.rb +1 -1
  139. data/lib/messente_api/models/whatsapp_paging_cursors.rb +1 -1
  140. data/lib/messente_api/models/whatsapp_supported_app.rb +1 -1
  141. data/lib/messente_api/models/whatsapp_template_button.rb +1 -1
  142. data/lib/messente_api/models/whatsapp_template_category.rb +1 -1
  143. data/lib/messente_api/models/whatsapp_template_component.rb +1 -1
  144. data/lib/messente_api/models/whatsapp_template_example.rb +1 -1
  145. data/lib/messente_api/models/whatsapp_template_response.rb +1 -1
  146. data/lib/messente_api/models/whatsapp_template_status.rb +1 -1
  147. data/lib/messente_api/models/whatsapp_update_template_request.rb +1 -1
  148. data/lib/messente_api/version.rb +2 -2
  149. data/lib/messente_api.rb +22 -2
  150. data/messente_api.gemspec +2 -2
  151. data/spec/spec_helper.rb +1 -1
  152. metadata +51 -10
  153. data/docs/Telegram.md +0 -30
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #Messente API
3
+
4
+ #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MessenteApi
17
+ # RCS content info object.
18
+ class RcsContentInfo
19
+ # Required file URL
20
+ attr_accessor :file_url
21
+
22
+ # Optional thumbnail URL
23
+ attr_accessor :thumbnail_url
24
+
25
+ # Force refresh the content
26
+ attr_accessor :force_refresh
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'file_url' => :'file_url',
32
+ :'thumbnail_url' => :'thumbnail_url',
33
+ :'force_refresh' => :'force_refresh'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'file_url' => :'String',
46
+ :'thumbnail_url' => :'String',
47
+ :'force_refresh' => :'Boolean'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'thumbnail_url',
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::RcsContentInfo` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::RcsContentInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'file_url')
74
+ self.file_url = attributes[:'file_url']
75
+ else
76
+ self.file_url = nil
77
+ end
78
+
79
+ if attributes.key?(:'thumbnail_url')
80
+ self.thumbnail_url = attributes[:'thumbnail_url']
81
+ end
82
+
83
+ if attributes.key?(:'force_refresh')
84
+ self.force_refresh = attributes[:'force_refresh']
85
+ else
86
+ self.force_refresh = nil
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ if @file_url.nil?
96
+ invalid_properties.push('invalid value for "file_url", file_url cannot be nil.')
97
+ end
98
+
99
+ if @force_refresh.nil?
100
+ invalid_properties.push('invalid value for "force_refresh", force_refresh cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ return false if @file_url.nil?
111
+ return false if @force_refresh.nil?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ file_url == o.file_url &&
121
+ thumbnail_url == o.thumbnail_url &&
122
+ force_refresh == o.force_refresh
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [file_url, thumbnail_url, force_refresh].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def self._deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = MessenteApi.const_get(type)
199
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,312 @@
1
+ =begin
2
+ #Messente API
3
+
4
+ #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MessenteApi
17
+ # Action to create a calendar event.
18
+ class RcsCreateCalendarEventAction
19
+ # The start time of the event.
20
+ attr_accessor :start_time
21
+
22
+ # The end time of the event.
23
+ attr_accessor :end_time
24
+
25
+ # The title of the event.
26
+ attr_accessor :title
27
+
28
+ # The description of the event.
29
+ attr_accessor :description
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'start_time' => :'start_time',
35
+ :'end_time' => :'end_time',
36
+ :'title' => :'title',
37
+ :'description' => :'description'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'start_time' => :'String',
50
+ :'end_time' => :'String',
51
+ :'title' => :'String',
52
+ :'description' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::RcsCreateCalendarEventAction` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::RcsCreateCalendarEventAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'start_time')
78
+ self.start_time = attributes[:'start_time']
79
+ else
80
+ self.start_time = nil
81
+ end
82
+
83
+ if attributes.key?(:'end_time')
84
+ self.end_time = attributes[:'end_time']
85
+ else
86
+ self.end_time = nil
87
+ end
88
+
89
+ if attributes.key?(:'title')
90
+ self.title = attributes[:'title']
91
+ else
92
+ self.title = nil
93
+ end
94
+
95
+ if attributes.key?(:'description')
96
+ self.description = attributes[:'description']
97
+ else
98
+ self.description = nil
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
+ invalid_properties = Array.new
107
+ if @start_time.nil?
108
+ invalid_properties.push('invalid value for "start_time", start_time cannot be nil.')
109
+ end
110
+
111
+ if @end_time.nil?
112
+ invalid_properties.push('invalid value for "end_time", end_time cannot be nil.')
113
+ end
114
+
115
+ if @title.nil?
116
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
117
+ end
118
+
119
+ if @title.to_s.length > 100
120
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.')
121
+ end
122
+
123
+ if @description.nil?
124
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
125
+ end
126
+
127
+ if @description.to_s.length > 500
128
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ return false if @start_time.nil?
139
+ return false if @end_time.nil?
140
+ return false if @title.nil?
141
+ return false if @title.to_s.length > 100
142
+ return false if @description.nil?
143
+ return false if @description.to_s.length > 500
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] title Value to be assigned
149
+ def title=(title)
150
+ if title.nil?
151
+ fail ArgumentError, 'title cannot be nil'
152
+ end
153
+
154
+ if title.to_s.length > 100
155
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.'
156
+ end
157
+
158
+ @title = title
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] description Value to be assigned
163
+ def description=(description)
164
+ if description.nil?
165
+ fail ArgumentError, 'description cannot be nil'
166
+ end
167
+
168
+ if description.to_s.length > 500
169
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
170
+ end
171
+
172
+ @description = description
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
+ start_time == o.start_time &&
181
+ end_time == o.end_time &&
182
+ title == o.title &&
183
+ description == o.description
184
+ end
185
+
186
+ # @see the `==` method
187
+ # @param [Object] Object to be compared
188
+ def eql?(o)
189
+ self == o
190
+ end
191
+
192
+ # Calculates hash code according to all attributes.
193
+ # @return [Integer] Hash code
194
+ def hash
195
+ [start_time, end_time, title, description].hash
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def self.build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ attributes = attributes.transform_keys(&:to_sym)
204
+ transformed_hash = {}
205
+ openapi_types.each_pair do |key, type|
206
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = nil
208
+ elsif type =~ /\AArray<(.*)>/i
209
+ # check to ensure the input is an array given that the attribute
210
+ # is documented as an array but the input is not
211
+ if attributes[attribute_map[key]].is_a?(Array)
212
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
213
+ end
214
+ elsif !attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
216
+ end
217
+ end
218
+ new(transformed_hash)
219
+ end
220
+
221
+ # Deserializes the data based on type
222
+ # @param string type Data type
223
+ # @param string value Value to be deserialized
224
+ # @return [Object] Deserialized data
225
+ def self._deserialize(type, value)
226
+ case type.to_sym
227
+ when :Time
228
+ Time.parse(value)
229
+ when :Date
230
+ Date.parse(value)
231
+ when :String
232
+ value.to_s
233
+ when :Integer
234
+ value.to_i
235
+ when :Float
236
+ value.to_f
237
+ when :Boolean
238
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
239
+ true
240
+ else
241
+ false
242
+ end
243
+ when :Object
244
+ # generic object (usually a Hash), return directly
245
+ value
246
+ when /\AArray<(?<inner_type>.+)>\z/
247
+ inner_type = Regexp.last_match[:inner_type]
248
+ value.map { |v| _deserialize(inner_type, v) }
249
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
250
+ k_type = Regexp.last_match[:k_type]
251
+ v_type = Regexp.last_match[:v_type]
252
+ {}.tap do |hash|
253
+ value.each do |k, v|
254
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ end
256
+ end
257
+ else # model
258
+ # models (e.g. Pet) or oneOf
259
+ klass = MessenteApi.const_get(type)
260
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
261
+ end
262
+ end
263
+
264
+ # Returns the string representation of the object
265
+ # @return [String] String presentation of the object
266
+ def to_s
267
+ to_hash.to_s
268
+ end
269
+
270
+ # to_body is an alias to to_hash (backward compatibility)
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_body
273
+ to_hash
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
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
+
312
+ end