late-sdk 0.0.92 → 0.0.93
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.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/docs/CreateWhatsAppTemplateRequest.md +1 -1
- data/docs/UpdateWhatsAppTemplateRequest.md +1 -1
- data/docs/WhatsAppApi.md +1 -1
- data/docs/WhatsAppBodyComponent.md +24 -0
- data/docs/WhatsAppBodyComponentExample.md +18 -0
- data/docs/WhatsAppButtonsComponent.md +20 -0
- data/docs/WhatsAppFooterComponent.md +22 -0
- data/docs/WhatsAppHeaderComponent.md +24 -0
- data/docs/WhatsAppHeaderComponentExample.md +20 -0
- data/docs/WhatsAppTemplateButton.md +44 -0
- data/docs/WhatsAppTemplateComponent.md +85 -0
- data/lib/late-sdk/models/create_whats_app_template_request.rb +21 -2
- data/lib/late-sdk/models/update_whats_app_template_request.rb +10 -1
- data/lib/late-sdk/models/whats_app_body_component.rb +234 -0
- data/lib/late-sdk/models/whats_app_body_component_example.rb +150 -0
- data/lib/late-sdk/models/whats_app_buttons_component.rb +225 -0
- data/lib/late-sdk/models/whats_app_footer_component.rb +227 -0
- data/lib/late-sdk/models/whats_app_header_component.rb +235 -0
- data/lib/late-sdk/models/whats_app_header_component_example.rb +190 -0
- data/lib/late-sdk/models/whats_app_template_button.rb +345 -0
- data/lib/late-sdk/models/whats_app_template_component.rb +59 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +8 -0
- data/openapi.yaml +156 -5
- data/spec/models/whats_app_body_component_example_spec.rb +36 -0
- data/spec/models/whats_app_body_component_spec.rb +58 -0
- data/spec/models/whats_app_buttons_component_spec.rb +46 -0
- data/spec/models/whats_app_footer_component_spec.rb +52 -0
- data/spec/models/whats_app_header_component_example_spec.rb +42 -0
- data/spec/models/whats_app_header_component_spec.rb +62 -0
- data/spec/models/whats_app_template_button_spec.rb +122 -0
- data/spec/models/whats_app_template_component_spec.rb +44 -0
- data/zernio-sdk-0.0.93.gem +0 -0
- metadata +34 -2
- data/zernio-sdk-0.0.92.gem +0 -0
|
@@ -0,0 +1,345 @@
|
|
|
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
|
+
# discriminator's property name in OpenAPI v3
|
|
129
|
+
def self.openapi_discriminator_name
|
|
130
|
+
:'type'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Initializes the object
|
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
135
|
+
def initialize(attributes = {})
|
|
136
|
+
if (!attributes.is_a?(Hash))
|
|
137
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppTemplateButton` initialize method"
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
141
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
142
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
143
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
144
|
+
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
|
|
145
|
+
end
|
|
146
|
+
h[k.to_sym] = v
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'type')
|
|
150
|
+
self.type = attributes[:'type']
|
|
151
|
+
else
|
|
152
|
+
self.type = nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'text')
|
|
156
|
+
self.text = attributes[:'text']
|
|
157
|
+
else
|
|
158
|
+
self.text = nil
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'url')
|
|
162
|
+
self.url = attributes[:'url']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'example')
|
|
166
|
+
if (value = attributes[:'example']).is_a?(Array)
|
|
167
|
+
self.example = value
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'phone_number')
|
|
172
|
+
self.phone_number = attributes[:'phone_number']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'otp_type')
|
|
176
|
+
self.otp_type = attributes[:'otp_type']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'autofill_text')
|
|
180
|
+
self.autofill_text = attributes[:'autofill_text']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'package_name')
|
|
184
|
+
self.package_name = attributes[:'package_name']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'signature_hash')
|
|
188
|
+
self.signature_hash = attributes[:'signature_hash']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'flow_id')
|
|
192
|
+
self.flow_id = attributes[:'flow_id']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'flow_name')
|
|
196
|
+
self.flow_name = attributes[:'flow_name']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'flow_json')
|
|
200
|
+
self.flow_json = attributes[:'flow_json']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'flow_action')
|
|
204
|
+
self.flow_action = attributes[:'flow_action']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'navigate_screen')
|
|
208
|
+
self.navigate_screen = attributes[:'navigate_screen']
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
213
|
+
# @return Array for valid properties with the reasons
|
|
214
|
+
def list_invalid_properties
|
|
215
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
216
|
+
invalid_properties = Array.new
|
|
217
|
+
if @type.nil?
|
|
218
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if @text.nil?
|
|
222
|
+
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
invalid_properties
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Check to see if the all the properties in the model are valid
|
|
229
|
+
# @return true if the model is valid
|
|
230
|
+
def valid?
|
|
231
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
232
|
+
return false if @type.nil?
|
|
233
|
+
type_validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER", "OTP", "FLOW", "MPM", "CATALOG"])
|
|
234
|
+
return false unless type_validator.valid?(@type)
|
|
235
|
+
return false if @text.nil?
|
|
236
|
+
otp_type_validator = EnumAttributeValidator.new('String', ["COPY_CODE", "ONE_TAP", "ZERO_TAP"])
|
|
237
|
+
return false unless otp_type_validator.valid?(@otp_type)
|
|
238
|
+
true
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
242
|
+
# @param [Object] type Object to be assigned
|
|
243
|
+
def type=(type)
|
|
244
|
+
validator = EnumAttributeValidator.new('String', ["QUICK_REPLY", "URL", "PHONE_NUMBER", "OTP", "FLOW", "MPM", "CATALOG"])
|
|
245
|
+
unless validator.valid?(type)
|
|
246
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
247
|
+
end
|
|
248
|
+
@type = type
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] text Value to be assigned
|
|
253
|
+
def text=(text)
|
|
254
|
+
if text.nil?
|
|
255
|
+
fail ArgumentError, 'text cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@text = text
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
262
|
+
# @param [Object] otp_type Object to be assigned
|
|
263
|
+
def otp_type=(otp_type)
|
|
264
|
+
validator = EnumAttributeValidator.new('String', ["COPY_CODE", "ONE_TAP", "ZERO_TAP"])
|
|
265
|
+
unless validator.valid?(otp_type)
|
|
266
|
+
fail ArgumentError, "invalid value for \"otp_type\", must be one of #{validator.allowable_values}."
|
|
267
|
+
end
|
|
268
|
+
@otp_type = otp_type
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Checks equality by comparing each attribute.
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def ==(o)
|
|
274
|
+
return true if self.equal?(o)
|
|
275
|
+
self.class == o.class &&
|
|
276
|
+
type == o.type &&
|
|
277
|
+
text == o.text &&
|
|
278
|
+
url == o.url &&
|
|
279
|
+
example == o.example &&
|
|
280
|
+
phone_number == o.phone_number &&
|
|
281
|
+
otp_type == o.otp_type &&
|
|
282
|
+
autofill_text == o.autofill_text &&
|
|
283
|
+
package_name == o.package_name &&
|
|
284
|
+
signature_hash == o.signature_hash &&
|
|
285
|
+
flow_id == o.flow_id &&
|
|
286
|
+
flow_name == o.flow_name &&
|
|
287
|
+
flow_json == o.flow_json &&
|
|
288
|
+
flow_action == o.flow_action &&
|
|
289
|
+
navigate_screen == o.navigate_screen
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# @see the `==` method
|
|
293
|
+
# @param [Object] Object to be compared
|
|
294
|
+
def eql?(o)
|
|
295
|
+
self == o
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Calculates hash code according to all attributes.
|
|
299
|
+
# @return [Integer] Hash code
|
|
300
|
+
def hash
|
|
301
|
+
[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
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Builds the object from hash
|
|
305
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
306
|
+
# @return [Object] Returns the model itself
|
|
307
|
+
def self.build_from_hash(attributes)
|
|
308
|
+
return nil unless attributes.is_a?(Hash)
|
|
309
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
310
|
+
transformed_hash = {}
|
|
311
|
+
openapi_types.each_pair do |key, type|
|
|
312
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
313
|
+
transformed_hash["#{key}"] = nil
|
|
314
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
315
|
+
# check to ensure the input is an array given that the attribute
|
|
316
|
+
# is documented as an array but the input is not
|
|
317
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
318
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
319
|
+
end
|
|
320
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
321
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
322
|
+
end
|
|
323
|
+
end
|
|
324
|
+
new(transformed_hash)
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Returns the object in the form of hash
|
|
328
|
+
# @return [Hash] Returns the object in the form of hash
|
|
329
|
+
def to_hash
|
|
330
|
+
hash = {}
|
|
331
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
332
|
+
value = self.send(attr)
|
|
333
|
+
if value.nil?
|
|
334
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
335
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
hash[param] = _to_hash(value)
|
|
339
|
+
end
|
|
340
|
+
hash
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
# Discriminator's property name (OpenAPI v3)
|
|
30
|
+
def openapi_discriminator_name
|
|
31
|
+
:'type'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Discriminator's mapping (OpenAPI v3)
|
|
35
|
+
def openapi_discriminator_mapping
|
|
36
|
+
{
|
|
37
|
+
:'BODY' => :'WhatsAppBodyComponent',
|
|
38
|
+
:'BUTTONS' => :'WhatsAppButtonsComponent',
|
|
39
|
+
:'FOOTER' => :'WhatsAppFooterComponent',
|
|
40
|
+
:'HEADER' => :'WhatsAppHeaderComponent'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Builds the object
|
|
45
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
46
|
+
# @return [Object] Returns the model or the data itself
|
|
47
|
+
def build(data)
|
|
48
|
+
discriminator_value = data[openapi_discriminator_name]
|
|
49
|
+
return nil if discriminator_value.nil?
|
|
50
|
+
|
|
51
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
|
52
|
+
return nil unless klass
|
|
53
|
+
|
|
54
|
+
Late.const_get(klass).build_from_hash(data)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
data/lib/late-sdk/version.rb
CHANGED
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,137 @@ 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
|
+
discriminator:
|
|
353
|
+
propertyName: type
|
|
354
|
+
WhatsAppTemplateComponent:
|
|
355
|
+
oneOf:
|
|
356
|
+
- $ref: '#/components/schemas/WhatsAppHeaderComponent'
|
|
357
|
+
- $ref: '#/components/schemas/WhatsAppBodyComponent'
|
|
358
|
+
- $ref: '#/components/schemas/WhatsAppFooterComponent'
|
|
359
|
+
- $ref: '#/components/schemas/WhatsAppButtonsComponent'
|
|
360
|
+
discriminator:
|
|
361
|
+
propertyName: type
|
|
362
|
+
mapping:
|
|
363
|
+
HEADER: '#/components/schemas/WhatsAppHeaderComponent'
|
|
364
|
+
BODY: '#/components/schemas/WhatsAppBodyComponent'
|
|
365
|
+
FOOTER: '#/components/schemas/WhatsAppFooterComponent'
|
|
366
|
+
BUTTONS: '#/components/schemas/WhatsAppButtonsComponent'
|
|
367
|
+
WhatsAppHeaderComponent:
|
|
368
|
+
type: object
|
|
369
|
+
required: [type, format]
|
|
370
|
+
properties:
|
|
371
|
+
type:
|
|
372
|
+
type: string
|
|
373
|
+
enum: [HEADER]
|
|
374
|
+
format:
|
|
375
|
+
type: string
|
|
376
|
+
enum: [TEXT, IMAGE, VIDEO, GIF, DOCUMENT, LOCATION]
|
|
377
|
+
text:
|
|
378
|
+
type: string
|
|
379
|
+
description: Header text (may include {{1}} variable). Used when format is TEXT.
|
|
380
|
+
example:
|
|
381
|
+
type: object
|
|
382
|
+
properties:
|
|
383
|
+
header_text:
|
|
384
|
+
type: array
|
|
385
|
+
items: { type: string }
|
|
386
|
+
description: Sample values for header text variables
|
|
387
|
+
header_handle:
|
|
388
|
+
type: array
|
|
389
|
+
minItems: 1
|
|
390
|
+
maxItems: 1
|
|
391
|
+
items:
|
|
392
|
+
type: string
|
|
393
|
+
format: uri
|
|
394
|
+
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.
|
|
395
|
+
WhatsAppBodyComponent:
|
|
396
|
+
type: object
|
|
397
|
+
required: [type, text]
|
|
398
|
+
properties:
|
|
399
|
+
type:
|
|
400
|
+
type: string
|
|
401
|
+
enum: [BODY]
|
|
402
|
+
text:
|
|
403
|
+
type: string
|
|
404
|
+
description: Body text with optional {{n}} variables
|
|
405
|
+
add_security_recommendation:
|
|
406
|
+
type: boolean
|
|
407
|
+
description: Add security recommendation text (authentication templates only)
|
|
408
|
+
example:
|
|
409
|
+
type: object
|
|
410
|
+
properties:
|
|
411
|
+
body_text:
|
|
412
|
+
type: array
|
|
413
|
+
items:
|
|
414
|
+
type: array
|
|
415
|
+
items: { type: string }
|
|
416
|
+
description: Sample values for body variables (array of arrays)
|
|
417
|
+
WhatsAppFooterComponent:
|
|
418
|
+
type: object
|
|
419
|
+
required: [type]
|
|
420
|
+
properties:
|
|
421
|
+
type:
|
|
422
|
+
type: string
|
|
423
|
+
enum: [FOOTER]
|
|
424
|
+
text:
|
|
425
|
+
type: string
|
|
426
|
+
description: Static footer text
|
|
427
|
+
code_expiration_minutes:
|
|
428
|
+
type: integer
|
|
429
|
+
minimum: 1
|
|
430
|
+
description: OTP code expiry in minutes (authentication templates only)
|
|
431
|
+
WhatsAppButtonsComponent:
|
|
432
|
+
type: object
|
|
433
|
+
required: [type, buttons]
|
|
434
|
+
properties:
|
|
435
|
+
type:
|
|
436
|
+
type: string
|
|
437
|
+
enum: [BUTTONS]
|
|
438
|
+
buttons:
|
|
439
|
+
type: array
|
|
440
|
+
minItems: 1
|
|
441
|
+
items:
|
|
442
|
+
$ref: '#/components/schemas/WhatsAppTemplateButton'
|
|
312
443
|
FoodMenuLabel:
|
|
313
444
|
type: object
|
|
314
445
|
required: [displayName]
|
|
@@ -14032,9 +14163,10 @@ paths:
|
|
|
14032
14163
|
description: Template language code (e.g., en_US)
|
|
14033
14164
|
components:
|
|
14034
14165
|
type: array
|
|
14035
|
-
description: "Template components (
|
|
14166
|
+
description: "Template components (HEADER, BODY, FOOTER, BUTTONS). Required for custom templates, omit when using library_template_name."
|
|
14167
|
+
minItems: 1
|
|
14036
14168
|
items:
|
|
14037
|
-
|
|
14169
|
+
$ref: '#/components/schemas/WhatsAppTemplateComponent'
|
|
14038
14170
|
library_template_name:
|
|
14039
14171
|
type: string
|
|
14040
14172
|
description: |
|
|
@@ -14073,8 +14205,20 @@ paths:
|
|
|
14073
14205
|
category: "UTILITY"
|
|
14074
14206
|
language: "en_US"
|
|
14075
14207
|
components:
|
|
14076
|
-
- type: "
|
|
14208
|
+
- type: "HEADER"
|
|
14209
|
+
format: "IMAGE"
|
|
14210
|
+
example:
|
|
14211
|
+
header_handle: ["https://example.com/header.jpg"]
|
|
14212
|
+
- type: "BODY"
|
|
14077
14213
|
text: "Your order {{1}} has been confirmed. Expected delivery: {{2}}"
|
|
14214
|
+
example:
|
|
14215
|
+
body_text: [["ORD-12345", "March 31"]]
|
|
14216
|
+
- type: "FOOTER"
|
|
14217
|
+
text: "Thank you for your purchase"
|
|
14218
|
+
- type: "BUTTONS"
|
|
14219
|
+
buttons:
|
|
14220
|
+
- type: "QUICK_REPLY"
|
|
14221
|
+
text: "Track Order"
|
|
14078
14222
|
library:
|
|
14079
14223
|
summary: Library template (pre-approved, no review)
|
|
14080
14224
|
value:
|
|
@@ -14186,13 +14330,20 @@ paths:
|
|
|
14186
14330
|
components:
|
|
14187
14331
|
type: array
|
|
14188
14332
|
description: Updated template components
|
|
14333
|
+
minItems: 1
|
|
14189
14334
|
items:
|
|
14190
|
-
|
|
14335
|
+
$ref: '#/components/schemas/WhatsAppTemplateComponent'
|
|
14191
14336
|
example:
|
|
14192
14337
|
accountId: "507f1f77bcf86cd799439011"
|
|
14193
14338
|
components:
|
|
14194
|
-
- type: "
|
|
14339
|
+
- type: "BODY"
|
|
14195
14340
|
text: "Updated: Your order {{1}} is confirmed. Delivery by {{2}}"
|
|
14341
|
+
example:
|
|
14342
|
+
body_text: [["ORD-12345", "April 1"]]
|
|
14343
|
+
- type: "BUTTONS"
|
|
14344
|
+
buttons:
|
|
14345
|
+
- type: "QUICK_REPLY"
|
|
14346
|
+
text: "Track Order"
|
|
14196
14347
|
responses:
|
|
14197
14348
|
'200':
|
|
14198
14349
|
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
|