Class: Zernio::WebhookPayloadMessageMetadata
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::WebhookPayloadMessageMetadata
- Defined in:
- lib/zernio-sdk/models/webhook_payload_message_metadata.rb
Overview
Platform-specific message context (present when the message is a quick reply tap, postback button tap, inline keyboard callback, a quote-reply to an earlier message, a WhatsApp inbound that Meta Business Agent is answering, or a TikTok DM that is not plain text)
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#button_payload ⇒ Object
WhatsApp only.
-
#callback_data ⇒ Object
Callback data from an inline keyboard button tap (Telegram).
-
#contacts ⇒ Object
WhatsApp only.
-
#contacts_origin ⇒ Object
WhatsApp only.
-
#flow_response_data ⇒ Object
WhatsApp only.
-
#flow_response_json ⇒ Object
WhatsApp only.
-
#interactive_id ⇒ Object
WhatsApp only.
-
#interactive_type ⇒ Object
WhatsApp only.
-
#is_story_mention ⇒ Object
Instagram only.
-
#location ⇒ Object
Returns the value of attribute location.
-
#nfm_reply_name ⇒ Object
WhatsApp only.
-
#no_renderable_content ⇒ Object
Instagram / Facebook Messenger only.
-
#order ⇒ Object
Returns the value of attribute order.
-
#postback_payload ⇒ Object
Payload from a postback button tap (Facebook/Instagram Messenger).
-
#postback_title ⇒ Object
Title of the tapped postback button (Facebook/Instagram Messenger).
-
#quick_reply_payload ⇒ Object
Payload from a quick reply tap (Facebook/Instagram Messenger).
-
#quoted_message ⇒ Object
Returns the value of attribute quoted_message.
-
#quoted_message_id ⇒ Object
Raw platform envelope id (WhatsApp
context.id; Instagram and Facebook Messengerreply_to.mid) of the message this one is a quote-reply to, forwarded verbatim. -
#referral ⇒ Object
Returns the value of attribute referral.
-
#referred_product ⇒ Object
Returns the value of attribute referred_product.
-
#standby ⇒ Object
WhatsApp only.
-
#story_reply ⇒ Object
Returns the value of attribute story_reply.
-
#tiktok_message_type ⇒ Object
TikTok only.
-
#unsupported ⇒ Object
Returns the value of attribute unsupported.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WebhookPayloadMessageMetadata
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ WebhookPayloadMessageMetadata
Initializes the object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 184 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadMessageMetadata` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadMessageMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'standby') self.standby = attributes[:'standby'] end if attributes.key?(:'quoted_message_id') self. = attributes[:'quoted_message_id'] end if attributes.key?(:'quoted_message') self. = attributes[:'quoted_message'] end if attributes.key?(:'quick_reply_payload') self.quick_reply_payload = attributes[:'quick_reply_payload'] end if attributes.key?(:'postback_payload') self.postback_payload = attributes[:'postback_payload'] end if attributes.key?(:'postback_title') self.postback_title = attributes[:'postback_title'] end if attributes.key?(:'callback_data') self.callback_data = attributes[:'callback_data'] end if attributes.key?(:'interactive_type') self.interactive_type = attributes[:'interactive_type'] end if attributes.key?(:'interactive_id') self.interactive_id = attributes[:'interactive_id'] end if attributes.key?(:'button_payload') self. = attributes[:'button_payload'] end if attributes.key?(:'flow_response_json') self.flow_response_json = attributes[:'flow_response_json'] end if attributes.key?(:'flow_response_data') if (value = attributes[:'flow_response_data']).is_a?(Hash) self.flow_response_data = value end end if attributes.key?(:'nfm_reply_name') self.nfm_reply_name = attributes[:'nfm_reply_name'] end if attributes.key?(:'order') self.order = attributes[:'order'] end if attributes.key?(:'referred_product') self.referred_product = attributes[:'referred_product'] end if attributes.key?(:'location') self.location = attributes[:'location'] end if attributes.key?(:'contacts') if (value = attributes[:'contacts']).is_a?(Array) self.contacts = value end end if attributes.key?(:'contacts_origin') self.contacts_origin = attributes[:'contacts_origin'] end if attributes.key?(:'story_reply') self.story_reply = attributes[:'story_reply'] end if attributes.key?(:'is_story_mention') self.is_story_mention = attributes[:'is_story_mention'] end if attributes.key?(:'referral') self.referral = attributes[:'referral'] end if attributes.key?(:'unsupported') self.unsupported = attributes[:'unsupported'] end if attributes.key?(:'no_renderable_content') self.no_renderable_content = attributes[:'no_renderable_content'] end if attributes.key?(:'tiktok_message_type') self. = attributes[:'tiktok_message_type'] end end |
Instance Attribute Details
#button_payload ⇒ Object
WhatsApp only. Payload attached to a tapped template button. Template buttons emit a plain button webhook (not an interactive reply), so interactiveType is empty while this field is populated.
46 47 48 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 46 def @button_payload end |
#callback_data ⇒ Object
Callback data from an inline keyboard button tap (Telegram).
37 38 39 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 37 def callback_data @callback_data end |
#contacts ⇒ Object
WhatsApp only. Contact cards the user shared, forwarded verbatim from Meta. Read contactsOrigin before treating any number here as the sender's own.
64 65 66 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 64 def contacts @contacts end |
#contacts_origin ⇒ Object
WhatsApp only. How the contact card was shared. contact_request means the user tapped a request_contact_info button, so the number is their own and consented. other means they picked a card from their address book: it may be anyone's, and must NOT be stored as the sender's identity. Omitted when Meta sends no origin.
67 68 69 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 67 def contacts_origin @contacts_origin end |
#flow_response_data ⇒ Object
WhatsApp only. Parsed Flow response JSON. Populated when flowResponseJson is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted. An address_message submission (nfmReplyName: address_message) carries the address fields (name, address, city, state, in_pin_code, ...), either at the top level or nested under values; read both.
52 53 54 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 52 def flow_response_data @flow_response_data end |
#flow_response_json ⇒ Object
WhatsApp only. Raw nfm_reply.response_json string returned by a Flow submission. Useful if you need the exact wire payload; for typed access use flowResponseData instead.
49 50 51 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 49 def flow_response_json @flow_response_json end |
#interactive_id ⇒ Object
WhatsApp only. The id of the tapped button or list row, matching the id you supplied when the message was sent. Not set for Flow responses.
43 44 45 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 43 def interactive_id @interactive_id end |
#interactive_type ⇒ Object
WhatsApp only. Which kind of interactive reply the user sent: button_reply (tap on an interactive button), list_reply (tap on a list row), or nfm_reply (a WhatsApp Flow submission or an address_message submission, see nfmReplyName).
40 41 42 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 40 def interactive_type @interactive_type end |
#is_story_mention ⇒ Object
Instagram only. True when the message was generated by an IG user mentioning the account in their own story (story_mention attachment type). Mutually exclusive in practice with storyReply.
72 73 74 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 72 def is_story_mention @is_story_mention end |
#location ⇒ Object
Returns the value of attribute location.
61 62 63 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 61 def location @location end |
#nfm_reply_name ⇒ Object
WhatsApp only. nfm_reply.name as Meta sent it, e.g. flow or address_message. Address submissions share the nfm_reply envelope with Flow submissions and are otherwise indistinguishable in flowResponseData; use this field to tell them apart.
55 56 57 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 55 def nfm_reply_name @nfm_reply_name end |
#no_renderable_content ⇒ Object
Instagram / Facebook Messenger only. Set when the message carries nothing an integrator can render (a template attachment with no text and no parseable content, or Meta's own is_unsupported flag). Sibling of unsupported above (WhatsApp only, carries Meta's error code/title/details): this field has no error envelope, only the boolean. Absence means "not flagged", never "checked and renderable".
79 80 81 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 79 def no_renderable_content @no_renderable_content end |
#order ⇒ Object
Returns the value of attribute order.
57 58 59 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 57 def order @order end |
#postback_payload ⇒ Object
Payload from a postback button tap (Facebook/Instagram Messenger).
31 32 33 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 31 def postback_payload @postback_payload end |
#postback_title ⇒ Object
Title of the tapped postback button (Facebook/Instagram Messenger).
34 35 36 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 34 def postback_title @postback_title end |
#quick_reply_payload ⇒ Object
Payload from a quick reply tap (Facebook/Instagram Messenger).
28 29 30 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 28 def quick_reply_payload @quick_reply_payload end |
#quoted_message ⇒ Object
Returns the value of attribute quoted_message.
25 26 27 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 25 def @quoted_message end |
#quoted_message_id ⇒ Object
Raw platform envelope id (WhatsApp context.id; Instagram and Facebook Messenger reply_to.mid) of the message this one is a quote-reply to, forwarded verbatim. It may not equal the stored id of that message (see quotedMessage.platformMessageId). On outgoing messages the same field appears on message.sent, but only on some surfaces: see WebhookPayloadMessageSent.metadata.quotedMessageId.
23 24 25 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 23 def @quoted_message_id end |
#referral ⇒ Object
Returns the value of attribute referral.
74 75 76 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 74 def referral @referral end |
#referred_product ⇒ Object
Returns the value of attribute referred_product.
59 60 61 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 59 def referred_product @referred_product end |
#standby ⇒ Object
WhatsApp only. true when this inbound arrived while Meta Business Agent held the conversation: the agent answers it, and Zernio only observes. Sending a reply takes control back. See conversation.control_changed.
20 21 22 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 20 def standby @standby end |
#story_reply ⇒ Object
Returns the value of attribute story_reply.
69 70 71 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 69 def story_reply @story_reply end |
#tiktok_message_type ⇒ Object
TikTok only. The message type as TikTok reports it, forwarded verbatim (for example image, video, sticker, share_post, emoji, reaction, template). Present on every TikTok DM that is not plain text; those arrive with text empty and, for image, video, share_post, sticker and emoji, an attachment (share_post as type share with the embed url and payload.videoId; sticker/emoji as type sticker, url signed and expiring).
82 83 84 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 82 def @tiktok_message_type end |
#unsupported ⇒ Object
Returns the value of attribute unsupported.
76 77 78 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 76 def unsupported @unsupported end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
137 138 139 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 137 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
142 143 144 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 142 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 107 def self.attribute_map { :'standby' => :'standby', :'quoted_message_id' => :'quotedMessageId', :'quoted_message' => :'quotedMessage', :'quick_reply_payload' => :'quickReplyPayload', :'postback_payload' => :'postbackPayload', :'postback_title' => :'postbackTitle', :'callback_data' => :'callbackData', :'interactive_type' => :'interactiveType', :'interactive_id' => :'interactiveId', :'button_payload' => :'buttonPayload', :'flow_response_json' => :'flowResponseJson', :'flow_response_data' => :'flowResponseData', :'nfm_reply_name' => :'nfmReplyName', :'order' => :'order', :'referred_product' => :'referredProduct', :'location' => :'location', :'contacts' => :'contacts', :'contacts_origin' => :'contactsOrigin', :'story_reply' => :'storyReply', :'is_story_mention' => :'isStoryMention', :'referral' => :'referral', :'unsupported' => :'unsupported', :'no_renderable_content' => :'noRenderableContent', :'tiktok_message_type' => :'tiktokMessageType' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 384 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
177 178 179 180 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 177 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 147 def self.openapi_types { :'standby' => :'Boolean', :'quoted_message_id' => :'String', :'quoted_message' => :'WebhookPayloadMessageMetadataQuotedMessage', :'quick_reply_payload' => :'String', :'postback_payload' => :'String', :'postback_title' => :'String', :'callback_data' => :'String', :'interactive_type' => :'String', :'interactive_id' => :'String', :'button_payload' => :'String', :'flow_response_json' => :'String', :'flow_response_data' => :'Hash<String, Object>', :'nfm_reply_name' => :'String', :'order' => :'WebhookPayloadMessageMetadataOrder', :'referred_product' => :'WebhookPayloadMessageMetadataReferredProduct', :'location' => :'WebhookPayloadMessageMetadataLocation', :'contacts' => :'Array<Hash<String, Object>>', :'contacts_origin' => :'String', :'story_reply' => :'WebhookPayloadMessageMetadataStoryReply', :'is_story_mention' => :'Boolean', :'referral' => :'WebhookPayloadMessageMetadataReferral', :'unsupported' => :'WebhookPayloadMessageMetadataUnsupported', :'no_renderable_content' => :'Boolean', :'tiktok_message_type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 340 def ==(o) return true if self.equal?(o) self.class == o.class && standby == o.standby && == o. && == o. && quick_reply_payload == o.quick_reply_payload && postback_payload == o.postback_payload && postback_title == o.postback_title && callback_data == o.callback_data && interactive_type == o.interactive_type && interactive_id == o.interactive_id && == o. && flow_response_json == o.flow_response_json && flow_response_data == o.flow_response_data && nfm_reply_name == o.nfm_reply_name && order == o.order && referred_product == o.referred_product && location == o.location && contacts == o.contacts && contacts_origin == o.contacts_origin && story_reply == o.story_reply && is_story_mention == o.is_story_mention && referral == o.referral && unsupported == o.unsupported && no_renderable_content == o.no_renderable_content && == o. end |
#eql?(o) ⇒ Boolean
371 372 373 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 371 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
377 378 379 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 377 def hash [standby, , , quick_reply_payload, postback_payload, postback_title, callback_data, interactive_type, interactive_id, , flow_response_json, flow_response_data, nfm_reply_name, order, referred_product, location, contacts, contacts_origin, story_reply, is_story_mention, referral, unsupported, no_renderable_content, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
301 302 303 304 305 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 301 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 406 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
309 310 311 312 313 314 315 316 |
# File 'lib/zernio-sdk/models/webhook_payload_message_metadata.rb', line 309 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' interactive_type_validator = EnumAttributeValidator.new('String', ["button_reply", "list_reply", "nfm_reply"]) return false unless interactive_type_validator.valid?(@interactive_type) contacts_origin_validator = EnumAttributeValidator.new('String', ["contact_request", "other"]) return false unless contacts_origin_validator.valid?(@contacts_origin) true end |