late-sdk 0.0.664 → 0.0.666
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 -4
- data/docs/CreateInboxConversationRequest.md +1 -1
- data/docs/ListSlackMembers200Response.md +18 -0
- data/docs/ListSlackMembers200ResponseMembersInner.md +24 -0
- data/docs/MessagesApi.md +1 -1
- data/docs/SendInboxMessageRequestInteractiveAction.md +3 -1
- data/docs/SendInboxMessageRequestInteractiveActionOneOf5.md +2 -4
- data/docs/SendInboxMessageRequestInteractiveActionOneOf6.md +2 -2
- data/docs/SendInboxMessageRequestInteractiveActionOneOf7.md +4 -4
- data/docs/{SendInboxMessageRequestInteractiveActionOneOf6SectionsInner.md → SendInboxMessageRequestInteractiveActionOneOf7SectionsInner.md} +3 -3
- data/docs/{SendInboxMessageRequestInteractiveActionOneOf6SectionsInnerProductItemsInner.md → SendInboxMessageRequestInteractiveActionOneOf7SectionsInnerProductItemsInner.md} +2 -2
- data/docs/SendInboxMessageRequestInteractiveActionOneOf8.md +4 -2
- data/docs/{SendInboxMessageRequestInteractiveActionOneOf7Parameters.md → SendInboxMessageRequestInteractiveActionOneOf8Parameters.md} +2 -2
- data/docs/SendInboxMessageRequestInteractiveActionOneOf9.md +18 -0
- data/docs/{SendInboxMessageRequestInteractiveActionOneOf8CardsInner.md → SendInboxMessageRequestInteractiveActionOneOf9CardsInner.md} +2 -2
- data/docs/SlackApi.md +83 -0
- data/docs/WebhookPayloadMessageMetadata.md +4 -0
- data/lib/zernio-sdk/api/messages_api.rb +2 -2
- data/lib/zernio-sdk/api/slack_api.rb +103 -0
- data/lib/zernio-sdk/models/create_inbox_conversation_request.rb +1 -1
- data/lib/zernio-sdk/models/list_slack_members200_response.rb +149 -0
- data/lib/zernio-sdk/models/list_slack_members200_response_members_inner.rb +180 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive.rb +3 -3
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action.rb +2 -1
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of5.rb +42 -46
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of6.rb +18 -38
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of7.rb +64 -49
- data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner.rb} +4 -4
- data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_product_items_inner.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_product_items_inner.rb} +3 -3
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of8.rb +52 -39
- data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of7_parameters.rb → send_inbox_message_request_interactive_action_one_of8_parameters.rb} +3 -3
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of9.rb +185 -0
- data/lib/zernio-sdk/models/{send_inbox_message_request_interactive_action_one_of8_cards_inner.rb → send_inbox_message_request_interactive_action_one_of9_cards_inner.rb} +3 -3
- data/lib/zernio-sdk/models/webhook_payload_message_metadata.rb +35 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +8 -4
- data/openapi.yaml +87 -3
- data/spec/api/messages_api_spec.rb +1 -1
- data/spec/api/slack_api_spec.rb +49 -0
- data/spec/models/list_slack_members200_response_members_inner_spec.rb +54 -0
- data/spec/models/list_slack_members200_response_spec.rb +36 -0
- data/spec/models/send_inbox_message_request_interactive_action_one_of5_spec.rb +5 -7
- data/spec/models/send_inbox_message_request_interactive_action_one_of6_spec.rb +1 -1
- data/spec/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_product_items_inner_spec.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_product_items_inner_spec.rb} +6 -6
- data/spec/models/{send_inbox_message_request_interactive_action_one_of6_sections_inner_spec.rb → send_inbox_message_request_interactive_action_one_of7_sections_inner_spec.rb} +6 -6
- data/spec/models/send_inbox_message_request_interactive_action_one_of7_spec.rb +2 -6
- data/spec/models/{send_inbox_message_request_interactive_action_one_of7_parameters_spec.rb → send_inbox_message_request_interactive_action_one_of8_parameters_spec.rb} +6 -6
- data/spec/models/send_inbox_message_request_interactive_action_one_of8_spec.rb +11 -1
- data/spec/models/{send_inbox_message_request_interactive_action_one_of8_cards_inner_spec.rb → send_inbox_message_request_interactive_action_one_of9_cards_inner_spec.rb} +6 -6
- data/spec/models/send_inbox_message_request_interactive_action_one_of9_spec.rb +36 -0
- data/spec/models/send_inbox_message_request_interactive_spec.rb +1 -1
- data/spec/models/webhook_payload_message_metadata_spec.rb +16 -0
- data/zernio-sdk-0.0.666.gem +0 -0
- metadata +34 -18
- data/zernio-sdk-0.0.664.gem +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
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 ListSlackMembers200Response < ApiModelBase
|
|
18
|
+
attr_accessor :members
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'members' => :'members'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'members' => :'Array<ListSlackMembers200ResponseMembersInner>'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListSlackMembers200Response` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListSlackMembers200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'members')
|
|
67
|
+
if (value = attributes[:'members']).is_a?(Array)
|
|
68
|
+
self.members = value
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
invalid_properties
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Check to see if the all the properties in the model are valid
|
|
82
|
+
# @return true if the model is valid
|
|
83
|
+
def valid?
|
|
84
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
members == o.members
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @see the `==` method
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def eql?(o)
|
|
99
|
+
self == o
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Calculates hash code according to all attributes.
|
|
103
|
+
# @return [Integer] Hash code
|
|
104
|
+
def hash
|
|
105
|
+
[members].hash
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Builds the object from hash
|
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
110
|
+
# @return [Object] Returns the model itself
|
|
111
|
+
def self.build_from_hash(attributes)
|
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
114
|
+
transformed_hash = {}
|
|
115
|
+
openapi_types.each_pair do |key, type|
|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = nil
|
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
119
|
+
# check to ensure the input is an array given that the attribute
|
|
120
|
+
# is documented as an array but the input is not
|
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
123
|
+
end
|
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
new(transformed_hash)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Returns the object in the form of hash
|
|
132
|
+
# @return [Hash] Returns the object in the form of hash
|
|
133
|
+
def to_hash
|
|
134
|
+
hash = {}
|
|
135
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
136
|
+
value = self.send(attr)
|
|
137
|
+
if value.nil?
|
|
138
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
139
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
hash[param] = _to_hash(value)
|
|
143
|
+
end
|
|
144
|
+
hash
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
end
|
|
@@ -0,0 +1,180 @@
|
|
|
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 ListSlackMembers200ResponseMembersInner < ApiModelBase
|
|
18
|
+
# Slack member id (pass as participantId to start a DM).
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Display name
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# Slack handle
|
|
25
|
+
attr_accessor :username
|
|
26
|
+
|
|
27
|
+
# Avatar URL
|
|
28
|
+
attr_accessor :picture
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'id' => :'id',
|
|
34
|
+
:'name' => :'name',
|
|
35
|
+
:'username' => :'username',
|
|
36
|
+
:'picture' => :'picture'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'id' => :'String',
|
|
54
|
+
:'name' => :'String',
|
|
55
|
+
:'username' => :'String',
|
|
56
|
+
:'picture' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'username',
|
|
64
|
+
:'picture'
|
|
65
|
+
])
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Initializes the object
|
|
69
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
70
|
+
def initialize(attributes = {})
|
|
71
|
+
if (!attributes.is_a?(Hash))
|
|
72
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListSlackMembers200ResponseMembersInner` initialize method"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
76
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
78
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListSlackMembers200ResponseMembersInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
80
|
+
end
|
|
81
|
+
h[k.to_sym] = v
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'id')
|
|
85
|
+
self.id = attributes[:'id']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'name')
|
|
89
|
+
self.name = attributes[:'name']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'username')
|
|
93
|
+
self.username = attributes[:'username']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'picture')
|
|
97
|
+
self.picture = attributes[:'picture']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Checks equality by comparing each attribute.
|
|
117
|
+
# @param [Object] Object to be compared
|
|
118
|
+
def ==(o)
|
|
119
|
+
return true if self.equal?(o)
|
|
120
|
+
self.class == o.class &&
|
|
121
|
+
id == o.id &&
|
|
122
|
+
name == o.name &&
|
|
123
|
+
username == o.username &&
|
|
124
|
+
picture == o.picture
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# @see the `==` method
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def eql?(o)
|
|
130
|
+
self == o
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Calculates hash code according to all attributes.
|
|
134
|
+
# @return [Integer] Hash code
|
|
135
|
+
def hash
|
|
136
|
+
[id, name, username, picture].hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Builds the object from hash
|
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
141
|
+
# @return [Object] Returns the model itself
|
|
142
|
+
def self.build_from_hash(attributes)
|
|
143
|
+
return nil unless attributes.is_a?(Hash)
|
|
144
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
145
|
+
transformed_hash = {}
|
|
146
|
+
openapi_types.each_pair do |key, type|
|
|
147
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
148
|
+
transformed_hash["#{key}"] = nil
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
150
|
+
# check to ensure the input is an array given that the attribute
|
|
151
|
+
# is documented as an array but the input is not
|
|
152
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
153
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
154
|
+
end
|
|
155
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
156
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
new(transformed_hash)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Returns the object in the form of hash
|
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
|
164
|
+
def to_hash
|
|
165
|
+
hash = {}
|
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
167
|
+
value = self.send(attr)
|
|
168
|
+
if value.nil?
|
|
169
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
170
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
hash[param] = _to_hash(value)
|
|
174
|
+
end
|
|
175
|
+
hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, Flow prompts, location requests, voice-call buttons, and commerce messages (single product, product list, catalog, and carousel). When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object verbatim, so any payload that works against Meta directly will also work here. Use `buttons` / `quickReplies` for simple button replies (WhatsApp's `interactive.type: \"button\"`): the abstraction caps at 3 buttons and handles the auto-conversion for you. Use this field only for the types listed in the enum below. All interactive messages are session messages: they can only be sent inside the 24-hour customer service window opened by the user's last inbound message. Commerce types (`product`, `product_list`, `catalog_message`, and product carousels) require a Meta catalog connected to the WhatsApp Business Account in Commerce Manager. Media carousels (image/video cards) do not need a catalog. For `product`, `body` is optional (WhatsApp renders the product card itself) and `header` is not allowed (the product image is the header). For `product_list`, a `header` with `type: \"text\"` is required. For `carousel`, top-level `header`/`footer` are not supported; media goes on each card instead. For `voice_call`, the message renders WhatsApp's native call button; tapping it starts a voice call to your business number. Requires WhatsApp Business Calling to be enabled on the sending number. The optional `parameters.payload` string is echoed back on the `calls` webhook (as `cta_payload`) for attribution. For `location_request_message`, `action` may be omitted (we default it to `{ \"name\": \"send_location\" }`). WhatsApp renders a localized \"Send location\" button; the user's reply arrives as a regular location message in the conversation. For `catalog_message`, `action` may also be omitted (we default it to `{ \"name\": \"catalog_message\" }`). Tap events come back via the `message.received` webhook with `metadata.interactiveType` set to `list_reply` or `nfm_reply`. Carts submitted from commerce messages arrive as `metadata.order`; product inquiries arrive as `metadata.referredProduct`.
|
|
17
|
+
# WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, Flow prompts, location requests, voice-call buttons, and commerce messages (single product, product list, catalog, and carousel). When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object verbatim, so any payload that works against Meta directly will also work here. Use `buttons` / `quickReplies` for simple button replies (WhatsApp's `interactive.type: \"button\"`): the abstraction caps at 3 buttons and handles the auto-conversion for you. Use this field only for the types listed in the enum below. All interactive messages are session messages: they can only be sent inside the 24-hour customer service window opened by the user's last inbound message. Commerce types (`product`, `product_list`, `catalog_message`, and product carousels) require a Meta catalog connected to the WhatsApp Business Account in Commerce Manager. Media carousels (image/video cards) do not need a catalog. For `product`, `body` is optional (WhatsApp renders the product card itself) and `header` is not allowed (the product image is the header). For `product_list`, a `header` with `type: \"text\"` is required. For `carousel`, top-level `header`/`footer` are not supported; media goes on each card instead. For `voice_call`, the message renders WhatsApp's native call button; tapping it starts a voice call to your business number. Requires WhatsApp Business Calling to be enabled on the sending number. The optional `parameters.payload` string is echoed back on the `calls` webhook (as `cta_payload`) for attribution. For `location_request_message`, `action` may be omitted (we default it to `{ \"name\": \"send_location\" }`). WhatsApp renders a localized \"Send location\" button; the user's reply arrives as a regular location message in the conversation. For `request_contact_info`, `action` may be omitted (we default it to `{ \"name\": \"request_contact_info\" }`). WhatsApp renders a localized share button that cannot be relabelled, so put the reason for asking in `body.text`: this is a consent prompt, and a bare request converts badly. The reply arrives as an inbound `contacts` message with `metadata.contactsOrigin` set to `contact_request`, and we fold the shared number back into the contact automatically. A `contacts` message with origin `other` is a card the user picked from their address book and is NOT proof of their own number. For `catalog_message`, `action` may also be omitted (we default it to `{ \"name\": \"catalog_message\" }`). Tap events come back via the `message.received` webhook with `metadata.interactiveType` set to `list_reply` or `nfm_reply`. Carts submitted from commerce messages arrive as `metadata.order`; product inquiries arrive as `metadata.referredProduct`.
|
|
18
18
|
class SendInboxMessageRequestInteractive < ApiModelBase
|
|
19
19
|
# Which interactive layout to render.
|
|
20
20
|
attr_accessor :type
|
|
@@ -143,7 +143,7 @@ module Zernio
|
|
|
143
143
|
def valid?
|
|
144
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
145
145
|
return false if @type.nil?
|
|
146
|
-
type_validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
146
|
+
type_validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
147
147
|
return false unless type_validator.valid?(@type)
|
|
148
148
|
true
|
|
149
149
|
end
|
|
@@ -151,7 +151,7 @@ module Zernio
|
|
|
151
151
|
# Custom attribute writer method checking allowed values (enum).
|
|
152
152
|
# @param [Object] type Object to be assigned
|
|
153
153
|
def type=(type)
|
|
154
|
-
validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
154
|
+
validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
155
155
|
unless validator.valid?(type)
|
|
156
156
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
157
157
|
end
|
|
@@ -27,7 +27,8 @@ module Zernio
|
|
|
27
27
|
:'SendInboxMessageRequestInteractiveActionOneOf5',
|
|
28
28
|
:'SendInboxMessageRequestInteractiveActionOneOf6',
|
|
29
29
|
:'SendInboxMessageRequestInteractiveActionOneOf7',
|
|
30
|
-
:'SendInboxMessageRequestInteractiveActionOneOf8'
|
|
30
|
+
:'SendInboxMessageRequestInteractiveActionOneOf8',
|
|
31
|
+
:'SendInboxMessageRequestInteractiveActionOneOf9'
|
|
31
32
|
]
|
|
32
33
|
end
|
|
33
34
|
|
|
@@ -14,19 +14,36 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
#
|
|
17
|
+
# Contact-info request action. `type` on the parent must be `request_contact_info`. May be omitted entirely; it is defaulted.
|
|
18
18
|
class SendInboxMessageRequestInteractiveActionOneOf5 < ApiModelBase
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
class EnumAttributeValidator
|
|
22
|
+
attr_reader :datatype
|
|
23
|
+
attr_reader :allowable_values
|
|
24
|
+
|
|
25
|
+
def initialize(datatype, allowable_values)
|
|
26
|
+
@allowable_values = allowable_values.map do |value|
|
|
27
|
+
case datatype.to_s
|
|
28
|
+
when /Integer/i
|
|
29
|
+
value.to_i
|
|
30
|
+
when /Float/i
|
|
31
|
+
value.to_f
|
|
32
|
+
else
|
|
33
|
+
value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
21
37
|
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
def valid?(value)
|
|
39
|
+
!value || allowable_values.include?(value)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
24
42
|
|
|
25
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
44
|
def self.attribute_map
|
|
27
45
|
{
|
|
28
|
-
:'
|
|
29
|
-
:'product_retailer_id' => :'product_retailer_id'
|
|
46
|
+
:'name' => :'name'
|
|
30
47
|
}
|
|
31
48
|
end
|
|
32
49
|
|
|
@@ -43,8 +60,7 @@ module Zernio
|
|
|
43
60
|
# Attribute type mapping.
|
|
44
61
|
def self.openapi_types
|
|
45
62
|
{
|
|
46
|
-
:'
|
|
47
|
-
:'product_retailer_id' => :'String'
|
|
63
|
+
:'name' => :'String'
|
|
48
64
|
}
|
|
49
65
|
end
|
|
50
66
|
|
|
@@ -70,16 +86,10 @@ module Zernio
|
|
|
70
86
|
h[k.to_sym] = v
|
|
71
87
|
}
|
|
72
88
|
|
|
73
|
-
if attributes.key?(:'
|
|
74
|
-
self.
|
|
75
|
-
else
|
|
76
|
-
self.catalog_id = nil
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
if attributes.key?(:'product_retailer_id')
|
|
80
|
-
self.product_retailer_id = attributes[:'product_retailer_id']
|
|
89
|
+
if attributes.key?(:'name')
|
|
90
|
+
self.name = attributes[:'name']
|
|
81
91
|
else
|
|
82
|
-
self.
|
|
92
|
+
self.name = nil
|
|
83
93
|
end
|
|
84
94
|
end
|
|
85
95
|
|
|
@@ -88,12 +98,8 @@ module Zernio
|
|
|
88
98
|
def list_invalid_properties
|
|
89
99
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
100
|
invalid_properties = Array.new
|
|
91
|
-
if @
|
|
92
|
-
invalid_properties.push('invalid value for "
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
if @product_retailer_id.nil?
|
|
96
|
-
invalid_properties.push('invalid value for "product_retailer_id", product_retailer_id cannot be nil.')
|
|
101
|
+
if @name.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
97
103
|
end
|
|
98
104
|
|
|
99
105
|
invalid_properties
|
|
@@ -103,29 +109,20 @@ module Zernio
|
|
|
103
109
|
# @return true if the model is valid
|
|
104
110
|
def valid?
|
|
105
111
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
-
return false if @
|
|
107
|
-
|
|
112
|
+
return false if @name.nil?
|
|
113
|
+
name_validator = EnumAttributeValidator.new('String', ["request_contact_info"])
|
|
114
|
+
return false unless name_validator.valid?(@name)
|
|
108
115
|
true
|
|
109
116
|
end
|
|
110
117
|
|
|
111
|
-
# Custom attribute writer method
|
|
112
|
-
# @param [Object]
|
|
113
|
-
def
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
119
|
+
# @param [Object] name Object to be assigned
|
|
120
|
+
def name=(name)
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["request_contact_info"])
|
|
122
|
+
unless validator.valid?(name)
|
|
123
|
+
fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
|
|
116
124
|
end
|
|
117
|
-
|
|
118
|
-
@catalog_id = catalog_id
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
# Custom attribute writer method with validation
|
|
122
|
-
# @param [Object] product_retailer_id Value to be assigned
|
|
123
|
-
def product_retailer_id=(product_retailer_id)
|
|
124
|
-
if product_retailer_id.nil?
|
|
125
|
-
fail ArgumentError, 'product_retailer_id cannot be nil'
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
@product_retailer_id = product_retailer_id
|
|
125
|
+
@name = name
|
|
129
126
|
end
|
|
130
127
|
|
|
131
128
|
# Checks equality by comparing each attribute.
|
|
@@ -133,8 +130,7 @@ module Zernio
|
|
|
133
130
|
def ==(o)
|
|
134
131
|
return true if self.equal?(o)
|
|
135
132
|
self.class == o.class &&
|
|
136
|
-
|
|
137
|
-
product_retailer_id == o.product_retailer_id
|
|
133
|
+
name == o.name
|
|
138
134
|
end
|
|
139
135
|
|
|
140
136
|
# @see the `==` method
|
|
@@ -146,7 +142,7 @@ module Zernio
|
|
|
146
142
|
# Calculates hash code according to all attributes.
|
|
147
143
|
# @return [Integer] Hash code
|
|
148
144
|
def hash
|
|
149
|
-
[
|
|
145
|
+
[name].hash
|
|
150
146
|
end
|
|
151
147
|
|
|
152
148
|
# Builds the object from hash
|
|
@@ -14,19 +14,19 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
#
|
|
17
|
+
# Single-product action. `type` on the parent must be `product`. Requires a Meta catalog connected to the WhatsApp Business Account in Commerce Manager.
|
|
18
18
|
class SendInboxMessageRequestInteractiveActionOneOf6 < ApiModelBase
|
|
19
19
|
# Meta catalog ID connected to the WhatsApp Business Account.
|
|
20
20
|
attr_accessor :catalog_id
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
attr_accessor :
|
|
22
|
+
# Retailer ID (SKU) of the product inside the catalog.
|
|
23
|
+
attr_accessor :product_retailer_id
|
|
24
24
|
|
|
25
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
26
|
def self.attribute_map
|
|
27
27
|
{
|
|
28
28
|
:'catalog_id' => :'catalog_id',
|
|
29
|
-
:'
|
|
29
|
+
:'product_retailer_id' => :'product_retailer_id'
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ module Zernio
|
|
|
44
44
|
def self.openapi_types
|
|
45
45
|
{
|
|
46
46
|
:'catalog_id' => :'String',
|
|
47
|
-
:'
|
|
47
|
+
:'product_retailer_id' => :'String'
|
|
48
48
|
}
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -76,12 +76,10 @@ module Zernio
|
|
|
76
76
|
self.catalog_id = nil
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
if attributes.key?(:'
|
|
80
|
-
|
|
81
|
-
self.sections = value
|
|
82
|
-
end
|
|
79
|
+
if attributes.key?(:'product_retailer_id')
|
|
80
|
+
self.product_retailer_id = attributes[:'product_retailer_id']
|
|
83
81
|
else
|
|
84
|
-
self.
|
|
82
|
+
self.product_retailer_id = nil
|
|
85
83
|
end
|
|
86
84
|
end
|
|
87
85
|
|
|
@@ -94,16 +92,8 @@ module Zernio
|
|
|
94
92
|
invalid_properties.push('invalid value for "catalog_id", catalog_id cannot be nil.')
|
|
95
93
|
end
|
|
96
94
|
|
|
97
|
-
if @
|
|
98
|
-
invalid_properties.push('invalid value for "
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
if @sections.length > 10
|
|
102
|
-
invalid_properties.push('invalid value for "sections", number of items must be less than or equal to 10.')
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
if @sections.length < 1
|
|
106
|
-
invalid_properties.push('invalid value for "sections", number of items must be greater than or equal to 1.')
|
|
95
|
+
if @product_retailer_id.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "product_retailer_id", product_retailer_id cannot be nil.')
|
|
107
97
|
end
|
|
108
98
|
|
|
109
99
|
invalid_properties
|
|
@@ -114,9 +104,7 @@ module Zernio
|
|
|
114
104
|
def valid?
|
|
115
105
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
116
106
|
return false if @catalog_id.nil?
|
|
117
|
-
return false if @
|
|
118
|
-
return false if @sections.length > 10
|
|
119
|
-
return false if @sections.length < 1
|
|
107
|
+
return false if @product_retailer_id.nil?
|
|
120
108
|
true
|
|
121
109
|
end
|
|
122
110
|
|
|
@@ -131,21 +119,13 @@ module Zernio
|
|
|
131
119
|
end
|
|
132
120
|
|
|
133
121
|
# Custom attribute writer method with validation
|
|
134
|
-
# @param [Object]
|
|
135
|
-
def
|
|
136
|
-
if
|
|
137
|
-
fail ArgumentError, '
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
if sections.length > 10
|
|
141
|
-
fail ArgumentError, 'invalid value for "sections", number of items must be less than or equal to 10.'
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
if sections.length < 1
|
|
145
|
-
fail ArgumentError, 'invalid value for "sections", number of items must be greater than or equal to 1.'
|
|
122
|
+
# @param [Object] product_retailer_id Value to be assigned
|
|
123
|
+
def product_retailer_id=(product_retailer_id)
|
|
124
|
+
if product_retailer_id.nil?
|
|
125
|
+
fail ArgumentError, 'product_retailer_id cannot be nil'
|
|
146
126
|
end
|
|
147
127
|
|
|
148
|
-
@
|
|
128
|
+
@product_retailer_id = product_retailer_id
|
|
149
129
|
end
|
|
150
130
|
|
|
151
131
|
# Checks equality by comparing each attribute.
|
|
@@ -154,7 +134,7 @@ module Zernio
|
|
|
154
134
|
return true if self.equal?(o)
|
|
155
135
|
self.class == o.class &&
|
|
156
136
|
catalog_id == o.catalog_id &&
|
|
157
|
-
|
|
137
|
+
product_retailer_id == o.product_retailer_id
|
|
158
138
|
end
|
|
159
139
|
|
|
160
140
|
# @see the `==` method
|
|
@@ -166,7 +146,7 @@ module Zernio
|
|
|
166
146
|
# Calculates hash code according to all attributes.
|
|
167
147
|
# @return [Integer] Hash code
|
|
168
148
|
def hash
|
|
169
|
-
[catalog_id,
|
|
149
|
+
[catalog_id, product_retailer_id].hash
|
|
170
150
|
end
|
|
171
151
|
|
|
172
152
|
# Builds the object from hash
|