late-sdk 0.0.74 → 0.0.76

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/docs/BroadcastsApi.md +14 -12
  4. data/docs/GetWhatsAppBroadcasts200ResponseBroadcastsInner.md +2 -0
  5. data/docs/ListBroadcasts200Response.md +22 -0
  6. data/docs/ListBroadcasts200ResponseBroadcastsInner.md +50 -0
  7. data/docs/ListSequences200Response.md +22 -0
  8. data/docs/ListSequences200ResponseSequencesInner.md +46 -0
  9. data/docs/SendBroadcast200Response.md +26 -0
  10. data/docs/SequencesApi.md +7 -6
  11. data/lib/late-sdk/api/broadcasts_api.rb +10 -10
  12. data/lib/late-sdk/api/sequences_api.rb +5 -5
  13. data/lib/late-sdk/models/get_whats_app_broadcasts200_response_broadcasts_inner.rb +11 -1
  14. data/lib/late-sdk/models/list_broadcasts200_response.rb +167 -0
  15. data/lib/late-sdk/models/list_broadcasts200_response_broadcasts_inner.rb +327 -0
  16. data/lib/late-sdk/models/list_sequences200_response.rb +167 -0
  17. data/lib/late-sdk/models/list_sequences200_response_sequences_inner.rb +309 -0
  18. data/lib/late-sdk/models/send_broadcast200_response.rb +221 -0
  19. data/lib/late-sdk/version.rb +1 -1
  20. data/lib/late-sdk.rb +5 -0
  21. data/openapi.yaml +85 -3
  22. data/spec/api/broadcasts_api_spec.rb +2 -2
  23. data/spec/api/sequences_api_spec.rb +1 -1
  24. data/spec/models/get_whats_app_broadcasts200_response_broadcasts_inner_spec.rb +6 -0
  25. data/spec/models/list_broadcasts200_response_broadcasts_inner_spec.rb +136 -0
  26. data/spec/models/list_broadcasts200_response_spec.rb +48 -0
  27. data/spec/models/list_sequences200_response_sequences_inner_spec.rb +124 -0
  28. data/spec/models/list_sequences200_response_spec.rb +48 -0
  29. data/spec/models/send_broadcast200_response_spec.rb +64 -0
  30. data/zernio-sdk-0.0.76.gem +0 -0
  31. metadata +22 -2
  32. data/zernio-sdk-0.0.74.gem +0 -0
@@ -0,0 +1,327 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class ListBroadcasts200ResponseBroadcastsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :platform
25
+
26
+ attr_accessor :account_id
27
+
28
+ # Display name of the sending account
29
+ attr_accessor :account_name
30
+
31
+ attr_accessor :status
32
+
33
+ # Template name or message text snippet
34
+ attr_accessor :message_preview
35
+
36
+ attr_accessor :scheduled_at
37
+
38
+ attr_accessor :started_at
39
+
40
+ attr_accessor :completed_at
41
+
42
+ attr_accessor :recipient_count
43
+
44
+ attr_accessor :sent_count
45
+
46
+ attr_accessor :delivered_count
47
+
48
+ attr_accessor :read_count
49
+
50
+ attr_accessor :failed_count
51
+
52
+ attr_accessor :created_at
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'id' => :'id',
80
+ :'name' => :'name',
81
+ :'description' => :'description',
82
+ :'platform' => :'platform',
83
+ :'account_id' => :'accountId',
84
+ :'account_name' => :'accountName',
85
+ :'status' => :'status',
86
+ :'message_preview' => :'messagePreview',
87
+ :'scheduled_at' => :'scheduledAt',
88
+ :'started_at' => :'startedAt',
89
+ :'completed_at' => :'completedAt',
90
+ :'recipient_count' => :'recipientCount',
91
+ :'sent_count' => :'sentCount',
92
+ :'delivered_count' => :'deliveredCount',
93
+ :'read_count' => :'readCount',
94
+ :'failed_count' => :'failedCount',
95
+ :'created_at' => :'createdAt'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'id' => :'String',
113
+ :'name' => :'String',
114
+ :'description' => :'String',
115
+ :'platform' => :'String',
116
+ :'account_id' => :'String',
117
+ :'account_name' => :'String',
118
+ :'status' => :'String',
119
+ :'message_preview' => :'String',
120
+ :'scheduled_at' => :'Time',
121
+ :'started_at' => :'Time',
122
+ :'completed_at' => :'Time',
123
+ :'recipient_count' => :'Integer',
124
+ :'sent_count' => :'Integer',
125
+ :'delivered_count' => :'Integer',
126
+ :'read_count' => :'Integer',
127
+ :'failed_count' => :'Integer',
128
+ :'created_at' => :'Time'
129
+ }
130
+ end
131
+
132
+ # List of attributes with nullable: true
133
+ def self.openapi_nullable
134
+ Set.new([
135
+ ])
136
+ end
137
+
138
+ # Initializes the object
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ def initialize(attributes = {})
141
+ if (!attributes.is_a?(Hash))
142
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListBroadcasts200ResponseBroadcastsInner` initialize method"
143
+ end
144
+
145
+ # check to see if the attribute exists and convert string to symbol for hash key
146
+ acceptable_attribute_map = self.class.acceptable_attribute_map
147
+ attributes = attributes.each_with_object({}) { |(k, v), h|
148
+ if (!acceptable_attribute_map.key?(k.to_sym))
149
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListBroadcasts200ResponseBroadcastsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
150
+ end
151
+ h[k.to_sym] = v
152
+ }
153
+
154
+ if attributes.key?(:'id')
155
+ self.id = attributes[:'id']
156
+ end
157
+
158
+ if attributes.key?(:'name')
159
+ self.name = attributes[:'name']
160
+ end
161
+
162
+ if attributes.key?(:'description')
163
+ self.description = attributes[:'description']
164
+ end
165
+
166
+ if attributes.key?(:'platform')
167
+ self.platform = attributes[:'platform']
168
+ end
169
+
170
+ if attributes.key?(:'account_id')
171
+ self.account_id = attributes[:'account_id']
172
+ end
173
+
174
+ if attributes.key?(:'account_name')
175
+ self.account_name = attributes[:'account_name']
176
+ end
177
+
178
+ if attributes.key?(:'status')
179
+ self.status = attributes[:'status']
180
+ end
181
+
182
+ if attributes.key?(:'message_preview')
183
+ self.message_preview = attributes[:'message_preview']
184
+ end
185
+
186
+ if attributes.key?(:'scheduled_at')
187
+ self.scheduled_at = attributes[:'scheduled_at']
188
+ end
189
+
190
+ if attributes.key?(:'started_at')
191
+ self.started_at = attributes[:'started_at']
192
+ end
193
+
194
+ if attributes.key?(:'completed_at')
195
+ self.completed_at = attributes[:'completed_at']
196
+ end
197
+
198
+ if attributes.key?(:'recipient_count')
199
+ self.recipient_count = attributes[:'recipient_count']
200
+ end
201
+
202
+ if attributes.key?(:'sent_count')
203
+ self.sent_count = attributes[:'sent_count']
204
+ end
205
+
206
+ if attributes.key?(:'delivered_count')
207
+ self.delivered_count = attributes[:'delivered_count']
208
+ end
209
+
210
+ if attributes.key?(:'read_count')
211
+ self.read_count = attributes[:'read_count']
212
+ end
213
+
214
+ if attributes.key?(:'failed_count')
215
+ self.failed_count = attributes[:'failed_count']
216
+ end
217
+
218
+ if attributes.key?(:'created_at')
219
+ self.created_at = attributes[:'created_at']
220
+ end
221
+ end
222
+
223
+ # Show invalid properties with the reasons. Usually used together with valid?
224
+ # @return Array for valid properties with the reasons
225
+ def list_invalid_properties
226
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
227
+ invalid_properties = Array.new
228
+ invalid_properties
229
+ end
230
+
231
+ # Check to see if the all the properties in the model are valid
232
+ # @return true if the model is valid
233
+ def valid?
234
+ warn '[DEPRECATED] the `valid?` method is obsolete'
235
+ status_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "completed", "failed", "cancelled"])
236
+ return false unless status_validator.valid?(@status)
237
+ true
238
+ end
239
+
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] status Object to be assigned
242
+ def status=(status)
243
+ validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "completed", "failed", "cancelled"])
244
+ unless validator.valid?(status)
245
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
246
+ end
247
+ @status = status
248
+ end
249
+
250
+ # Checks equality by comparing each attribute.
251
+ # @param [Object] Object to be compared
252
+ def ==(o)
253
+ return true if self.equal?(o)
254
+ self.class == o.class &&
255
+ id == o.id &&
256
+ name == o.name &&
257
+ description == o.description &&
258
+ platform == o.platform &&
259
+ account_id == o.account_id &&
260
+ account_name == o.account_name &&
261
+ status == o.status &&
262
+ message_preview == o.message_preview &&
263
+ scheduled_at == o.scheduled_at &&
264
+ started_at == o.started_at &&
265
+ completed_at == o.completed_at &&
266
+ recipient_count == o.recipient_count &&
267
+ sent_count == o.sent_count &&
268
+ delivered_count == o.delivered_count &&
269
+ read_count == o.read_count &&
270
+ failed_count == o.failed_count &&
271
+ created_at == o.created_at
272
+ end
273
+
274
+ # @see the `==` method
275
+ # @param [Object] Object to be compared
276
+ def eql?(o)
277
+ self == o
278
+ end
279
+
280
+ # Calculates hash code according to all attributes.
281
+ # @return [Integer] Hash code
282
+ def hash
283
+ [id, name, description, platform, account_id, account_name, status, message_preview, scheduled_at, started_at, completed_at, recipient_count, sent_count, delivered_count, read_count, failed_count, created_at].hash
284
+ end
285
+
286
+ # Builds the object from hash
287
+ # @param [Hash] attributes Model attributes in the form of hash
288
+ # @return [Object] Returns the model itself
289
+ def self.build_from_hash(attributes)
290
+ return nil unless attributes.is_a?(Hash)
291
+ attributes = attributes.transform_keys(&:to_sym)
292
+ transformed_hash = {}
293
+ openapi_types.each_pair do |key, type|
294
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
295
+ transformed_hash["#{key}"] = nil
296
+ elsif type =~ /\AArray<(.*)>/i
297
+ # check to ensure the input is an array given that the attribute
298
+ # is documented as an array but the input is not
299
+ if attributes[attribute_map[key]].is_a?(Array)
300
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
301
+ end
302
+ elsif !attributes[attribute_map[key]].nil?
303
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
304
+ end
305
+ end
306
+ new(transformed_hash)
307
+ end
308
+
309
+ # Returns the object in the form of hash
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_hash
312
+ hash = {}
313
+ self.class.attribute_map.each_pair do |attr, param|
314
+ value = self.send(attr)
315
+ if value.nil?
316
+ is_nullable = self.class.openapi_nullable.include?(attr)
317
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
318
+ end
319
+
320
+ hash[param] = _to_hash(value)
321
+ end
322
+ hash
323
+ end
324
+
325
+ end
326
+
327
+ end
@@ -0,0 +1,167 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class ListSequences200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :sequences
21
+
22
+ attr_accessor :pagination
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'success' => :'success',
28
+ :'sequences' => :'sequences',
29
+ :'pagination' => :'pagination'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'success' => :'Boolean',
47
+ :'sequences' => :'Array<ListSequences200ResponseSequencesInner>',
48
+ :'pagination' => :'GetWhatsAppContacts200ResponsePagination'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
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 `Late::ListSequences200Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListSequences200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'success')
75
+ self.success = attributes[:'success']
76
+ end
77
+
78
+ if attributes.key?(:'sequences')
79
+ if (value = attributes[:'sequences']).is_a?(Array)
80
+ self.sequences = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'pagination')
85
+ self.pagination = attributes[:'pagination']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ success == o.success &&
110
+ sequences == o.sequences &&
111
+ pagination == o.pagination
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [success, sequences, pagination].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ end
166
+
167
+ end