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,260 @@
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 media object.
18
+ class RcsMedia
19
+ attr_accessor :height
20
+
21
+ attr_accessor :content_info
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'height' => :'height',
49
+ :'content_info' => :'content_info'
50
+ }
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'height' => :'RcsMediaHeight',
62
+ :'content_info' => :'RcsContentInfo'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::RcsMedia` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::RcsMedia`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'height')
88
+ self.height = attributes[:'height']
89
+ else
90
+ self.height = nil
91
+ end
92
+
93
+ if attributes.key?(:'content_info')
94
+ self.content_info = attributes[:'content_info']
95
+ else
96
+ self.content_info = nil
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ if @height.nil?
106
+ invalid_properties.push('invalid value for "height", height cannot be nil.')
107
+ end
108
+
109
+ if @content_info.nil?
110
+ invalid_properties.push('invalid value for "content_info", content_info cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @height.nil?
121
+ return false if @content_info.nil?
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ height == o.height &&
131
+ content_info == o.content_info
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [height, content_info].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ transformed_hash = {}
153
+ openapi_types.each_pair do |key, type|
154
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = nil
156
+ elsif type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[attribute_map[key]].is_a?(Array)
160
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
+ end
162
+ elsif !attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
+ end
165
+ end
166
+ new(transformed_hash)
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def self._deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = MessenteApi.const_get(type)
208
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -0,0 +1,41 @@
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
+ class RcsMediaHeight
18
+ SHORT = "SHORT".freeze
19
+ MEDIUM = "MEDIUM".freeze
20
+ TALL = "TALL".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [SHORT, MEDIUM, TALL].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if RcsMediaHeight.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #RcsMediaHeight"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,299 @@
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 open a URL in a browser.
18
+ class RcsOpenUrlAction
19
+ # The URL to open.
20
+ attr_accessor :url
21
+
22
+ # A description of the URL being opened.
23
+ attr_accessor :description
24
+
25
+ attr_accessor :application
26
+
27
+ attr_accessor :webview_view_mode
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'url' => :'url',
55
+ :'description' => :'description',
56
+ :'application' => :'application',
57
+ :'webview_view_mode' => :'webview_view_mode'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'url' => :'String',
70
+ :'description' => :'String',
71
+ :'application' => :'RcsOpenUrlApplication',
72
+ :'webview_view_mode' => :'RcsWebviewViewMode'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::RcsOpenUrlAction` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::RcsOpenUrlAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'url')
98
+ self.url = attributes[:'url']
99
+ else
100
+ self.url = nil
101
+ end
102
+
103
+ if attributes.key?(:'description')
104
+ self.description = attributes[:'description']
105
+ end
106
+
107
+ if attributes.key?(:'application')
108
+ self.application = attributes[:'application']
109
+ else
110
+ self.application = nil
111
+ end
112
+
113
+ if attributes.key?(:'webview_view_mode')
114
+ self.webview_view_mode = attributes[:'webview_view_mode']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @url.nil?
124
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
125
+ end
126
+
127
+ if @url.to_s.length > 2048
128
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 2048.')
129
+ end
130
+
131
+ if @application.nil?
132
+ invalid_properties.push('invalid value for "application", application cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if @url.nil?
143
+ return false if @url.to_s.length > 2048
144
+ return false if @application.nil?
145
+ true
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] url Value to be assigned
150
+ def url=(url)
151
+ if url.nil?
152
+ fail ArgumentError, 'url cannot be nil'
153
+ end
154
+
155
+ if url.to_s.length > 2048
156
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 2048.'
157
+ end
158
+
159
+ @url = url
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ url == o.url &&
168
+ description == o.description &&
169
+ application == o.application &&
170
+ webview_view_mode == o.webview_view_mode
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 [Integer] Hash code
181
+ def hash
182
+ [url, description, application, webview_view_mode].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 self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash)
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def self._deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf
246
+ klass = MessenteApi.const_get(type)
247
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ end
@@ -0,0 +1,40 @@
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
+ class RcsOpenUrlApplication
18
+ BROWSER = "BROWSER".freeze
19
+ WEBVIEW = "WEBVIEW".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [BROWSER, WEBVIEW].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if RcsOpenUrlApplication.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #RcsOpenUrlApplication"
38
+ end
39
+ end
40
+ end