late-sdk 0.0.92 → 0.0.94

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. data/docs/CreateWhatsAppTemplateRequest.md +1 -1
  4. data/docs/UpdateWhatsAppTemplateRequest.md +1 -1
  5. data/docs/WhatsAppApi.md +1 -1
  6. data/docs/WhatsAppBodyComponent.md +24 -0
  7. data/docs/WhatsAppBodyComponentExample.md +18 -0
  8. data/docs/WhatsAppButtonsComponent.md +20 -0
  9. data/docs/WhatsAppFooterComponent.md +22 -0
  10. data/docs/WhatsAppHeaderComponent.md +24 -0
  11. data/docs/WhatsAppHeaderComponentExample.md +20 -0
  12. data/docs/WhatsAppTemplateButton.md +44 -0
  13. data/docs/WhatsAppTemplateComponent.md +53 -0
  14. data/lib/late-sdk/models/create_whats_app_template_request.rb +21 -2
  15. data/lib/late-sdk/models/update_whats_app_template_request.rb +10 -1
  16. data/lib/late-sdk/models/whats_app_body_component.rb +234 -0
  17. data/lib/late-sdk/models/whats_app_body_component_example.rb +150 -0
  18. data/lib/late-sdk/models/whats_app_buttons_component.rb +225 -0
  19. data/lib/late-sdk/models/whats_app_footer_component.rb +227 -0
  20. data/lib/late-sdk/models/whats_app_header_component.rb +235 -0
  21. data/lib/late-sdk/models/whats_app_header_component_example.rb +190 -0
  22. data/lib/late-sdk/models/whats_app_template_button.rb +340 -0
  23. data/lib/late-sdk/models/whats_app_template_component.rb +106 -0
  24. data/lib/late-sdk/version.rb +1 -1
  25. data/lib/late-sdk.rb +8 -0
  26. data/openapi.yaml +147 -5
  27. data/spec/models/whats_app_body_component_example_spec.rb +36 -0
  28. data/spec/models/whats_app_body_component_spec.rb +58 -0
  29. data/spec/models/whats_app_buttons_component_spec.rb +46 -0
  30. data/spec/models/whats_app_footer_component_spec.rb +52 -0
  31. data/spec/models/whats_app_header_component_example_spec.rb +42 -0
  32. data/spec/models/whats_app_header_component_spec.rb +62 -0
  33. data/spec/models/whats_app_template_button_spec.rb +122 -0
  34. data/spec/models/whats_app_template_component_spec.rb +32 -0
  35. data/zernio-sdk-0.0.94.gem +0 -0
  36. metadata +34 -2
  37. data/zernio-sdk-0.0.92.gem +0 -0
@@ -0,0 +1,340 @@
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 WhatsAppTemplateButton < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ attr_accessor :text
21
+
22
+ # Required when type is URL
23
+ attr_accessor :url
24
+
25
+ # Example values for URL suffix variables
26
+ attr_accessor :example
27
+
28
+ # Required when type is PHONE_NUMBER
29
+ attr_accessor :phone_number
30
+
31
+ # Required when type is OTP
32
+ attr_accessor :otp_type
33
+
34
+ attr_accessor :autofill_text
35
+
36
+ attr_accessor :package_name
37
+
38
+ attr_accessor :signature_hash
39
+
40
+ attr_accessor :flow_id
41
+
42
+ attr_accessor :flow_name
43
+
44
+ attr_accessor :flow_json
45
+
46
+ attr_accessor :flow_action
47
+
48
+ attr_accessor :navigate_screen
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'type' => :'type',
76
+ :'text' => :'text',
77
+ :'url' => :'url',
78
+ :'example' => :'example',
79
+ :'phone_number' => :'phone_number',
80
+ :'otp_type' => :'otp_type',
81
+ :'autofill_text' => :'autofill_text',
82
+ :'package_name' => :'package_name',
83
+ :'signature_hash' => :'signature_hash',
84
+ :'flow_id' => :'flow_id',
85
+ :'flow_name' => :'flow_name',
86
+ :'flow_json' => :'flow_json',
87
+ :'flow_action' => :'flow_action',
88
+ :'navigate_screen' => :'navigate_screen'
89
+ }
90
+ end
91
+
92
+ # Returns attribute mapping this model knows about
93
+ def self.acceptable_attribute_map
94
+ attribute_map
95
+ end
96
+
97
+ # Returns all the JSON keys this model knows about
98
+ def self.acceptable_attributes
99
+ acceptable_attribute_map.values
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.openapi_types
104
+ {
105
+ :'type' => :'String',
106
+ :'text' => :'String',
107
+ :'url' => :'String',
108
+ :'example' => :'Array<String>',
109
+ :'phone_number' => :'String',
110
+ :'otp_type' => :'String',
111
+ :'autofill_text' => :'String',
112
+ :'package_name' => :'String',
113
+ :'signature_hash' => :'String',
114
+ :'flow_id' => :'String',
115
+ :'flow_name' => :'String',
116
+ :'flow_json' => :'String',
117
+ :'flow_action' => :'String',
118
+ :'navigate_screen' => :'String'
119
+ }
120
+ end
121
+
122
+ # List of attributes with nullable: true
123
+ def self.openapi_nullable
124
+ Set.new([
125
+ ])
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppTemplateButton` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppTemplateButton`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'type')
145
+ self.type = attributes[:'type']
146
+ else
147
+ self.type = nil
148
+ end
149
+
150
+ if attributes.key?(:'text')
151
+ self.text = attributes[:'text']
152
+ else
153
+ self.text = nil
154
+ end
155
+
156
+ if attributes.key?(:'url')
157
+ self.url = attributes[:'url']
158
+ end
159
+
160
+ if attributes.key?(:'example')
161
+ if (value = attributes[:'example']).is_a?(Array)
162
+ self.example = value
163
+ end
164
+ end
165
+
166
+ if attributes.key?(:'phone_number')
167
+ self.phone_number = attributes[:'phone_number']
168
+ end
169
+
170
+ if attributes.key?(:'otp_type')
171
+ self.otp_type = attributes[:'otp_type']
172
+ end
173
+
174
+ if attributes.key?(:'autofill_text')
175
+ self.autofill_text = attributes[:'autofill_text']
176
+ end
177
+
178
+ if attributes.key?(:'package_name')
179
+ self.package_name = attributes[:'package_name']
180
+ end
181
+
182
+ if attributes.key?(:'signature_hash')
183
+ self.signature_hash = attributes[:'signature_hash']
184
+ end
185
+
186
+ if attributes.key?(:'flow_id')
187
+ self.flow_id = attributes[:'flow_id']
188
+ end
189
+
190
+ if attributes.key?(:'flow_name')
191
+ self.flow_name = attributes[:'flow_name']
192
+ end
193
+
194
+ if attributes.key?(:'flow_json')
195
+ self.flow_json = attributes[:'flow_json']
196
+ end
197
+
198
+ if attributes.key?(:'flow_action')
199
+ self.flow_action = attributes[:'flow_action']
200
+ end
201
+
202
+ if attributes.key?(:'navigate_screen')
203
+ self.navigate_screen = attributes[:'navigate_screen']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
211
+ invalid_properties = Array.new
212
+ if @type.nil?
213
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
214
+ end
215
+
216
+ if @text.nil?
217
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
218
+ end
219
+
220
+ invalid_properties
221
+ end
222
+
223
+ # Check to see if the all the properties in the model are valid
224
+ # @return true if the model is valid
225
+ def valid?
226
+ warn '[DEPRECATED] the `valid?` method is obsolete'
227
+ return false if @type.nil?
228
+ type_validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER", "OTP", "FLOW", "MPM", "CATALOG"])
229
+ return false unless type_validator.valid?(@type)
230
+ return false if @text.nil?
231
+ otp_type_validator = EnumAttributeValidator.new('String', ["COPY_CODE", "ONE_TAP", "ZERO_TAP"])
232
+ return false unless otp_type_validator.valid?(@otp_type)
233
+ true
234
+ end
235
+
236
+ # Custom attribute writer method checking allowed values (enum).
237
+ # @param [Object] type Object to be assigned
238
+ def type=(type)
239
+ validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER", "OTP", "FLOW", "MPM", "CATALOG"])
240
+ unless validator.valid?(type)
241
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
242
+ end
243
+ @type = type
244
+ end
245
+
246
+ # Custom attribute writer method with validation
247
+ # @param [Object] text Value to be assigned
248
+ def text=(text)
249
+ if text.nil?
250
+ fail ArgumentError, 'text cannot be nil'
251
+ end
252
+
253
+ @text = text
254
+ end
255
+
256
+ # Custom attribute writer method checking allowed values (enum).
257
+ # @param [Object] otp_type Object to be assigned
258
+ def otp_type=(otp_type)
259
+ validator = EnumAttributeValidator.new('String', ["COPY_CODE", "ONE_TAP", "ZERO_TAP"])
260
+ unless validator.valid?(otp_type)
261
+ fail ArgumentError, "invalid value for \"otp_type\", must be one of #{validator.allowable_values}."
262
+ end
263
+ @otp_type = otp_type
264
+ end
265
+
266
+ # Checks equality by comparing each attribute.
267
+ # @param [Object] Object to be compared
268
+ def ==(o)
269
+ return true if self.equal?(o)
270
+ self.class == o.class &&
271
+ type == o.type &&
272
+ text == o.text &&
273
+ url == o.url &&
274
+ example == o.example &&
275
+ phone_number == o.phone_number &&
276
+ otp_type == o.otp_type &&
277
+ autofill_text == o.autofill_text &&
278
+ package_name == o.package_name &&
279
+ signature_hash == o.signature_hash &&
280
+ flow_id == o.flow_id &&
281
+ flow_name == o.flow_name &&
282
+ flow_json == o.flow_json &&
283
+ flow_action == o.flow_action &&
284
+ navigate_screen == o.navigate_screen
285
+ end
286
+
287
+ # @see the `==` method
288
+ # @param [Object] Object to be compared
289
+ def eql?(o)
290
+ self == o
291
+ end
292
+
293
+ # Calculates hash code according to all attributes.
294
+ # @return [Integer] Hash code
295
+ def hash
296
+ [type, text, url, example, phone_number, otp_type, autofill_text, package_name, signature_hash, flow_id, flow_name, flow_json, flow_action, navigate_screen].hash
297
+ end
298
+
299
+ # Builds the object from hash
300
+ # @param [Hash] attributes Model attributes in the form of hash
301
+ # @return [Object] Returns the model itself
302
+ def self.build_from_hash(attributes)
303
+ return nil unless attributes.is_a?(Hash)
304
+ attributes = attributes.transform_keys(&:to_sym)
305
+ transformed_hash = {}
306
+ openapi_types.each_pair do |key, type|
307
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
308
+ transformed_hash["#{key}"] = nil
309
+ elsif type =~ /\AArray<(.*)>/i
310
+ # check to ensure the input is an array given that the attribute
311
+ # is documented as an array but the input is not
312
+ if attributes[attribute_map[key]].is_a?(Array)
313
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
314
+ end
315
+ elsif !attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
317
+ end
318
+ end
319
+ new(transformed_hash)
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ end
339
+
340
+ end
@@ -0,0 +1,106 @@
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
+ module WhatsAppTemplateComponent
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'WhatsAppBodyComponent',
23
+ :'WhatsAppButtonsComponent',
24
+ :'WhatsAppFooterComponent',
25
+ :'WhatsAppHeaderComponent'
26
+ ]
27
+ end
28
+
29
+ # Builds the object
30
+ # @param [Mixed] Data to be matched against the list of oneOf items
31
+ # @return [Object] Returns the model or the data itself
32
+ def build(data)
33
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
34
+ # Note:
35
+ # - We do not attempt to check whether exactly one item matches.
36
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
37
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
38
+ # - TODO: scalar values are de facto behaving as if they were nullable.
39
+ # - TODO: logging when debugging is set.
40
+ openapi_one_of.each do |klass|
41
+ begin
42
+ next if klass == :AnyType # "nullable: true"
43
+ return find_and_cast_into_type(klass, data)
44
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
45
+ end
46
+ end
47
+
48
+ openapi_one_of.include?(:AnyType) ? data : nil
49
+ end
50
+
51
+ private
52
+
53
+ SchemaMismatchError = Class.new(StandardError)
54
+
55
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
56
+ def find_and_cast_into_type(klass, data)
57
+ return if data.nil?
58
+
59
+ case klass.to_s
60
+ when 'Boolean'
61
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
62
+ when 'Float'
63
+ return data if data.instance_of?(Float)
64
+ when 'Integer'
65
+ return data if data.instance_of?(Integer)
66
+ when 'Time'
67
+ return Time.parse(data)
68
+ when 'Date'
69
+ return Date.iso8601(data)
70
+ when 'String'
71
+ return data if data.instance_of?(String)
72
+ when 'Object' # "type: object"
73
+ return data if data.instance_of?(Hash)
74
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
75
+ if data.instance_of?(Array)
76
+ sub_type = Regexp.last_match[:sub_type]
77
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
78
+ end
79
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
80
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
81
+ sub_type = Regexp.last_match[:sub_type]
82
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
83
+ end
84
+ else # model
85
+ const = Late.const_get(klass)
86
+ if const
87
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
88
+ model = const.build(data)
89
+ return model if model
90
+ else
91
+ # raise if data contains keys that are not known to the model
92
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
93
+ model = const.build_from_hash(data)
94
+ return model if model
95
+ end
96
+ end
97
+ end
98
+
99
+ raise # if no match by now, raise
100
+ rescue
101
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
102
+ end
103
+ end
104
+ end
105
+
106
+ end
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Late
14
- VERSION = '0.0.92'
14
+ VERSION = '0.0.94'
15
15
  end
data/lib/late-sdk.rb CHANGED
@@ -690,6 +690,14 @@ require 'late-sdk/models/webhook_payload_post'
690
690
  require 'late-sdk/models/webhook_payload_post_post'
691
691
  require 'late-sdk/models/webhook_payload_post_post_platforms_inner'
692
692
  require 'late-sdk/models/webhook_payload_test'
693
+ require 'late-sdk/models/whats_app_body_component'
694
+ require 'late-sdk/models/whats_app_body_component_example'
695
+ require 'late-sdk/models/whats_app_buttons_component'
696
+ require 'late-sdk/models/whats_app_footer_component'
697
+ require 'late-sdk/models/whats_app_header_component'
698
+ require 'late-sdk/models/whats_app_header_component_example'
699
+ require 'late-sdk/models/whats_app_template_button'
700
+ require 'late-sdk/models/whats_app_template_component'
693
701
  require 'late-sdk/models/you_tube_daily_views_response'
694
702
  require 'late-sdk/models/you_tube_daily_views_response_daily_views_inner'
695
703
  require 'late-sdk/models/you_tube_daily_views_response_date_range'
data/openapi.yaml CHANGED
@@ -309,6 +309,128 @@ components:
309
309
  details:
310
310
  type: object
311
311
  additionalProperties: true
312
+ WhatsAppTemplateButton:
313
+ type: object
314
+ required: [type, text]
315
+ properties:
316
+ type:
317
+ type: string
318
+ enum: [QUICK_REPLY, URL, PHONE_NUMBER, OTP, FLOW, MPM, CATALOG]
319
+ text:
320
+ type: string
321
+ url:
322
+ type: string
323
+ format: uri
324
+ description: Required when type is URL
325
+ example:
326
+ type: array
327
+ items: { type: string }
328
+ description: Example values for URL suffix variables
329
+ phone_number:
330
+ type: string
331
+ description: Required when type is PHONE_NUMBER
332
+ otp_type:
333
+ type: string
334
+ enum: [COPY_CODE, ONE_TAP, ZERO_TAP]
335
+ description: Required when type is OTP
336
+ autofill_text:
337
+ type: string
338
+ package_name:
339
+ type: string
340
+ signature_hash:
341
+ type: string
342
+ flow_id:
343
+ type: string
344
+ flow_name:
345
+ type: string
346
+ flow_json:
347
+ type: string
348
+ flow_action:
349
+ type: string
350
+ navigate_screen:
351
+ type: string
352
+ WhatsAppTemplateComponent:
353
+ oneOf:
354
+ - $ref: '#/components/schemas/WhatsAppHeaderComponent'
355
+ - $ref: '#/components/schemas/WhatsAppBodyComponent'
356
+ - $ref: '#/components/schemas/WhatsAppFooterComponent'
357
+ - $ref: '#/components/schemas/WhatsAppButtonsComponent'
358
+ WhatsAppHeaderComponent:
359
+ type: object
360
+ required: [type, format]
361
+ properties:
362
+ type:
363
+ type: string
364
+ enum: [HEADER]
365
+ format:
366
+ type: string
367
+ enum: [TEXT, IMAGE, VIDEO, GIF, DOCUMENT, LOCATION]
368
+ text:
369
+ type: string
370
+ description: Header text (may include {{1}} variable). Used when format is TEXT.
371
+ example:
372
+ type: object
373
+ properties:
374
+ header_text:
375
+ type: array
376
+ items: { type: string }
377
+ description: Sample values for header text variables
378
+ header_handle:
379
+ type: array
380
+ minItems: 1
381
+ maxItems: 1
382
+ items:
383
+ type: string
384
+ format: uri
385
+ description: When the header format is a media type (IMAGE, VIDEO, GIF, DOCUMENT), provide a public URL here. Zernio will download and upload it to WhatsApp on your behalf, replacing it with the internal file handle before creating the template.
386
+ WhatsAppBodyComponent:
387
+ type: object
388
+ required: [type, text]
389
+ properties:
390
+ type:
391
+ type: string
392
+ enum: [BODY]
393
+ text:
394
+ type: string
395
+ description: Body text with optional {{n}} variables
396
+ add_security_recommendation:
397
+ type: boolean
398
+ description: Add security recommendation text (authentication templates only)
399
+ example:
400
+ type: object
401
+ properties:
402
+ body_text:
403
+ type: array
404
+ items:
405
+ type: array
406
+ items: { type: string }
407
+ description: Sample values for body variables (array of arrays)
408
+ WhatsAppFooterComponent:
409
+ type: object
410
+ required: [type]
411
+ properties:
412
+ type:
413
+ type: string
414
+ enum: [FOOTER]
415
+ text:
416
+ type: string
417
+ description: Static footer text
418
+ code_expiration_minutes:
419
+ type: integer
420
+ minimum: 1
421
+ description: OTP code expiry in minutes (authentication templates only)
422
+ WhatsAppButtonsComponent:
423
+ type: object
424
+ required: [type, buttons]
425
+ properties:
426
+ type:
427
+ type: string
428
+ enum: [BUTTONS]
429
+ buttons:
430
+ type: array
431
+ minItems: 1
432
+ items:
433
+ $ref: '#/components/schemas/WhatsAppTemplateButton'
312
434
  FoodMenuLabel:
313
435
  type: object
314
436
  required: [displayName]
@@ -14032,9 +14154,10 @@ paths:
14032
14154
  description: Template language code (e.g., en_US)
14033
14155
  components:
14034
14156
  type: array
14035
- description: "Template components (header, body, footer, buttons). Required for custom templates, omit when using library_template_name."
14157
+ description: "Template components (HEADER, BODY, FOOTER, BUTTONS). Required for custom templates, omit when using library_template_name."
14158
+ minItems: 1
14036
14159
  items:
14037
- type: object
14160
+ $ref: '#/components/schemas/WhatsAppTemplateComponent'
14038
14161
  library_template_name:
14039
14162
  type: string
14040
14163
  description: |
@@ -14073,8 +14196,20 @@ paths:
14073
14196
  category: "UTILITY"
14074
14197
  language: "en_US"
14075
14198
  components:
14076
- - type: "body"
14199
+ - type: "HEADER"
14200
+ format: "IMAGE"
14201
+ example:
14202
+ header_handle: ["https://example.com/header.jpg"]
14203
+ - type: "BODY"
14077
14204
  text: "Your order {{1}} has been confirmed. Expected delivery: {{2}}"
14205
+ example:
14206
+ body_text: [["ORD-12345", "March 31"]]
14207
+ - type: "FOOTER"
14208
+ text: "Thank you for your purchase"
14209
+ - type: "BUTTONS"
14210
+ buttons:
14211
+ - type: "QUICK_REPLY"
14212
+ text: "Track Order"
14078
14213
  library:
14079
14214
  summary: Library template (pre-approved, no review)
14080
14215
  value:
@@ -14186,13 +14321,20 @@ paths:
14186
14321
  components:
14187
14322
  type: array
14188
14323
  description: Updated template components
14324
+ minItems: 1
14189
14325
  items:
14190
- type: object
14326
+ $ref: '#/components/schemas/WhatsAppTemplateComponent'
14191
14327
  example:
14192
14328
  accountId: "507f1f77bcf86cd799439011"
14193
14329
  components:
14194
- - type: "body"
14330
+ - type: "BODY"
14195
14331
  text: "Updated: Your order {{1}} is confirmed. Delivery by {{2}}"
14332
+ example:
14333
+ body_text: [["ORD-12345", "April 1"]]
14334
+ - type: "BUTTONS"
14335
+ buttons:
14336
+ - type: "QUICK_REPLY"
14337
+ text: "Track Order"
14196
14338
  responses:
14197
14339
  '200':
14198
14340
  description: Template updated successfully
@@ -0,0 +1,36 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Late::WhatsAppBodyComponentExample
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Late::WhatsAppBodyComponentExample do
21
+ #let(:instance) { Late::WhatsAppBodyComponentExample.new }
22
+
23
+ describe 'test an instance of WhatsAppBodyComponentExample' do
24
+ it 'should create an instance of WhatsAppBodyComponentExample' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Late::WhatsAppBodyComponentExample)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "body_text"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end