late-sdk 0.0.653 → 0.0.654
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 +1 -0
- data/docs/CreateWhatsAppTemplateRequest.md +2 -0
- data/docs/WhatsAppBodyComponentExample.md +3 -1
- data/docs/WhatsAppHeaderComponentExample.md +2 -0
- data/docs/WhatsAppNamedParamExample.md +20 -0
- data/lib/zernio-sdk/models/create_whats_app_template_request.rb +23 -1
- data/lib/zernio-sdk/models/whats_app_body_component_example.rb +16 -4
- data/lib/zernio-sdk/models/whats_app_header_component_example.rb +13 -1
- data/lib/zernio-sdk/models/whats_app_named_param_example.rb +203 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +1 -0
- data/openapi.yaml +25 -0
- data/spec/models/create_whats_app_template_request_spec.rb +10 -0
- data/spec/models/whats_app_body_component_example_spec.rb +6 -0
- data/spec/models/whats_app_header_component_example_spec.rb +6 -0
- data/spec/models/whats_app_named_param_example_spec.rb +42 -0
- data/zernio-sdk-0.0.654.gem +0 -0
- metadata +6 -2
- data/zernio-sdk-0.0.653.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08eee24b333eca6f633283829d8e7e4ff79c31f278a72baad3aa24f8580ef63b'
|
|
4
|
+
data.tar.gz: 77c69694d70fb9a8ef6ce3b11c2db0a83c1c0dc7f28d6fa848e038a402ea1bba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b5c774f9a0e06fcc3d1cd278912aab9817a4941d743d06615792c18e37a947100215fd35df71c0184088d36d7af27f936b1c1541f28920d3bb8a2bcfc3dbaa5
|
|
7
|
+
data.tar.gz: c8297ecaab668851d3ab3afb67a4516f3571f75c5dbf6a00cacac2d6653bd623b5ee3f969f70709f47ca68daf3cf190ef6100ff84fce2fbd10030bbdeb67f344
|
data/README.md
CHANGED
|
@@ -2133,6 +2133,7 @@ Class | Method | HTTP request | Description
|
|
|
2133
2133
|
- [Zernio::WhatsAppHeaderComponentExample](docs/WhatsAppHeaderComponentExample.md)
|
|
2134
2134
|
- [Zernio::WhatsAppLimitedTimeOfferComponent](docs/WhatsAppLimitedTimeOfferComponent.md)
|
|
2135
2135
|
- [Zernio::WhatsAppLimitedTimeOfferComponentLimitedTimeOffer](docs/WhatsAppLimitedTimeOfferComponentLimitedTimeOffer.md)
|
|
2136
|
+
- [Zernio::WhatsAppNamedParamExample](docs/WhatsAppNamedParamExample.md)
|
|
2136
2137
|
- [Zernio::WhatsAppSandboxSession](docs/WhatsAppSandboxSession.md)
|
|
2137
2138
|
- [Zernio::WhatsAppTemplateButton](docs/WhatsAppTemplateButton.md)
|
|
2138
2139
|
- [Zernio::WhatsAppTemplateComponent](docs/WhatsAppTemplateComponent.md)
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **name** | **String** | Template name (lowercase, letters/numbers/underscores, must start with a letter) | |
|
|
9
9
|
| **category** | **String** | Template category | |
|
|
10
10
|
| **language** | **String** | Template language code (e.g., en_US) | |
|
|
11
|
+
| **parameter_format** | **String** | Variable style: POSITIONAL ({{1}}, the default) or NAMED ({{customer_name}}). Named templates provide examples via body_text_named_params / header_text_named_params. Inferred as NAMED when omitted but a named-params example is present. | [optional] |
|
|
11
12
|
| **components** | [**Array<WhatsAppTemplateComponent>**](WhatsAppTemplateComponent.md) | Template components (header, body, footer, buttons, carousel, limited_time_offer). Required for custom templates, omit when using library_template_name. | [optional] |
|
|
12
13
|
| **library_template_name** | **String** | Name of a pre-built template from Meta's template library (e.g., \"appointment_reminder\", \"auto_pay_reminder_1\", \"address_update\"). When provided, the template is pre-approved by Meta with no review wait. Omit components when using this field. | [optional] |
|
|
13
14
|
| **library_template_body_inputs** | **Object** | Optional body customizations for library templates. Available options depend on the template (e.g., add_contact_number, add_learn_more_link, add_security_recommendation, add_track_package_link, code_expiration_minutes). | [optional] |
|
|
@@ -23,6 +24,7 @@ instance = Zernio::CreateWhatsAppTemplateRequest.new(
|
|
|
23
24
|
name: null,
|
|
24
25
|
category: null,
|
|
25
26
|
language: null,
|
|
27
|
+
parameter_format: null,
|
|
26
28
|
components: null,
|
|
27
29
|
library_template_name: null,
|
|
28
30
|
library_template_body_inputs: null,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **body_text** | **Array<Array<String>>** | Sample values for body variables (array of arrays) | [optional] |
|
|
8
|
+
| **body_text_named_params** | [**Array<WhatsAppNamedParamExample>**](WhatsAppNamedParamExample.md) | Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED). | [optional] |
|
|
8
9
|
|
|
9
10
|
## Example
|
|
10
11
|
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
require 'zernio-sdk'
|
|
13
14
|
|
|
14
15
|
instance = Zernio::WhatsAppBodyComponentExample.new(
|
|
15
|
-
body_text: null
|
|
16
|
+
body_text: null,
|
|
17
|
+
body_text_named_params: null
|
|
16
18
|
)
|
|
17
19
|
```
|
|
18
20
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **header_text** | **Array<String>** | Sample values for header text variables | [optional] |
|
|
8
|
+
| **header_text_named_params** | [**Array<WhatsAppNamedParamExample>**](WhatsAppNamedParamExample.md) | Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED). | [optional] |
|
|
8
9
|
| **header_handle** | **Array<String>** | 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. | [optional] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
@@ -14,6 +15,7 @@ require 'zernio-sdk'
|
|
|
14
15
|
|
|
15
16
|
instance = Zernio::WhatsAppHeaderComponentExample.new(
|
|
16
17
|
header_text: null,
|
|
18
|
+
header_text_named_params: null,
|
|
17
19
|
header_handle: null
|
|
18
20
|
)
|
|
19
21
|
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::WhatsAppNamedParamExample
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **param_name** | **String** | Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}). | |
|
|
8
|
+
| **example** | **String** | Sample value for this variable. | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::WhatsAppNamedParamExample.new(
|
|
16
|
+
param_name: null,
|
|
17
|
+
example: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -27,6 +27,9 @@ module Zernio
|
|
|
27
27
|
# Template language code (e.g., en_US)
|
|
28
28
|
attr_accessor :language
|
|
29
29
|
|
|
30
|
+
# Variable style: POSITIONAL ({{1}}, the default) or NAMED ({{customer_name}}). Named templates provide examples via body_text_named_params / header_text_named_params. Inferred as NAMED when omitted but a named-params example is present.
|
|
31
|
+
attr_accessor :parameter_format
|
|
32
|
+
|
|
30
33
|
# Template components (header, body, footer, buttons, carousel, limited_time_offer). Required for custom templates, omit when using library_template_name.
|
|
31
34
|
attr_accessor :components
|
|
32
35
|
|
|
@@ -68,6 +71,7 @@ module Zernio
|
|
|
68
71
|
:'name' => :'name',
|
|
69
72
|
:'category' => :'category',
|
|
70
73
|
:'language' => :'language',
|
|
74
|
+
:'parameter_format' => :'parameter_format',
|
|
71
75
|
:'components' => :'components',
|
|
72
76
|
:'library_template_name' => :'library_template_name',
|
|
73
77
|
:'library_template_body_inputs' => :'library_template_body_inputs',
|
|
@@ -92,6 +96,7 @@ module Zernio
|
|
|
92
96
|
:'name' => :'String',
|
|
93
97
|
:'category' => :'String',
|
|
94
98
|
:'language' => :'String',
|
|
99
|
+
:'parameter_format' => :'String',
|
|
95
100
|
:'components' => :'Array<WhatsAppTemplateComponent>',
|
|
96
101
|
:'library_template_name' => :'String',
|
|
97
102
|
:'library_template_body_inputs' => :'Object',
|
|
@@ -145,6 +150,10 @@ module Zernio
|
|
|
145
150
|
self.language = nil
|
|
146
151
|
end
|
|
147
152
|
|
|
153
|
+
if attributes.key?(:'parameter_format')
|
|
154
|
+
self.parameter_format = attributes[:'parameter_format']
|
|
155
|
+
end
|
|
156
|
+
|
|
148
157
|
if attributes.key?(:'components')
|
|
149
158
|
if (value = attributes[:'components']).is_a?(Array)
|
|
150
159
|
self.components = value
|
|
@@ -210,6 +219,8 @@ module Zernio
|
|
|
210
219
|
category_validator = EnumAttributeValidator.new('String', ["AUTHENTICATION", "MARKETING", "UTILITY"])
|
|
211
220
|
return false unless category_validator.valid?(@category)
|
|
212
221
|
return false if @language.nil?
|
|
222
|
+
parameter_format_validator = EnumAttributeValidator.new('String', ["POSITIONAL", "NAMED", "positional", "named"])
|
|
223
|
+
return false unless parameter_format_validator.valid?(@parameter_format)
|
|
213
224
|
return false if !@components.nil? && @components.length < 1
|
|
214
225
|
true
|
|
215
226
|
end
|
|
@@ -259,6 +270,16 @@ module Zernio
|
|
|
259
270
|
@language = language
|
|
260
271
|
end
|
|
261
272
|
|
|
273
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
274
|
+
# @param [Object] parameter_format Object to be assigned
|
|
275
|
+
def parameter_format=(parameter_format)
|
|
276
|
+
validator = EnumAttributeValidator.new('String', ["POSITIONAL", "NAMED", "positional", "named"])
|
|
277
|
+
unless validator.valid?(parameter_format)
|
|
278
|
+
fail ArgumentError, "invalid value for \"parameter_format\", must be one of #{validator.allowable_values}."
|
|
279
|
+
end
|
|
280
|
+
@parameter_format = parameter_format
|
|
281
|
+
end
|
|
282
|
+
|
|
262
283
|
# Custom attribute writer method with validation
|
|
263
284
|
# @param [Object] components Value to be assigned
|
|
264
285
|
def components=(components)
|
|
@@ -282,6 +303,7 @@ module Zernio
|
|
|
282
303
|
name == o.name &&
|
|
283
304
|
category == o.category &&
|
|
284
305
|
language == o.language &&
|
|
306
|
+
parameter_format == o.parameter_format &&
|
|
285
307
|
components == o.components &&
|
|
286
308
|
library_template_name == o.library_template_name &&
|
|
287
309
|
library_template_body_inputs == o.library_template_body_inputs &&
|
|
@@ -297,7 +319,7 @@ module Zernio
|
|
|
297
319
|
# Calculates hash code according to all attributes.
|
|
298
320
|
# @return [Integer] Hash code
|
|
299
321
|
def hash
|
|
300
|
-
[account_id, name, category, language, components, library_template_name, library_template_body_inputs, library_template_button_inputs].hash
|
|
322
|
+
[account_id, name, category, language, parameter_format, components, library_template_name, library_template_body_inputs, library_template_button_inputs].hash
|
|
301
323
|
end
|
|
302
324
|
|
|
303
325
|
# Builds the object from hash
|
|
@@ -18,10 +18,14 @@ module Zernio
|
|
|
18
18
|
# Sample values for body variables (array of arrays)
|
|
19
19
|
attr_accessor :body_text
|
|
20
20
|
|
|
21
|
+
# Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).
|
|
22
|
+
attr_accessor :body_text_named_params
|
|
23
|
+
|
|
21
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
25
|
def self.attribute_map
|
|
23
26
|
{
|
|
24
|
-
:'body_text' => :'body_text'
|
|
27
|
+
:'body_text' => :'body_text',
|
|
28
|
+
:'body_text_named_params' => :'body_text_named_params'
|
|
25
29
|
}
|
|
26
30
|
end
|
|
27
31
|
|
|
@@ -38,7 +42,8 @@ module Zernio
|
|
|
38
42
|
# Attribute type mapping.
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
41
|
-
:'body_text' => :'Array<Array<String>>'
|
|
45
|
+
:'body_text' => :'Array<Array<String>>',
|
|
46
|
+
:'body_text_named_params' => :'Array<WhatsAppNamedParamExample>'
|
|
42
47
|
}
|
|
43
48
|
end
|
|
44
49
|
|
|
@@ -69,6 +74,12 @@ module Zernio
|
|
|
69
74
|
self.body_text = value
|
|
70
75
|
end
|
|
71
76
|
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'body_text_named_params')
|
|
79
|
+
if (value = attributes[:'body_text_named_params']).is_a?(Array)
|
|
80
|
+
self.body_text_named_params = value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
72
83
|
end
|
|
73
84
|
|
|
74
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -91,7 +102,8 @@ module Zernio
|
|
|
91
102
|
def ==(o)
|
|
92
103
|
return true if self.equal?(o)
|
|
93
104
|
self.class == o.class &&
|
|
94
|
-
body_text == o.body_text
|
|
105
|
+
body_text == o.body_text &&
|
|
106
|
+
body_text_named_params == o.body_text_named_params
|
|
95
107
|
end
|
|
96
108
|
|
|
97
109
|
# @see the `==` method
|
|
@@ -103,7 +115,7 @@ module Zernio
|
|
|
103
115
|
# Calculates hash code according to all attributes.
|
|
104
116
|
# @return [Integer] Hash code
|
|
105
117
|
def hash
|
|
106
|
-
[body_text].hash
|
|
118
|
+
[body_text, body_text_named_params].hash
|
|
107
119
|
end
|
|
108
120
|
|
|
109
121
|
# Builds the object from hash
|
|
@@ -18,6 +18,9 @@ module Zernio
|
|
|
18
18
|
# Sample values for header text variables
|
|
19
19
|
attr_accessor :header_text
|
|
20
20
|
|
|
21
|
+
# Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).
|
|
22
|
+
attr_accessor :header_text_named_params
|
|
23
|
+
|
|
21
24
|
# 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.
|
|
22
25
|
attr_accessor :header_handle
|
|
23
26
|
|
|
@@ -25,6 +28,7 @@ module Zernio
|
|
|
25
28
|
def self.attribute_map
|
|
26
29
|
{
|
|
27
30
|
:'header_text' => :'header_text',
|
|
31
|
+
:'header_text_named_params' => :'header_text_named_params',
|
|
28
32
|
:'header_handle' => :'header_handle'
|
|
29
33
|
}
|
|
30
34
|
end
|
|
@@ -43,6 +47,7 @@ module Zernio
|
|
|
43
47
|
def self.openapi_types
|
|
44
48
|
{
|
|
45
49
|
:'header_text' => :'Array<String>',
|
|
50
|
+
:'header_text_named_params' => :'Array<WhatsAppNamedParamExample>',
|
|
46
51
|
:'header_handle' => :'Array<String>'
|
|
47
52
|
}
|
|
48
53
|
end
|
|
@@ -75,6 +80,12 @@ module Zernio
|
|
|
75
80
|
end
|
|
76
81
|
end
|
|
77
82
|
|
|
83
|
+
if attributes.key?(:'header_text_named_params')
|
|
84
|
+
if (value = attributes[:'header_text_named_params']).is_a?(Array)
|
|
85
|
+
self.header_text_named_params = value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
78
89
|
if attributes.key?(:'header_handle')
|
|
79
90
|
if (value = attributes[:'header_handle']).is_a?(Array)
|
|
80
91
|
self.header_handle = value
|
|
@@ -131,6 +142,7 @@ module Zernio
|
|
|
131
142
|
return true if self.equal?(o)
|
|
132
143
|
self.class == o.class &&
|
|
133
144
|
header_text == o.header_text &&
|
|
145
|
+
header_text_named_params == o.header_text_named_params &&
|
|
134
146
|
header_handle == o.header_handle
|
|
135
147
|
end
|
|
136
148
|
|
|
@@ -143,7 +155,7 @@ module Zernio
|
|
|
143
155
|
# Calculates hash code according to all attributes.
|
|
144
156
|
# @return [Integer] Hash code
|
|
145
157
|
def hash
|
|
146
|
-
[header_text, header_handle].hash
|
|
158
|
+
[header_text, header_text_named_params, header_handle].hash
|
|
147
159
|
end
|
|
148
160
|
|
|
149
161
|
# Builds the object from hash
|
|
@@ -0,0 +1,203 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class WhatsAppNamedParamExample < ApiModelBase
|
|
18
|
+
# Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).
|
|
19
|
+
attr_accessor :param_name
|
|
20
|
+
|
|
21
|
+
# Sample value for this variable.
|
|
22
|
+
attr_accessor :example
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'param_name' => :'param_name',
|
|
28
|
+
:'example' => :'example'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'param_name' => :'String',
|
|
46
|
+
:'example' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WhatsAppNamedParamExample` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WhatsAppNamedParamExample`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'param_name')
|
|
73
|
+
self.param_name = attributes[:'param_name']
|
|
74
|
+
else
|
|
75
|
+
self.param_name = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'example')
|
|
79
|
+
self.example = attributes[:'example']
|
|
80
|
+
else
|
|
81
|
+
self.example = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @param_name.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "param_name", param_name cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
pattern = Regexp.new(/^[a-z0-9_]+$/)
|
|
95
|
+
if @param_name !~ pattern
|
|
96
|
+
invalid_properties.push("invalid value for \"param_name\", must conform to the pattern #{pattern}.")
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if @example.nil?
|
|
100
|
+
invalid_properties.push('invalid value for "example", example cannot be nil.')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
invalid_properties
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Check to see if the all the properties in the model are valid
|
|
107
|
+
# @return true if the model is valid
|
|
108
|
+
def valid?
|
|
109
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
110
|
+
return false if @param_name.nil?
|
|
111
|
+
return false if @param_name !~ Regexp.new(/^[a-z0-9_]+$/)
|
|
112
|
+
return false if @example.nil?
|
|
113
|
+
true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Custom attribute writer method with validation
|
|
117
|
+
# @param [Object] param_name Value to be assigned
|
|
118
|
+
def param_name=(param_name)
|
|
119
|
+
if param_name.nil?
|
|
120
|
+
fail ArgumentError, 'param_name cannot be nil'
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
pattern = Regexp.new(/^[a-z0-9_]+$/)
|
|
124
|
+
if param_name !~ pattern
|
|
125
|
+
fail ArgumentError, "invalid value for \"param_name\", must conform to the pattern #{pattern}."
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@param_name = param_name
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] example Value to be assigned
|
|
133
|
+
def example=(example)
|
|
134
|
+
if example.nil?
|
|
135
|
+
fail ArgumentError, 'example cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@example = example
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks equality by comparing each attribute.
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def ==(o)
|
|
144
|
+
return true if self.equal?(o)
|
|
145
|
+
self.class == o.class &&
|
|
146
|
+
param_name == o.param_name &&
|
|
147
|
+
example == o.example
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# @see the `==` method
|
|
151
|
+
# @param [Object] Object to be compared
|
|
152
|
+
def eql?(o)
|
|
153
|
+
self == o
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Calculates hash code according to all attributes.
|
|
157
|
+
# @return [Integer] Hash code
|
|
158
|
+
def hash
|
|
159
|
+
[param_name, example].hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Builds the object from hash
|
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
164
|
+
# @return [Object] Returns the model itself
|
|
165
|
+
def self.build_from_hash(attributes)
|
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
|
167
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
168
|
+
transformed_hash = {}
|
|
169
|
+
openapi_types.each_pair do |key, type|
|
|
170
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
171
|
+
transformed_hash["#{key}"] = nil
|
|
172
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
173
|
+
# check to ensure the input is an array given that the attribute
|
|
174
|
+
# is documented as an array but the input is not
|
|
175
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
176
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
177
|
+
end
|
|
178
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
179
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
new(transformed_hash)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Returns the object in the form of hash
|
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
|
187
|
+
def to_hash
|
|
188
|
+
hash = {}
|
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
190
|
+
value = self.send(attr)
|
|
191
|
+
if value.nil?
|
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
hash[param] = _to_hash(value)
|
|
197
|
+
end
|
|
198
|
+
hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1548,6 +1548,7 @@ require 'zernio-sdk/models/whats_app_header_component'
|
|
|
1548
1548
|
require 'zernio-sdk/models/whats_app_header_component_example'
|
|
1549
1549
|
require 'zernio-sdk/models/whats_app_limited_time_offer_component'
|
|
1550
1550
|
require 'zernio-sdk/models/whats_app_limited_time_offer_component_limited_time_offer'
|
|
1551
|
+
require 'zernio-sdk/models/whats_app_named_param_example'
|
|
1551
1552
|
require 'zernio-sdk/models/whats_app_sandbox_session'
|
|
1552
1553
|
require 'zernio-sdk/models/whats_app_template_button'
|
|
1553
1554
|
require 'zernio-sdk/models/whats_app_template_component'
|
data/openapi.yaml
CHANGED
|
@@ -1457,6 +1457,11 @@ components:
|
|
|
1457
1457
|
type: array
|
|
1458
1458
|
items: { type: string }
|
|
1459
1459
|
description: Sample values for header text variables
|
|
1460
|
+
header_text_named_params:
|
|
1461
|
+
type: array
|
|
1462
|
+
items:
|
|
1463
|
+
$ref: '#/components/schemas/WhatsAppNamedParamExample'
|
|
1464
|
+
description: 'Sample values for NAMED header variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).'
|
|
1460
1465
|
header_handle:
|
|
1461
1466
|
type: array
|
|
1462
1467
|
minItems: 1
|
|
@@ -1487,6 +1492,22 @@ components:
|
|
|
1487
1492
|
type: array
|
|
1488
1493
|
items: { type: string }
|
|
1489
1494
|
description: Sample values for body variables (array of arrays)
|
|
1495
|
+
body_text_named_params:
|
|
1496
|
+
type: array
|
|
1497
|
+
items:
|
|
1498
|
+
$ref: '#/components/schemas/WhatsAppNamedParamExample'
|
|
1499
|
+
description: 'Sample values for NAMED body variables (templates using {{customer_name}}-style tokens with parameter_format: NAMED).'
|
|
1500
|
+
WhatsAppNamedParamExample:
|
|
1501
|
+
type: object
|
|
1502
|
+
required: [param_name, example]
|
|
1503
|
+
properties:
|
|
1504
|
+
param_name:
|
|
1505
|
+
type: string
|
|
1506
|
+
pattern: '^[a-z0-9_]+$'
|
|
1507
|
+
description: 'Variable name as it appears in the text, without braces (e.g. customer_name for {{customer_name}}).'
|
|
1508
|
+
example:
|
|
1509
|
+
type: string
|
|
1510
|
+
description: Sample value for this variable.
|
|
1490
1511
|
WhatsAppFooterComponent:
|
|
1491
1512
|
type: object
|
|
1492
1513
|
required: [type]
|
|
@@ -26161,6 +26182,10 @@ paths:
|
|
|
26161
26182
|
language:
|
|
26162
26183
|
type: string
|
|
26163
26184
|
description: Template language code (e.g., en_US)
|
|
26185
|
+
parameter_format:
|
|
26186
|
+
type: string
|
|
26187
|
+
enum: [POSITIONAL, NAMED, positional, named]
|
|
26188
|
+
description: 'Variable style: POSITIONAL ({{1}}, the default) or NAMED ({{customer_name}}). Named templates provide examples via body_text_named_params / header_text_named_params. Inferred as NAMED when omitted but a named-params example is present.'
|
|
26164
26189
|
components:
|
|
26165
26190
|
type: array
|
|
26166
26191
|
description: "Template components (header, body, footer, buttons, carousel, limited_time_offer). Required for custom templates, omit when using library_template_name."
|
|
@@ -55,6 +55,16 @@ describe Zernio::CreateWhatsAppTemplateRequest do
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
describe 'test attribute "parameter_format"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["POSITIONAL", "NAMED", "positional", "named"])
|
|
62
|
+
# validator.allowable_values.each do |value|
|
|
63
|
+
# expect { instance.parameter_format = value }.not_to raise_error
|
|
64
|
+
# end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
58
68
|
describe 'test attribute "components"' do
|
|
59
69
|
it 'should work' do
|
|
60
70
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -33,4 +33,10 @@ describe Zernio::WhatsAppBodyComponentExample do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "body_text_named_params"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
36
42
|
end
|
|
@@ -33,6 +33,12 @@ describe Zernio::WhatsAppHeaderComponentExample do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "header_text_named_params"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
36
42
|
describe 'test attribute "header_handle"' do
|
|
37
43
|
it 'should work' do
|
|
38
44
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -0,0 +1,42 @@
|
|
|
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.4
|
|
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 Zernio::WhatsAppNamedParamExample
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::WhatsAppNamedParamExample do
|
|
21
|
+
#let(:instance) { Zernio::WhatsAppNamedParamExample.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of WhatsAppNamedParamExample' do
|
|
24
|
+
it 'should create an instance of WhatsAppNamedParamExample' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::WhatsAppNamedParamExample)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "param_name"' 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
|
+
describe 'test attribute "example"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: late-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.654
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
@@ -1653,6 +1653,7 @@ files:
|
|
|
1653
1653
|
- docs/WhatsAppHeaderComponentExample.md
|
|
1654
1654
|
- docs/WhatsAppLimitedTimeOfferComponent.md
|
|
1655
1655
|
- docs/WhatsAppLimitedTimeOfferComponentLimitedTimeOffer.md
|
|
1656
|
+
- docs/WhatsAppNamedParamExample.md
|
|
1656
1657
|
- docs/WhatsAppPhoneNumbersApi.md
|
|
1657
1658
|
- docs/WhatsAppSandboxApi.md
|
|
1658
1659
|
- docs/WhatsAppSandboxSession.md
|
|
@@ -3282,6 +3283,7 @@ files:
|
|
|
3282
3283
|
- lib/zernio-sdk/models/whats_app_header_component_example.rb
|
|
3283
3284
|
- lib/zernio-sdk/models/whats_app_limited_time_offer_component.rb
|
|
3284
3285
|
- lib/zernio-sdk/models/whats_app_limited_time_offer_component_limited_time_offer.rb
|
|
3286
|
+
- lib/zernio-sdk/models/whats_app_named_param_example.rb
|
|
3285
3287
|
- lib/zernio-sdk/models/whats_app_sandbox_session.rb
|
|
3286
3288
|
- lib/zernio-sdk/models/whats_app_template_button.rb
|
|
3287
3289
|
- lib/zernio-sdk/models/whats_app_template_component.rb
|
|
@@ -4901,6 +4903,7 @@ files:
|
|
|
4901
4903
|
- spec/models/whats_app_header_component_spec.rb
|
|
4902
4904
|
- spec/models/whats_app_limited_time_offer_component_limited_time_offer_spec.rb
|
|
4903
4905
|
- spec/models/whats_app_limited_time_offer_component_spec.rb
|
|
4906
|
+
- spec/models/whats_app_named_param_example_spec.rb
|
|
4904
4907
|
- spec/models/whats_app_sandbox_session_spec.rb
|
|
4905
4908
|
- spec/models/whats_app_template_button_spec.rb
|
|
4906
4909
|
- spec/models/whats_app_template_component_spec.rb
|
|
@@ -4925,7 +4928,7 @@ files:
|
|
|
4925
4928
|
- spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
|
|
4926
4929
|
- spec/models/you_tube_video_retention_response_spec.rb
|
|
4927
4930
|
- spec/spec_helper.rb
|
|
4928
|
-
- zernio-sdk-0.0.
|
|
4931
|
+
- zernio-sdk-0.0.654.gem
|
|
4929
4932
|
- zernio-sdk.gemspec
|
|
4930
4933
|
homepage: https://openapi-generator.tech
|
|
4931
4934
|
licenses:
|
|
@@ -5085,6 +5088,7 @@ test_files:
|
|
|
5085
5088
|
- spec/models/get_you_tube_video_retention404_response_spec.rb
|
|
5086
5089
|
- spec/models/validate_media_request_spec.rb
|
|
5087
5090
|
- spec/models/get_you_tube_daily_views403_response_spec.rb
|
|
5091
|
+
- spec/models/whats_app_named_param_example_spec.rb
|
|
5088
5092
|
- spec/models/update_ad_campaign_status200_response_spec.rb
|
|
5089
5093
|
- spec/models/list_leads200_response_leads_inner_spec.rb
|
|
5090
5094
|
- spec/models/usage_metering_peaks_spec.rb
|
data/zernio-sdk-0.0.653.gem
DELETED
|
Binary file
|