Class: Zavudev::Models::Message
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Zavudev::Models::Message
- Defined in:
- lib/zavudev/models/message.rb,
sig/zavudev/models/message.rbs
Overview
Instance Attribute Summary collapse
-
#channel ⇒ Symbol, Zavudev::Models::Channel
Delivery channel.
-
#content ⇒ Zavudev::Models::MessageContent?
Content for non-text message types (WhatsApp and Telegram).
-
#conversation_id ⇒ String?
ID of the conversation (inbox thread) this message belongs to.
-
#cost ⇒ Float?
Zavu platform charge in USD for this message.
-
#cost_provider ⇒ Float?
Carrier and delivery cost in USD.
-
#cost_total ⇒ Float?
Total cost in USD (platform charge + delivery cost).
- #created_at ⇒ Time
- #error_code ⇒ String?
- #error_message ⇒ String?
- #from ⇒ String?
- #id ⇒ String
-
#message_type ⇒ Symbol, Zavudev::Models::MessageType
Type of message.
- #metadata ⇒ Hash{Symbol=>String}?
-
#provider_message_id ⇒ String?
Message ID from the delivery provider.
- #sender_id ⇒ String?
- #status ⇒ Symbol, Zavudev::Models::MessageStatus
-
#text ⇒ String?
Text content or caption.
- #to ⇒ String
- #updated_at ⇒ Time?
Instance Method Summary collapse
-
#initialize(id:, channel:, created_at:, message_type:, status:, to:, content: nil, conversation_id: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see Message for more details.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(id:, channel:, created_at:, message_type:, status:, to:, content: nil, conversation_id: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil) ⇒ Object
Some parameter documentations has been truncated, see Zavudev::Models::Message for more details.
|
|
# File 'lib/zavudev/models/message.rb', line 130
|
Instance Attribute Details
#channel ⇒ Symbol, Zavudev::Models::Channel
Delivery channel. Use 'auto' for intelligent routing.
16 |
# File 'lib/zavudev/models/message.rb', line 16 required :channel, enum: -> { Zavudev::Channel } |
#content ⇒ Zavudev::Models::MessageContent?
Content for non-text message types (WhatsApp and Telegram).
58 |
# File 'lib/zavudev/models/message.rb', line 58 optional :content, -> { Zavudev::MessageContent } |
#conversation_id ⇒ String?
ID of the conversation (inbox thread) this message belongs to. Use it to build a
direct dashboard link:
https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}. Omitted only
on legacy messages created before conversation threading.
67 |
# File 'lib/zavudev/models/message.rb', line 67 optional :conversation_id, String, api_name: :conversationId |
#cost ⇒ Float?
Zavu platform charge in USD for this message. Messaging is billed against your plan's monthly limits plus usage-based overage.
74 |
# File 'lib/zavudev/models/message.rb', line 74 optional :cost, Float, nil?: true |
#cost_provider ⇒ Float?
Carrier and delivery cost in USD.
80 |
# File 'lib/zavudev/models/message.rb', line 80 optional :cost_provider, Float, api_name: :costProvider, nil?: true |
#cost_total ⇒ Float?
Total cost in USD (platform charge + delivery cost).
86 |
# File 'lib/zavudev/models/message.rb', line 86 optional :cost_total, Float, api_name: :costTotal, nil?: true |
#created_at ⇒ Time
21 |
# File 'lib/zavudev/models/message.rb', line 21 required :created_at, Time, api_name: :createdAt |
#error_code ⇒ String?
91 |
# File 'lib/zavudev/models/message.rb', line 91 optional :error_code, String, api_name: :errorCode, nil?: true |
#error_message ⇒ String?
96 |
# File 'lib/zavudev/models/message.rb', line 96 optional :error_message, String, api_name: :errorMessage, nil?: true |
#from ⇒ String?
101 |
# File 'lib/zavudev/models/message.rb', line 101 optional :from, String |
#id ⇒ String
10 |
# File 'lib/zavudev/models/message.rb', line 10 required :id, String |
#message_type ⇒ Symbol, Zavudev::Models::MessageType
Type of message. Non-text types are supported by WhatsApp and Telegram (varies by type).
location_request asks the recipient to share their location and is
WhatsApp-only. It takes no content object — the prompt goes in text (max
1024 characters) and the button label is fixed by WhatsApp. The recipient's
answer arrives as an inbound location message whose content.replyToMessageId
is the ID of the request.
request_contact_info asks the recipient to share their phone number and is
WhatsApp-only. Like location_request it takes no content object — the prompt
goes in text (max 1024 characters) and WhatsApp renders a fixed Share
Contact Info button. The answer arrives as an inbound contact message. Use
it to recover the phone number of a contact who adopted a WhatsApp username and
is only known by their business-scoped user ID (BSUID); when they share it, Zavu
automatically links the phone number to that contact.
42 |
# File 'lib/zavudev/models/message.rb', line 42 required :message_type, enum: -> { Zavudev::MessageType }, api_name: :messageType |
#metadata ⇒ Hash{Symbol=>String}?
106 |
# File 'lib/zavudev/models/message.rb', line 106 optional :metadata, Zavudev::Internal::Type::HashOf[String] |
#provider_message_id ⇒ String?
Message ID from the delivery provider.
112 |
# File 'lib/zavudev/models/message.rb', line 112 optional :provider_message_id, String, api_name: :providerMessageId |
#sender_id ⇒ String?
117 |
# File 'lib/zavudev/models/message.rb', line 117 optional :sender_id, String, api_name: :senderId |
#status ⇒ Symbol, Zavudev::Models::MessageStatus
47 |
# File 'lib/zavudev/models/message.rb', line 47 required :status, enum: -> { Zavudev::MessageStatus } |
#text ⇒ String?
Text content or caption.
123 |
# File 'lib/zavudev/models/message.rb', line 123 optional :text, String |
#to ⇒ String
52 |
# File 'lib/zavudev/models/message.rb', line 52 required :to, String |
#updated_at ⇒ Time?
128 |
# File 'lib/zavudev/models/message.rb', line 128 optional :updated_at, Time, api_name: :updatedAt |
Instance Method Details
#to_hash ⇒ {
103 |
# File 'sig/zavudev/models/message.rbs', line 103
def to_hash: -> {
|