messente_api 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edf77cee5741d7f975c428c0f502351e11f6244b5e2716f3a00cabbe809a08f2
4
- data.tar.gz: abe38386d5e3209bd2a309abec65bf4acfd7364068540338ed01afc7368cb843
3
+ metadata.gz: ee58be9559a61fa1ea3a5574c3251075df0a2c81cfee73d6434d07aa56839356
4
+ data.tar.gz: ac898a07b96df35563ecd1c66949c9d666b3a3ebb8fefda2ed26543b40b099a3
5
5
  SHA512:
6
- metadata.gz: ad78ee70ca04f8dc51e93dd7935a276a26095b210aba306c148403aa48640ab4de46cda791da64b01653e8586263725b7d4aea18e5b10ef487b2720fe5cd3572
7
- data.tar.gz: b4c5a7e6f52edc6678936fc9e9f31d1135282cbb349814e0493aa6902a6e8b095aa9380b3a210d9c017a21cf20188e15fc2b23507560f7dc67256947e3233b54
6
+ metadata.gz: cbf1572d1dd1fe540b8d9547932b9ffb12e4c2486b45ff28c950c8b92c0e2de2a814f901915b3214f2f49af35b7a6e388e80db90ce3b820fac88d61c94398440
7
+ data.tar.gz: f9b9ed86b9d35d59d9861b4cc39d9e17c36b61a4aef0463e89421cede308da0d048f45d2339d743a2069bfaaaf92ccb6c4687aa80df24e05806a7119dbd00603
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Messente API Library
2
2
 
3
3
  - Messente API version: 2.0.0
4
- - Ruby gem version: 2.1.0
4
+ - Ruby gem version: 2.2.0
5
5
 
6
6
  [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.
7
7
 
data/docs/Viber.md CHANGED
@@ -12,6 +12,7 @@
12
12
  | **button_url** | **String** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional] |
13
13
  | **button_text** | **String** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional] |
14
14
  | **channel** | **String** | The channel used to deliver the message | [optional][default to 'viber'] |
15
+ | **video** | [**ViberVideo**](ViberVideo.md) | | [optional] |
15
16
 
16
17
  ## Example
17
18
 
@@ -26,7 +27,8 @@ instance = MessenteApi::Viber.new(
26
27
  image_url: null,
27
28
  button_url: null,
28
29
  button_text: null,
29
- channel: null
30
+ channel: null,
31
+ video: null
30
32
  )
31
33
  ```
32
34
 
@@ -0,0 +1,24 @@
1
+ # MessenteApi::ViberVideo
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **url** | **String** | URL pointing to the video resource. | |
8
+ | **thumbnail** | **String** | URL pointing to the video thumbnail resource. | |
9
+ | **file_size** | **Integer** | Size of the video file in bytes. Cannot be larger than 200MB. | |
10
+ | **duration** | **Integer** | Duration of the video in seconds. Cannot be longer than 600 seconds. | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'messente_api'
16
+
17
+ instance = MessenteApi::ViberVideo.new(
18
+ url: null,
19
+ thumbnail: null,
20
+ file_size: null,
21
+ duration: null
22
+ )
23
+ ```
24
+
@@ -40,6 +40,8 @@ module MessenteApi
40
40
  # The channel used to deliver the message
41
41
  attr_accessor :channel
42
42
 
43
+ attr_accessor :video
44
+
43
45
  class EnumAttributeValidator
44
46
  attr_reader :datatype
45
47
  attr_reader :allowable_values
@@ -72,7 +74,8 @@ module MessenteApi
72
74
  :'image_url' => :'image_url',
73
75
  :'button_url' => :'button_url',
74
76
  :'button_text' => :'button_text',
75
- :'channel' => :'channel'
77
+ :'channel' => :'channel',
78
+ :'video' => :'video'
76
79
  }
77
80
  end
78
81
 
@@ -91,7 +94,8 @@ module MessenteApi
91
94
  :'image_url' => :'String',
92
95
  :'button_url' => :'String',
93
96
  :'button_text' => :'String',
94
- :'channel' => :'String'
97
+ :'channel' => :'String',
98
+ :'video' => :'ViberVideo'
95
99
  }
96
100
  end
97
101
 
@@ -149,6 +153,10 @@ module MessenteApi
149
153
  else
150
154
  self.channel = 'viber'
151
155
  end
156
+
157
+ if attributes.key?(:'video')
158
+ self.video = attributes[:'video']
159
+ end
152
160
  end
153
161
 
154
162
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -190,7 +198,8 @@ module MessenteApi
190
198
  image_url == o.image_url &&
191
199
  button_url == o.button_url &&
192
200
  button_text == o.button_text &&
193
- channel == o.channel
201
+ channel == o.channel &&
202
+ video == o.video
194
203
  end
195
204
 
196
205
  # @see the `==` method
@@ -202,7 +211,7 @@ module MessenteApi
202
211
  # Calculates hash code according to all attributes.
203
212
  # @return [Integer] Hash code
204
213
  def hash
205
- [sender, validity, ttl, text, image_url, button_url, button_text, channel].hash
214
+ [sender, validity, ttl, text, image_url, button_url, button_text, channel, video].hash
206
215
  end
207
216
 
208
217
  # Builds the object from hash
@@ -0,0 +1,274 @@
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.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MessenteApi
17
+ # Viber video object
18
+ class ViberVideo
19
+ # URL pointing to the video resource.
20
+ attr_accessor :url
21
+
22
+ # URL pointing to the video thumbnail resource.
23
+ attr_accessor :thumbnail
24
+
25
+ # Size of the video file in bytes. Cannot be larger than 200MB.
26
+ attr_accessor :file_size
27
+
28
+ # Duration of the video in seconds. Cannot be longer than 600 seconds.
29
+ attr_accessor :duration
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'url' => :'url',
35
+ :'thumbnail' => :'thumbnail',
36
+ :'file_size' => :'file_size',
37
+ :'duration' => :'duration'
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
+ :'url' => :'String',
50
+ :'thumbnail' => :'String',
51
+ :'file_size' => :'Integer',
52
+ :'duration' => :'Integer'
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::ViberVideo` 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::ViberVideo`. 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?(:'url')
78
+ self.url = attributes[:'url']
79
+ else
80
+ self.url = nil
81
+ end
82
+
83
+ if attributes.key?(:'thumbnail')
84
+ self.thumbnail = attributes[:'thumbnail']
85
+ else
86
+ self.thumbnail = nil
87
+ end
88
+
89
+ if attributes.key?(:'file_size')
90
+ self.file_size = attributes[:'file_size']
91
+ else
92
+ self.file_size = nil
93
+ end
94
+
95
+ if attributes.key?(:'duration')
96
+ self.duration = attributes[:'duration']
97
+ else
98
+ self.duration = 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 @url.nil?
108
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
109
+ end
110
+
111
+ if @thumbnail.nil?
112
+ invalid_properties.push('invalid value for "thumbnail", thumbnail cannot be nil.')
113
+ end
114
+
115
+ if @file_size.nil?
116
+ invalid_properties.push('invalid value for "file_size", file_size cannot be nil.')
117
+ end
118
+
119
+ if @duration.nil?
120
+ invalid_properties.push('invalid value for "duration", duration cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @url.nil?
131
+ return false if @thumbnail.nil?
132
+ return false if @file_size.nil?
133
+ return false if @duration.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ url == o.url &&
143
+ thumbnail == o.thumbnail &&
144
+ file_size == o.file_size &&
145
+ duration == o.duration
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [url, thumbnail, file_size, duration].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def self._deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = MessenteApi.const_get(type)
222
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -11,5 +11,5 @@ Generator version: 7.6.0
11
11
  =end
12
12
 
13
13
  module MessenteApi
14
- VERSION = '2.1.0'
14
+ VERSION = '2.2.0'
15
15
  end
data/lib/messente_api.rb CHANGED
@@ -67,6 +67,7 @@ require 'messente_api/models/sync_number_lookup_success'
67
67
  require 'messente_api/models/telegram'
68
68
  require 'messente_api/models/text_store'
69
69
  require 'messente_api/models/viber'
70
+ require 'messente_api/models/viber_video'
70
71
  require 'messente_api/models/whats_app'
71
72
  require 'messente_api/models/whats_app_component'
72
73
  require 'messente_api/models/whats_app_currency'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messente_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Messente
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-12 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -123,6 +123,7 @@ files:
123
123
  - docs/Telegram.md
124
124
  - docs/TextStore.md
125
125
  - docs/Viber.md
126
+ - docs/ViberVideo.md
126
127
  - docs/WhatsApp.md
127
128
  - docs/WhatsAppComponent.md
128
129
  - docs/WhatsAppCurrency.md
@@ -194,6 +195,7 @@ files:
194
195
  - lib/messente_api/models/telegram.rb
195
196
  - lib/messente_api/models/text_store.rb
196
197
  - lib/messente_api/models/viber.rb
198
+ - lib/messente_api/models/viber_video.rb
197
199
  - lib/messente_api/models/whats_app.rb
198
200
  - lib/messente_api/models/whats_app_component.rb
199
201
  - lib/messente_api/models/whats_app_currency.rb
@@ -224,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
226
  - !ruby/object:Gem::Version
225
227
  version: '0'
226
228
  requirements: []
227
- rubygems_version: 3.3.25
229
+ rubygems_version: 3.4.20
228
230
  signing_key:
229
231
  specification_version: 4
230
232
  summary: Ruby library for Messente API