zernio-sdk 0.0.810 → 0.0.812
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/docs/CreateContactRequest.md +1 -1
- data/docs/CreateInboxConversationRequest.md +1 -1
- data/lib/zernio-sdk/api/contacts_api.rb +1 -1
- data/lib/zernio-sdk/models/create_contact_request.rb +35 -0
- data/lib/zernio-sdk/models/create_inbox_conversation_request.rb +1 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/openapi.yaml +11 -5
- data/spec/models/create_contact_request_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94c1b8d8762e8ac96f0dcd54ac2a3fba405f9aea07fa6537bb49cd4cb20011e3
|
|
4
|
+
data.tar.gz: 6674637bdcfaa210cd85c62a3d83bb8ef0dae4d666fc73773c0f17d3c3b29439
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eda431e1568c572d5ded0d20d0d40b9f35d7f005bcf85110e3ee753ec508fab1f181268c600c4eeaf03f2935525aabf06fbc90c2344a0ad9b7f6de438d08d503
|
|
7
|
+
data.tar.gz: de31319ad6da45239d98df7bffbc50c86223786d2aa8b8c7c771bc2175c16ad738c8d79df32a36a6edf3b5bf0892d70db233b78ad4f2383e7d145ade82ebc0fe
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
| **is_subscribed** | **Boolean** | | [optional][default to true] |
|
|
13
13
|
| **notes** | **String** | | [optional] |
|
|
14
14
|
| **account_id** | **String** | Optional. Creates a channel if provided with platform + platformIdentifier | [optional] |
|
|
15
|
-
| **platform** | **String** |
|
|
15
|
+
| **platform** | **String** | Channel platform. Only the enum values support contact channels; any other platform is rejected with code platform_not_supported. | [optional] |
|
|
16
16
|
| **platform_identifier** | **String** | | [optional] |
|
|
17
17
|
| **display_identifier** | **String** | | [optional] |
|
|
18
18
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| **category** | **String** | WhatsApp only (Meta Direct Send). Combined with message and without templateName, starts the conversation with a business-initiated UTILITY message and no pre-approved template; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Cannot be combined with templateName (templates are already categorized at creation). Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests. | [optional] |
|
|
14
14
|
| **link_preview** | **Boolean** | WhatsApp only. Set false to send the Direct Send (category: 'utility') text message without a link-preview thumbnail for the first URL in the text. Defaults to true, which is how every WhatsApp text has been sent to date. Does not apply to template sends. Accepted on the JSON body only, not on multipart requests. | [optional][default to true] |
|
|
15
15
|
| **template_language** | **String** | WhatsApp only. Template language code (e.g. en_US). | [optional] |
|
|
16
|
-
| **template_params** | **Array<String>** | 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. | [optional] |
|
|
16
|
+
| **template_params** | **Array<String>** | 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]. For positional templates the list must cover every slot: supplying fewer values than the template's header + body + dynamic URL-button count is rejected with a 400 (code INVALID_TEMPLATE_PARAMS) naming the expected split, rather than delivering a template whose button URL was filled from the wrong value. A dynamic URL button covered by templateButtonParams needs no value here unless another uncovered dynamic URL button follows it, since the override applies after slot numbering. 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. | [optional] |
|
|
17
17
|
| **template_button_params** | [**Array<CreateInboxConversationRequestTemplateButtonParamsInner>**](CreateInboxConversationRequestTemplateButtonParamsInner.md) | 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. | [optional] |
|
|
18
18
|
| **header_media** | [**CreateInboxConversationRequestHeaderMedia**](CreateInboxConversationRequestHeaderMedia.md) | | [optional] |
|
|
19
19
|
| **header_location** | [**CreateInboxConversationRequestHeaderLocation**](CreateInboxConversationRequestHeaderLocation.md) | | [optional] |
|
|
@@ -379,7 +379,7 @@ module Zernio
|
|
|
379
379
|
if @api_client.config.debugging
|
|
380
380
|
@api_client.config.logger.debug 'Calling API: ContactsApi.list_contacts ...'
|
|
381
381
|
end
|
|
382
|
-
allowable_values = ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp"]
|
|
382
|
+
allowable_values = ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp", "slack"]
|
|
383
383
|
if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
|
|
384
384
|
fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
|
|
385
385
|
end
|
|
@@ -32,12 +32,35 @@ module Zernio
|
|
|
32
32
|
# Optional. Creates a channel if provided with platform + platformIdentifier
|
|
33
33
|
attr_accessor :account_id
|
|
34
34
|
|
|
35
|
+
# Channel platform. Only the enum values support contact channels; any other platform is rejected with code platform_not_supported.
|
|
35
36
|
attr_accessor :platform
|
|
36
37
|
|
|
37
38
|
attr_accessor :platform_identifier
|
|
38
39
|
|
|
39
40
|
attr_accessor :display_identifier
|
|
40
41
|
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
41
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
65
|
def self.attribute_map
|
|
43
66
|
{
|
|
@@ -179,6 +202,8 @@ module Zernio
|
|
|
179
202
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
180
203
|
return false if @profile_id.nil?
|
|
181
204
|
return false if @name.nil?
|
|
205
|
+
platform_validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp", "slack"])
|
|
206
|
+
return false unless platform_validator.valid?(@platform)
|
|
182
207
|
true
|
|
183
208
|
end
|
|
184
209
|
|
|
@@ -202,6 +227,16 @@ module Zernio
|
|
|
202
227
|
@name = name
|
|
203
228
|
end
|
|
204
229
|
|
|
230
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
231
|
+
# @param [Object] platform Object to be assigned
|
|
232
|
+
def platform=(platform)
|
|
233
|
+
validator = EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp", "slack"])
|
|
234
|
+
unless validator.valid?(platform)
|
|
235
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
236
|
+
end
|
|
237
|
+
@platform = platform
|
|
238
|
+
end
|
|
239
|
+
|
|
205
240
|
# Checks equality by comparing each attribute.
|
|
206
241
|
# @param [Object] Object to be compared
|
|
207
242
|
def ==(o)
|
|
@@ -42,7 +42,7 @@ 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). Buttons that are not dynamic-URL buttons (copy-code, flow) take no value here either; use templateButtonParams.
|
|
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]. For positional templates the list must cover every slot: supplying fewer values than the template's header + body + dynamic URL-button count is rejected with a 400 (code INVALID_TEMPLATE_PARAMS) naming the expected split, rather than delivering a template whose button URL was filled from the wrong value. A dynamic URL button covered by templateButtonParams needs no value here unless another uncovered dynamic URL button follows it, since the override applies after slot numbering. 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
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.
|
data/lib/zernio-sdk/version.rb
CHANGED
data/openapi.yaml
CHANGED
|
@@ -26264,7 +26264,13 @@ paths:
|
|
|
26264
26264
|
({{name}}, {{company}} - how Meta Business Manager creates templates), where
|
|
26265
26265
|
values fill the named slots in order of appearance. Example - a body with
|
|
26266
26266
|
{{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values:
|
|
26267
|
-
[body1, body2, buttonSuffix].
|
|
26267
|
+
[body1, body2, buttonSuffix]. For positional templates the list must cover
|
|
26268
|
+
every slot: supplying fewer values than the template's header + body + dynamic
|
|
26269
|
+
URL-button count is rejected with a 400 (code INVALID_TEMPLATE_PARAMS) naming
|
|
26270
|
+
the expected split, rather than delivering a template whose button URL was
|
|
26271
|
+
filled from the wrong value. A dynamic URL button covered by templateButtonParams
|
|
26272
|
+
needs no value here unless another uncovered dynamic URL button follows it, since
|
|
26273
|
+
the override applies after slot numbering. Media headers (image, video, document) are filled
|
|
26268
26274
|
automatically from the approved template and take no value here (use headerMedia
|
|
26269
26275
|
to override the header asset per send). Buttons that are not dynamic-URL buttons
|
|
26270
26276
|
(copy-code, flow) take no value here either; use templateButtonParams.
|
|
@@ -37877,7 +37883,7 @@ paths:
|
|
|
37877
37883
|
- { name: search, in: query, schema: { type: string }, description: 'Case-insensitive substring match on the contact name, email and company. Phone numbers and other platform identifiers are not matched: they live on the contact channel, not on the contact. To reach a contact from an inbox webhook, use the conversation.contactId it already carries.' }
|
|
37878
37884
|
- { name: tag, in: query, schema: { type: string } }
|
|
37879
37885
|
- { name: tags, in: query, schema: { type: string }, description: 'Comma-separated tags, matches contacts carrying any of them' }
|
|
37880
|
-
- { name: platform, in: query, schema: { type: string, enum: [instagram, facebook, telegram, twitter, bluesky, reddit, whatsapp] } }
|
|
37886
|
+
- { name: platform, in: query, schema: { type: string, enum: [instagram, facebook, telegram, twitter, bluesky, reddit, whatsapp, slack] } }
|
|
37881
37887
|
- { name: isSubscribed, in: query, schema: { type: string, enum: ['true', 'false'] } }
|
|
37882
37888
|
- { name: limit, in: query, schema: { type: integer, default: 50, maximum: 200 } }
|
|
37883
37889
|
- { name: skip, in: query, schema: { type: integer, default: 0 } }
|
|
@@ -37948,7 +37954,7 @@ paths:
|
|
|
37948
37954
|
isSubscribed: { type: boolean, default: true }
|
|
37949
37955
|
notes: { type: string }
|
|
37950
37956
|
accountId: { type: string, description: Optional. Creates a channel if provided with platform + platformIdentifier }
|
|
37951
|
-
platform: { type: string }
|
|
37957
|
+
platform: { type: string, enum: [instagram, facebook, telegram, twitter, bluesky, reddit, whatsapp, slack], description: 'Channel platform. Only the enum values support contact channels; any other platform is rejected with code platform_not_supported.' }
|
|
37952
37958
|
platformIdentifier: { type: string }
|
|
37953
37959
|
displayIdentifier: { type: string }
|
|
37954
37960
|
responses:
|
|
@@ -37982,7 +37988,7 @@ paths:
|
|
|
37982
37988
|
platformIdentifier: { type: string }
|
|
37983
37989
|
displayIdentifier: { type: string }
|
|
37984
37990
|
warning: { type: string }
|
|
37985
|
-
'400': { description: Invalid request }
|
|
37991
|
+
'400': { description: 'Invalid request. Channel fields are all-or-nothing: accountId, platform and platformIdentifier must be sent together (code: missing_required_field). A platform outside the enum does not support contact channels (code: platform_not_supported, details.supportedPlatforms lists the valid values).' }
|
|
37986
37992
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
37987
37993
|
'409': { description: 'Duplicate channel. The platformIdentifier is already bound to a channel on this accountId.' }
|
|
37988
37994
|
|
|
@@ -38182,7 +38188,7 @@ paths:
|
|
|
38182
38188
|
skipped: { type: integer }
|
|
38183
38189
|
errors: { type: array, items: { type: string }, description: 'Per-contact failures, e.g. an identifier that is not a valid phone number' }
|
|
38184
38190
|
total: { type: integer }
|
|
38185
|
-
'400': { description: 'Contact missing required field name, or a row carries platformIdentifier/accountId with no top-level accountId to attach it to. A row missing platformIdentifier while accountId IS set is not a 400: it is reported in errors[] under a 200.' }
|
|
38191
|
+
'400': { description: 'Contact missing required field name, or a row carries platformIdentifier/accountId with no top-level accountId to attach it to. A row missing platformIdentifier while accountId IS set is not a 400: it is reported in errors[] under a 200. An accountId on a platform with no contact channels rejects the whole import (code: platform_not_supported, details.supportedPlatforms lists the valid values).' }
|
|
38186
38192
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
38187
38193
|
|
|
38188
38194
|
/v1/contacts/{contactId}/fields/{slug}:
|
|
@@ -78,6 +78,10 @@ describe Zernio::CreateContactRequest do
|
|
|
78
78
|
describe 'test attribute "platform"' do
|
|
79
79
|
it 'should work' do
|
|
80
80
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
81
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp", "slack"])
|
|
82
|
+
# validator.allowable_values.each do |value|
|
|
83
|
+
# expect { instance.platform = value }.not_to raise_error
|
|
84
|
+
# end
|
|
81
85
|
end
|
|
82
86
|
end
|
|
83
87
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zernio-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.812
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|