late-sdk 0.0.770 → 0.0.772

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/docs/AdCampaignsApi.md +72 -0
  4. data/docs/AnalyticsApi.md +2 -2
  5. data/docs/AttachCampaignAssets201Response.md +24 -0
  6. data/docs/AttachCampaignAssetsRequest.md +24 -0
  7. data/docs/AttachCampaignAssetsRequestSitelinksInner.md +24 -0
  8. data/docs/AttachCampaignAssetsRequestStructuredSnippetsInner.md +20 -0
  9. data/docs/CreateInboxConversationRequest.md +3 -1
  10. data/docs/CreateInboxConversationRequestTemplateButtonParamsInner.md +22 -0
  11. data/docs/CreateStandaloneAdRequest.md +4 -0
  12. data/docs/CreateStandaloneAdRequestStructuredSnippetsInner.md +20 -0
  13. data/docs/MessagesApi.md +1 -1
  14. data/docs/PostAnalytics.md +4 -0
  15. data/docs/TargetingSpec.md +2 -2
  16. data/lib/zernio-sdk/api/ad_campaigns_api.rb +74 -0
  17. data/lib/zernio-sdk/api/analytics_api.rb +3 -3
  18. data/lib/zernio-sdk/api/messages_api.rb +2 -2
  19. data/lib/zernio-sdk/models/ad_tree_campaign_optimization_goal.rb +1 -0
  20. data/lib/zernio-sdk/models/attach_campaign_assets201_response.rb +180 -0
  21. data/lib/zernio-sdk/models/attach_campaign_assets_request.rb +283 -0
  22. data/lib/zernio-sdk/models/attach_campaign_assets_request_sitelinks_inner.rb +282 -0
  23. data/lib/zernio-sdk/models/attach_campaign_assets_request_structured_snippets_inner.rb +234 -0
  24. data/lib/zernio-sdk/models/create_inbox_conversation_request.rb +33 -2
  25. data/lib/zernio-sdk/models/create_inbox_conversation_request_template_button_params_inner.rb +270 -0
  26. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +81 -1
  27. data/lib/zernio-sdk/models/create_standalone_ad_request_structured_snippets_inner.rb +235 -0
  28. data/lib/zernio-sdk/models/post_analytics.rb +21 -1
  29. data/lib/zernio-sdk/models/targeting_spec.rb +2 -0
  30. data/lib/zernio-sdk/version.rb +1 -1
  31. data/lib/zernio-sdk.rb +6 -0
  32. data/openapi.yaml +167 -10
  33. data/spec/api/ad_campaigns_api_spec.rb +13 -0
  34. data/spec/api/analytics_api_spec.rb +1 -1
  35. data/spec/api/messages_api_spec.rb +1 -1
  36. data/spec/models/attach_campaign_assets201_response_spec.rb +54 -0
  37. data/spec/models/attach_campaign_assets_request_sitelinks_inner_spec.rb +54 -0
  38. data/spec/models/attach_campaign_assets_request_spec.rb +54 -0
  39. data/spec/models/attach_campaign_assets_request_structured_snippets_inner_spec.rb +46 -0
  40. data/spec/models/create_inbox_conversation_request_spec.rb +6 -0
  41. data/spec/models/create_inbox_conversation_request_template_button_params_inner_spec.rb +52 -0
  42. data/spec/models/create_standalone_ad_request_spec.rb +12 -0
  43. data/spec/models/create_standalone_ad_request_structured_snippets_inner_spec.rb +46 -0
  44. data/spec/models/post_analytics_spec.rb +12 -0
  45. data/zernio-sdk-0.0.772.gem +0 -0
  46. metadata +26 -2
  47. data/zernio-sdk-0.0.770.gem +0 -0
@@ -0,0 +1,282 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
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 AttachCampaignAssetsRequestSitelinksInner < ApiModelBase
18
+ attr_accessor :text
19
+
20
+ attr_accessor :link_url
21
+
22
+ attr_accessor :description1
23
+
24
+ attr_accessor :description2
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'text' => :'text',
30
+ :'link_url' => :'linkUrl',
31
+ :'description1' => :'description1',
32
+ :'description2' => :'description2'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'text' => :'String',
50
+ :'link_url' => :'String',
51
+ :'description1' => :'String',
52
+ :'description2' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AttachCampaignAssetsRequestSitelinksInner` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AttachCampaignAssetsRequestSitelinksInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'text')
79
+ self.text = attributes[:'text']
80
+ else
81
+ self.text = nil
82
+ end
83
+
84
+ if attributes.key?(:'link_url')
85
+ self.link_url = attributes[:'link_url']
86
+ else
87
+ self.link_url = nil
88
+ end
89
+
90
+ if attributes.key?(:'description1')
91
+ self.description1 = attributes[:'description1']
92
+ end
93
+
94
+ if attributes.key?(:'description2')
95
+ self.description2 = attributes[:'description2']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ if @text.nil?
105
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
106
+ end
107
+
108
+ if @text.to_s.length > 25
109
+ invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 25.')
110
+ end
111
+
112
+ if @text.to_s.length < 1
113
+ invalid_properties.push('invalid value for "text", the character length must be greater than or equal to 1.')
114
+ end
115
+
116
+ if @link_url.nil?
117
+ invalid_properties.push('invalid value for "link_url", link_url cannot be nil.')
118
+ end
119
+
120
+ if !@description1.nil? && @description1.to_s.length > 35
121
+ invalid_properties.push('invalid value for "description1", the character length must be smaller than or equal to 35.')
122
+ end
123
+
124
+ if !@description1.nil? && @description1.to_s.length < 1
125
+ invalid_properties.push('invalid value for "description1", the character length must be greater than or equal to 1.')
126
+ end
127
+
128
+ if !@description2.nil? && @description2.to_s.length > 35
129
+ invalid_properties.push('invalid value for "description2", the character length must be smaller than or equal to 35.')
130
+ end
131
+
132
+ if !@description2.nil? && @description2.to_s.length < 1
133
+ invalid_properties.push('invalid value for "description2", the character length must be greater than or equal to 1.')
134
+ end
135
+
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ return false if @text.nil?
144
+ return false if @text.to_s.length > 25
145
+ return false if @text.to_s.length < 1
146
+ return false if @link_url.nil?
147
+ return false if !@description1.nil? && @description1.to_s.length > 35
148
+ return false if !@description1.nil? && @description1.to_s.length < 1
149
+ return false if !@description2.nil? && @description2.to_s.length > 35
150
+ return false if !@description2.nil? && @description2.to_s.length < 1
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] text Value to be assigned
156
+ def text=(text)
157
+ if text.nil?
158
+ fail ArgumentError, 'text cannot be nil'
159
+ end
160
+
161
+ if text.to_s.length > 25
162
+ fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 25.'
163
+ end
164
+
165
+ if text.to_s.length < 1
166
+ fail ArgumentError, 'invalid value for "text", the character length must be greater than or equal to 1.'
167
+ end
168
+
169
+ @text = text
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] link_url Value to be assigned
174
+ def link_url=(link_url)
175
+ if link_url.nil?
176
+ fail ArgumentError, 'link_url cannot be nil'
177
+ end
178
+
179
+ @link_url = link_url
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] description1 Value to be assigned
184
+ def description1=(description1)
185
+ if description1.nil?
186
+ fail ArgumentError, 'description1 cannot be nil'
187
+ end
188
+
189
+ if description1.to_s.length > 35
190
+ fail ArgumentError, 'invalid value for "description1", the character length must be smaller than or equal to 35.'
191
+ end
192
+
193
+ if description1.to_s.length < 1
194
+ fail ArgumentError, 'invalid value for "description1", the character length must be greater than or equal to 1.'
195
+ end
196
+
197
+ @description1 = description1
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] description2 Value to be assigned
202
+ def description2=(description2)
203
+ if description2.nil?
204
+ fail ArgumentError, 'description2 cannot be nil'
205
+ end
206
+
207
+ if description2.to_s.length > 35
208
+ fail ArgumentError, 'invalid value for "description2", the character length must be smaller than or equal to 35.'
209
+ end
210
+
211
+ if description2.to_s.length < 1
212
+ fail ArgumentError, 'invalid value for "description2", the character length must be greater than or equal to 1.'
213
+ end
214
+
215
+ @description2 = description2
216
+ end
217
+
218
+ # Checks equality by comparing each attribute.
219
+ # @param [Object] Object to be compared
220
+ def ==(o)
221
+ return true if self.equal?(o)
222
+ self.class == o.class &&
223
+ text == o.text &&
224
+ link_url == o.link_url &&
225
+ description1 == o.description1 &&
226
+ description2 == o.description2
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [text, link_url, description1, description2].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
+ end
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
260
+ end
261
+ new(transformed_hash)
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ end
281
+
282
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
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 AttachCampaignAssetsRequestStructuredSnippetsInner < ApiModelBase
18
+ attr_accessor :header
19
+
20
+ attr_accessor :values
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'header' => :'header',
48
+ :'values' => :'values'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'header' => :'String',
66
+ :'values' => :'Array<String>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::AttachCampaignAssetsRequestStructuredSnippetsInner` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::AttachCampaignAssetsRequestStructuredSnippetsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'header')
93
+ self.header = attributes[:'header']
94
+ else
95
+ self.header = nil
96
+ end
97
+
98
+ if attributes.key?(:'values')
99
+ if (value = attributes[:'values']).is_a?(Array)
100
+ self.values = value
101
+ end
102
+ else
103
+ self.values = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @header.nil?
113
+ invalid_properties.push('invalid value for "header", header cannot be nil.')
114
+ end
115
+
116
+ if @values.nil?
117
+ invalid_properties.push('invalid value for "values", values cannot be nil.')
118
+ end
119
+
120
+ if @values.length > 10
121
+ invalid_properties.push('invalid value for "values", number of items must be less than or equal to 10.')
122
+ end
123
+
124
+ if @values.length < 3
125
+ invalid_properties.push('invalid value for "values", number of items must be greater than or equal to 3.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @header.nil?
136
+ header_validator = EnumAttributeValidator.new('String', ["Amenities", "Brands", "Courses", "Degree programs", "Destinations", "Featured hotels", "Insurance coverage", "Models", "Neighborhoods", "Service catalog", "Shows", "Styles", "Types"])
137
+ return false unless header_validator.valid?(@header)
138
+ return false if @values.nil?
139
+ return false if @values.length > 10
140
+ return false if @values.length < 3
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] header Object to be assigned
146
+ def header=(header)
147
+ validator = EnumAttributeValidator.new('String', ["Amenities", "Brands", "Courses", "Degree programs", "Destinations", "Featured hotels", "Insurance coverage", "Models", "Neighborhoods", "Service catalog", "Shows", "Styles", "Types"])
148
+ unless validator.valid?(header)
149
+ fail ArgumentError, "invalid value for \"header\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @header = header
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] values Value to be assigned
156
+ def values=(values)
157
+ if values.nil?
158
+ fail ArgumentError, 'values cannot be nil'
159
+ end
160
+
161
+ if values.length > 10
162
+ fail ArgumentError, 'invalid value for "values", number of items must be less than or equal to 10.'
163
+ end
164
+
165
+ if values.length < 3
166
+ fail ArgumentError, 'invalid value for "values", number of items must be greater than or equal to 3.'
167
+ end
168
+
169
+ @values = values
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ header == o.header &&
178
+ values == o.values
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [header, values].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ attributes = attributes.transform_keys(&:to_sym)
199
+ transformed_hash = {}
200
+ openapi_types.each_pair do |key, type|
201
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[attribute_map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
+ end
212
+ end
213
+ new(transformed_hash)
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -42,9 +42,12 @@ module Zernio
42
42
  # WhatsApp only. Template language code (e.g. en_US).
43
43
  attr_accessor :template_language
44
44
 
45
- # WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send).
45
+ # WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send). Buttons that are not dynamic-URL buttons (copy-code, flow) take no value here either; use templateButtonParams.
46
46
  attr_accessor :template_params
47
47
 
48
+ # WhatsApp only. Values for template buttons that carry one at send time, each addressed by the button's position in the approved template. This is the only way to send a copy-code button's payload (a Pix payment code, a coupon) or a flow token, because templateParams is a flat array of text variables and covers dynamic URL buttons only. Supplying a button here overrides whatever templateParams would have derived for that same index, so the send never carries one button twice; repeating an index within this array is rejected with 400. Each index must name a button of the matching kind on the approved template, which is also checked before the send and returns 400 (INVALID_TEMPLATE_BUTTON_PARAM) rather than a Meta rejection.
49
+ attr_accessor :template_button_params
50
+
48
51
  attr_accessor :header_media
49
52
 
50
53
  class EnumAttributeValidator
@@ -82,6 +85,7 @@ module Zernio
82
85
  :'link_preview' => :'linkPreview',
83
86
  :'template_language' => :'templateLanguage',
84
87
  :'template_params' => :'templateParams',
88
+ :'template_button_params' => :'templateButtonParams',
85
89
  :'header_media' => :'headerMedia'
86
90
  }
87
91
  end
@@ -109,6 +113,7 @@ module Zernio
109
113
  :'link_preview' => :'Boolean',
110
114
  :'template_language' => :'String',
111
115
  :'template_params' => :'Array<String>',
116
+ :'template_button_params' => :'Array<CreateInboxConversationRequestTemplateButtonParamsInner>',
112
117
  :'header_media' => :'CreateInboxConversationRequestHeaderMedia'
113
118
  }
114
119
  end
@@ -183,6 +188,12 @@ module Zernio
183
188
  end
184
189
  end
185
190
 
191
+ if attributes.key?(:'template_button_params')
192
+ if (value = attributes[:'template_button_params']).is_a?(Array)
193
+ self.template_button_params = value
194
+ end
195
+ end
196
+
186
197
  if attributes.key?(:'header_media')
187
198
  self.header_media = attributes[:'header_media']
188
199
  end
@@ -197,6 +208,10 @@ module Zernio
197
208
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
198
209
  end
199
210
 
211
+ if !@template_button_params.nil? && @template_button_params.length > 10
212
+ invalid_properties.push('invalid value for "template_button_params", number of items must be less than or equal to 10.')
213
+ end
214
+
200
215
  invalid_properties
201
216
  end
202
217
 
@@ -207,6 +222,7 @@ module Zernio
207
222
  return false if @account_id.nil?
208
223
  category_validator = EnumAttributeValidator.new('String', ["utility"])
209
224
  return false unless category_validator.valid?(@category)
225
+ return false if !@template_button_params.nil? && @template_button_params.length > 10
210
226
  true
211
227
  end
212
228
 
@@ -230,6 +246,20 @@ module Zernio
230
246
  @category = category
231
247
  end
232
248
 
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] template_button_params Value to be assigned
251
+ def template_button_params=(template_button_params)
252
+ if template_button_params.nil?
253
+ fail ArgumentError, 'template_button_params cannot be nil'
254
+ end
255
+
256
+ if template_button_params.length > 10
257
+ fail ArgumentError, 'invalid value for "template_button_params", number of items must be less than or equal to 10.'
258
+ end
259
+
260
+ @template_button_params = template_button_params
261
+ end
262
+
233
263
  # Checks equality by comparing each attribute.
234
264
  # @param [Object] Object to be compared
235
265
  def ==(o)
@@ -245,6 +275,7 @@ module Zernio
245
275
  link_preview == o.link_preview &&
246
276
  template_language == o.template_language &&
247
277
  template_params == o.template_params &&
278
+ template_button_params == o.template_button_params &&
248
279
  header_media == o.header_media
249
280
  end
250
281
 
@@ -257,7 +288,7 @@ module Zernio
257
288
  # Calculates hash code according to all attributes.
258
289
  # @return [Integer] Hash code
259
290
  def hash
260
- [account_id, participant_id, participant_username, message, skip_dm_check, template_name, category, link_preview, template_language, template_params, header_media].hash
291
+ [account_id, participant_id, participant_username, message, skip_dm_check, template_name, category, link_preview, template_language, template_params, template_button_params, header_media].hash
261
292
  end
262
293
 
263
294
  # Builds the object from hash