messente_api 2.2.0 → 2.4.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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -1
  3. data/docs/AccountBalanceApi.md +161 -0
  4. data/docs/NumberVerificationApi.md +195 -0
  5. data/docs/Price.md +24 -0
  6. data/docs/PriceNetworksInner.md +22 -0
  7. data/docs/PricingApi.md +167 -0
  8. data/docs/WhatsApp.md +13 -1
  9. data/docs/WhatsAppAudio.md +22 -0
  10. data/docs/WhatsAppDocument.md +26 -0
  11. data/docs/WhatsAppImage.md +24 -0
  12. data/docs/WhatsAppParameter.md +5 -1
  13. data/docs/WhatsAppSticker.md +24 -0
  14. data/docs/WhatsAppTemplate.md +1 -1
  15. data/docs/WhatsAppTemplatesApi.md +384 -0
  16. data/docs/WhatsAppText.md +20 -0
  17. data/docs/WhatsAppVideo.md +24 -0
  18. data/docs/WhatsappButtonType.md +15 -0
  19. data/docs/WhatsappComponentType.md +15 -0
  20. data/docs/WhatsappCreateTemplateRequest.md +24 -0
  21. data/docs/WhatsappCreateTemplateResponse.md +22 -0
  22. data/docs/WhatsappHeaderFormat.md +15 -0
  23. data/docs/WhatsappListTemplatesResponse.md +20 -0
  24. data/docs/WhatsappOtpButtonType.md +15 -0
  25. data/docs/WhatsappPagination.md +22 -0
  26. data/docs/WhatsappPagingCursors.md +20 -0
  27. data/docs/WhatsappSupportedApp.md +20 -0
  28. data/docs/WhatsappTemplateButton.md +30 -0
  29. data/docs/WhatsappTemplateCategory.md +15 -0
  30. data/docs/WhatsappTemplateComponent.md +26 -0
  31. data/docs/WhatsappTemplateExample.md +20 -0
  32. data/docs/WhatsappTemplateResponse.md +28 -0
  33. data/docs/WhatsappTemplateStatus.md +15 -0
  34. data/docs/WhatsappUpdateTemplateRequest.md +20 -0
  35. data/lib/messente_api/api/account_balance_api.rb +160 -0
  36. data/lib/messente_api/api/blacklist_api.rb +5 -5
  37. data/lib/messente_api/api/bulk_messaging_api.rb +2 -2
  38. data/lib/messente_api/api/contacts_api.rb +9 -9
  39. data/lib/messente_api/api/delivery_report_api.rb +2 -2
  40. data/lib/messente_api/api/groups_api.rb +6 -6
  41. data/lib/messente_api/api/number_lookup_api.rb +2 -2
  42. data/lib/messente_api/api/number_verification_api.rb +217 -0
  43. data/lib/messente_api/api/omnimessage_api.rb +3 -3
  44. data/lib/messente_api/api/pricing_api.rb +170 -0
  45. data/lib/messente_api/api/statistics_api.rb +2 -2
  46. data/lib/messente_api/api/whats_app_templates_api.rb +399 -0
  47. data/lib/messente_api/api_client.rb +1 -1
  48. data/lib/messente_api/api_error.rb +1 -1
  49. data/lib/messente_api/configuration.rb +61 -1
  50. data/lib/messente_api/models/bulk_omni_message_create_success_response.rb +1 -1
  51. data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +1 -1
  52. data/lib/messente_api/models/bulk_omnimessage.rb +1 -1
  53. data/lib/messente_api/models/channel.rb +1 -1
  54. data/lib/messente_api/models/contact_envelope.rb +1 -1
  55. data/lib/messente_api/models/contact_fields.rb +1 -1
  56. data/lib/messente_api/models/contact_list_envelope.rb +1 -1
  57. data/lib/messente_api/models/contact_response_fields.rb +1 -1
  58. data/lib/messente_api/models/contact_update_fields.rb +1 -1
  59. data/lib/messente_api/models/delivery_report_response.rb +1 -1
  60. data/lib/messente_api/models/delivery_result.rb +1 -1
  61. data/lib/messente_api/models/error_code_omnichannel.rb +1 -1
  62. data/lib/messente_api/models/error_code_omnichannel_machine.rb +1 -1
  63. data/lib/messente_api/models/error_code_phonebook.rb +1 -1
  64. data/lib/messente_api/models/error_code_statistics.rb +1 -1
  65. data/lib/messente_api/models/error_item_number_lookup.rb +1 -1
  66. data/lib/messente_api/models/error_item_number_lookup_error.rb +1 -1
  67. data/lib/messente_api/models/error_item_omnichannel.rb +1 -1
  68. data/lib/messente_api/models/error_item_phonebook.rb +1 -1
  69. data/lib/messente_api/models/error_item_statistics.rb +1 -1
  70. data/lib/messente_api/models/error_number_lookup.rb +1 -1
  71. data/lib/messente_api/models/error_omnichannel.rb +1 -1
  72. data/lib/messente_api/models/error_phonebook.rb +1 -1
  73. data/lib/messente_api/models/error_statistics.rb +1 -1
  74. data/lib/messente_api/models/error_title_omnichannel.rb +1 -1
  75. data/lib/messente_api/models/error_title_phonebook.rb +1 -1
  76. data/lib/messente_api/models/fetch_blacklist_success.rb +1 -1
  77. data/lib/messente_api/models/group_envelope.rb +1 -1
  78. data/lib/messente_api/models/group_list_envelope.rb +1 -1
  79. data/lib/messente_api/models/group_name.rb +1 -1
  80. data/lib/messente_api/models/group_response_fields.rb +1 -1
  81. data/lib/messente_api/models/message_result.rb +1 -1
  82. data/lib/messente_api/models/mobile_network.rb +1 -1
  83. data/lib/messente_api/models/number_to_blacklist.rb +1 -1
  84. data/lib/messente_api/models/numbers_to_investigate.rb +1 -1
  85. data/lib/messente_api/models/omni_message_create_success_response.rb +1 -1
  86. data/lib/messente_api/models/omnimessage.rb +1 -1
  87. data/lib/messente_api/models/omnimessage_messages_inner.rb +1 -1
  88. data/lib/messente_api/models/price.rb +276 -0
  89. data/lib/messente_api/models/price_info.rb +1 -1
  90. data/lib/messente_api/models/price_networks_inner.rb +257 -0
  91. data/lib/messente_api/models/priority.rb +1 -1
  92. data/lib/messente_api/models/sms.rb +1 -1
  93. data/lib/messente_api/models/statistics_report.rb +1 -1
  94. data/lib/messente_api/models/statistics_report_settings.rb +1 -1
  95. data/lib/messente_api/models/statistics_report_success.rb +1 -1
  96. data/lib/messente_api/models/status.rb +1 -1
  97. data/lib/messente_api/models/sync_number_lookup_result.rb +1 -1
  98. data/lib/messente_api/models/sync_number_lookup_success.rb +1 -1
  99. data/lib/messente_api/models/telegram.rb +1 -1
  100. data/lib/messente_api/models/text_store.rb +1 -1
  101. data/lib/messente_api/models/viber.rb +1 -1
  102. data/lib/messente_api/models/viber_video.rb +1 -1
  103. data/lib/messente_api/models/whats_app.rb +59 -5
  104. data/lib/messente_api/models/whats_app_audio.rb +239 -0
  105. data/lib/messente_api/models/whats_app_component.rb +2 -1
  106. data/lib/messente_api/models/whats_app_currency.rb +1 -1
  107. data/lib/messente_api/models/whats_app_datetime.rb +1 -1
  108. data/lib/messente_api/models/whats_app_document.rb +261 -0
  109. data/lib/messente_api/models/whats_app_image.rb +250 -0
  110. data/lib/messente_api/models/whats_app_language.rb +1 -1
  111. data/lib/messente_api/models/whats_app_media.rb +1 -1
  112. data/lib/messente_api/models/whats_app_parameter.rb +25 -5
  113. data/lib/messente_api/models/whats_app_sticker.rb +250 -0
  114. data/lib/messente_api/models/whats_app_template.rb +8 -1
  115. data/lib/messente_api/models/whats_app_text.rb +235 -0
  116. data/lib/messente_api/models/whats_app_video.rb +250 -0
  117. data/lib/messente_api/models/whatsapp_button_type.rb +45 -0
  118. data/lib/messente_api/models/whatsapp_component_type.rb +42 -0
  119. data/lib/messente_api/models/whatsapp_create_template_request.rb +297 -0
  120. data/lib/messente_api/models/whatsapp_create_template_response.rb +277 -0
  121. data/lib/messente_api/models/whatsapp_header_format.rb +39 -0
  122. data/lib/messente_api/models/whatsapp_list_templates_response.rb +241 -0
  123. data/lib/messente_api/models/whatsapp_otp_button_type.rb +41 -0
  124. data/lib/messente_api/models/whatsapp_pagination.rb +242 -0
  125. data/lib/messente_api/models/whatsapp_paging_cursors.rb +226 -0
  126. data/lib/messente_api/models/whatsapp_supported_app.rb +240 -0
  127. data/lib/messente_api/models/whatsapp_template_button.rb +355 -0
  128. data/lib/messente_api/models/whatsapp_template_category.rb +41 -0
  129. data/lib/messente_api/models/whatsapp_template_component.rb +277 -0
  130. data/lib/messente_api/models/whatsapp_template_example.rb +230 -0
  131. data/lib/messente_api/models/whatsapp_template_response.rb +330 -0
  132. data/lib/messente_api/models/whatsapp_template_status.rb +47 -0
  133. data/lib/messente_api/models/whatsapp_update_template_request.rb +227 -0
  134. data/lib/messente_api/version.rb +2 -2
  135. data/lib/messente_api.rb +30 -1
  136. data/messente_api.gemspec +1 -1
  137. data/spec/spec_helper.rb +1 -1
  138. metadata +60 -2
@@ -0,0 +1,230 @@
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, WhatsApp and Telegram 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
+ # Example of the templated content
18
+ class WhatsappTemplateExample
19
+ # Example of the templated text for the header
20
+ attr_accessor :header_text
21
+
22
+ # Example of the templated text for the body
23
+ attr_accessor :body_text
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'header_text' => :'header_text',
29
+ :'body_text' => :'body_text'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'header_text' => :'Array<String>',
42
+ :'body_text' => :'Array<Array<String>>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::WhatsappTemplateExample` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::WhatsappTemplateExample`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'header_text')
68
+ if (value = attributes[:'header_text']).is_a?(Array)
69
+ self.header_text = value
70
+ end
71
+ end
72
+
73
+ if attributes.key?(:'body_text')
74
+ if (value = attributes[:'body_text']).is_a?(Array)
75
+ self.body_text = value
76
+ end
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ header_text == o.header_text &&
101
+ body_text == o.body_text
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [header_text, body_text].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def self._deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = MessenteApi.const_get(type)
178
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -0,0 +1,330 @@
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, WhatsApp and Telegram 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
+ # Whatsapp Cloud API template
18
+ class WhatsappTemplateResponse
19
+ # Template ID
20
+ attr_accessor :id
21
+
22
+ # List of template components
23
+ attr_accessor :components
24
+
25
+ # Language of the template
26
+ attr_accessor :language
27
+
28
+ # Name of the template
29
+ attr_accessor :name
30
+
31
+ attr_accessor :category
32
+
33
+ attr_accessor :status
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'id' => :'id',
61
+ :'components' => :'components',
62
+ :'language' => :'language',
63
+ :'name' => :'name',
64
+ :'category' => :'category',
65
+ :'status' => :'status'
66
+ }
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'id' => :'String',
78
+ :'components' => :'Array<WhatsappTemplateComponent>',
79
+ :'language' => :'String',
80
+ :'name' => :'String',
81
+ :'category' => :'WhatsappTemplateCategory',
82
+ :'status' => :'WhatsappTemplateStatus'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::WhatsappTemplateResponse` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::WhatsappTemplateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'id')
108
+ self.id = attributes[:'id']
109
+ else
110
+ self.id = nil
111
+ end
112
+
113
+ if attributes.key?(:'components')
114
+ if (value = attributes[:'components']).is_a?(Array)
115
+ self.components = value
116
+ end
117
+ else
118
+ self.components = nil
119
+ end
120
+
121
+ if attributes.key?(:'language')
122
+ self.language = attributes[:'language']
123
+ else
124
+ self.language = nil
125
+ end
126
+
127
+ if attributes.key?(:'name')
128
+ self.name = attributes[:'name']
129
+ else
130
+ self.name = nil
131
+ end
132
+
133
+ if attributes.key?(:'category')
134
+ self.category = attributes[:'category']
135
+ else
136
+ self.category = nil
137
+ end
138
+
139
+ if attributes.key?(:'status')
140
+ self.status = attributes[:'status']
141
+ else
142
+ self.status = nil
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
150
+ invalid_properties = Array.new
151
+ if @id.nil?
152
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
153
+ end
154
+
155
+ if @components.nil?
156
+ invalid_properties.push('invalid value for "components", components cannot be nil.')
157
+ end
158
+
159
+ if @language.nil?
160
+ invalid_properties.push('invalid value for "language", language cannot be nil.')
161
+ end
162
+
163
+ if @name.nil?
164
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
165
+ end
166
+
167
+ if @category.nil?
168
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
169
+ end
170
+
171
+ if @status.nil?
172
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
173
+ end
174
+
175
+ invalid_properties
176
+ end
177
+
178
+ # Check to see if the all the properties in the model are valid
179
+ # @return true if the model is valid
180
+ def valid?
181
+ warn '[DEPRECATED] the `valid?` method is obsolete'
182
+ return false if @id.nil?
183
+ return false if @components.nil?
184
+ return false if @language.nil?
185
+ return false if @name.nil?
186
+ return false if @category.nil?
187
+ return false if @status.nil?
188
+ true
189
+ end
190
+
191
+ # Checks equality by comparing each attribute.
192
+ # @param [Object] Object to be compared
193
+ def ==(o)
194
+ return true if self.equal?(o)
195
+ self.class == o.class &&
196
+ id == o.id &&
197
+ components == o.components &&
198
+ language == o.language &&
199
+ name == o.name &&
200
+ category == o.category &&
201
+ status == o.status
202
+ end
203
+
204
+ # @see the `==` method
205
+ # @param [Object] Object to be compared
206
+ def eql?(o)
207
+ self == o
208
+ end
209
+
210
+ # Calculates hash code according to all attributes.
211
+ # @return [Integer] Hash code
212
+ def hash
213
+ [id, components, language, name, category, status].hash
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def self.build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ transformed_hash = {}
223
+ openapi_types.each_pair do |key, type|
224
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = nil
226
+ elsif type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[attribute_map[key]].is_a?(Array)
230
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
231
+ end
232
+ elsif !attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
234
+ end
235
+ end
236
+ new(transformed_hash)
237
+ end
238
+
239
+ # Deserializes the data based on type
240
+ # @param string type Data type
241
+ # @param string value Value to be deserialized
242
+ # @return [Object] Deserialized data
243
+ def self._deserialize(type, value)
244
+ case type.to_sym
245
+ when :Time
246
+ Time.parse(value)
247
+ when :Date
248
+ Date.parse(value)
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :Boolean
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else # model
276
+ # models (e.g. Pet) or oneOf
277
+ klass = MessenteApi.const_get(type)
278
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ if value.nil?
301
+ is_nullable = self.class.openapi_nullable.include?(attr)
302
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
303
+ end
304
+
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map { |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+
328
+ end
329
+
330
+ end
@@ -0,0 +1,47 @@
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, WhatsApp and Telegram 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 WhatsappTemplateStatus
18
+ APPROVED = "approved".freeze
19
+ IN_APPEAL = "in_appeal".freeze
20
+ REJECTED = "rejected".freeze
21
+ PENDING = "pending".freeze
22
+ PENDING_DELETION = "pending_deletion".freeze
23
+ DELETED = "deleted".freeze
24
+ DISABLED = "disabled".freeze
25
+ PAUSED = "paused".freeze
26
+ LIMIT_EXCEEDED = "limit_exceeded".freeze
27
+
28
+ def self.all_vars
29
+ @all_vars ||= [APPROVED, IN_APPEAL, REJECTED, PENDING, PENDING_DELETION, DELETED, DISABLED, PAUSED, LIMIT_EXCEEDED].freeze
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 self.build_from_hash(value)
36
+ new.build_from_hash(value)
37
+ end
38
+
39
+ # Builds the enum from string
40
+ # @param [String] The enum value in the form of the string
41
+ # @return [String] The enum value
42
+ def build_from_hash(value)
43
+ return value if WhatsappTemplateStatus.all_vars.include?(value)
44
+ raise "Invalid ENUM value #{value} for class #WhatsappTemplateStatus"
45
+ end
46
+ end
47
+ end