Class: Zavudev::Models::ConversationListResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/zavudev/models/conversation_list_response.rb,
sig/zavudev/models/conversation_list_response.rbs

Overview

See Also:

  • Zavudev::Resources::Conversations#list

Defined Under Namespace

Classes: Group, LastMessage, Whatsapp

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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:, participant_count: nil, subject: nil) ⇒ Object

Present when the thread is a group chat rather than a one-to-one conversation.

Parameters:

  • id (String)
  • participant_count (Integer) (defaults to: nil)
  • subject (String) (defaults to: nil)


# File 'lib/zavudev/models/conversation_list_response.rb', line 90

Instance Attribute Details

#channels ⇒ Array<String>

Every channel this thread has carried messages on.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


16
# File 'lib/zavudev/models/conversation_list_response.rb', line 16

required :channels, Zavudev::Internal::Type::ArrayOf[String]

#contact_id ⇒ String?

ID of the contact this thread belongs to. Absent on group threads and on threads whose contact has not been resolved yet.

Parameters:

  • (String)

Returns:

  • (String, nil)


63
# File 'lib/zavudev/models/conversation_list_response.rb', line 63

optional :contact_id, String, api_name: :contactId

#contact_identifier ⇒ String

The key this thread is filed under: a phone number in E.164, a WhatsApp business-scoped user ID (BSUID), a numeric chat ID (Telegram/Instagram/Messenger), or a group JID. It is not always a phone number, so do not parse it as one.

Parameters:

  • value (String)

Returns:

  • (String)


25
# File 'lib/zavudev/models/conversation_list_response.rb', line 25

required :contact_identifier, String, api_name: :contactIdentifier

#created_at ⇒ Time

Parameters:

  • value (Time)

Returns:

  • (Time)


30
# File 'lib/zavudev/models/conversation_list_response.rb', line 30

required :created_at, Time, api_name: :createdAt

#email ⇒ String?

Email address of the thread, when the contact was reached by email.

Parameters:

  • (String)

Returns:

  • (String, nil)


69
# File 'lib/zavudev/models/conversation_list_response.rb', line 69

optional :email, String

#group ⇒ Zavudev::Models::ConversationListResponse::Group?

Present when the thread is a group chat rather than a one-to-one conversation.



75
# File 'lib/zavudev/models/conversation_list_response.rb', line 75

optional :group, -> { Zavudev::Models::ConversationListResponse::Group }

#id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/zavudev/models/conversation_list_response.rb', line 10

required :id, String

#last_message ⇒ Zavudev::Models::ConversationListResponse::LastMessage

Denormalized preview of the most recent message, so a thread list needs no extra fetch.



37
38
39
# File 'lib/zavudev/models/conversation_list_response.rb', line 37

required :last_message,
-> { Zavudev::Models::ConversationListResponse::LastMessage },
api_name: :lastMessage

#message_count ⇒ Integer

Parameters:

  • value (Integer)

Returns:

  • (Integer)


44
# File 'lib/zavudev/models/conversation_list_response.rb', line 44

required :message_count, Integer, api_name: :messageCount

#sender_id ⇒ String?

Sender that last handled this thread. Use it as the Zavu-Sender header when replying so the answer leaves from the same number the contact knows.

Parameters:

  • (String)

Returns:

  • (String, nil)


82
# File 'lib/zavudev/models/conversation_list_response.rb', line 82

optional :sender_id, String, api_name: :senderId

#unread_count ⇒ Integer

Inbound messages not yet marked read. Reset with POST /v1/conversations/conversationId/read.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


51
# File 'lib/zavudev/models/conversation_list_response.rb', line 51

required :unread_count, Integer, api_name: :unreadCount

#updated_at ⇒ Time

Parameters:

  • value (Time)

Returns:

  • (Time)


56
# File 'lib/zavudev/models/conversation_list_response.rb', line 56

required :updated_at, Time, api_name: :updatedAt

#whatsapp ⇒ Zavudev::Models::ConversationListResponse::Whatsapp?

WhatsApp identity, present when the contact adopted a username.



88
# File 'lib/zavudev/models/conversation_list_response.rb', line 88

optional :whatsapp, -> { Zavudev::Models::ConversationListResponse::Whatsapp }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/zavudev/models/conversation_list_response.rb', line 174

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


77
# File 'sig/zavudev/models/conversation_list_response.rbs', line 77

def to_hash: -> {