Class: Knockapi::Models::Message

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/knockapi/models/message.rb

Overview

Defined Under Namespace

Modules: EngagementStatus, Status Classes: Channel, Source

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:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) ⇒ Object

Some parameter documentations has been truncated, see Knockapi::Models::Message for more details.

Represents a single message that was generated by a workflow for a given channel.

Parameters:

  • id (String)

    The unique identifier for the message.

  • _typename (String)

    The typename of the schema.

  • channel_id (String)

    Deprecated, use channel.id instead.

  • engagement_statuses (Array<Symbol, Knockapi::Models::Message::EngagementStatus>)

    A list of engagement statuses.

  • inserted_at (Time)

    Timestamp when the resource was created.

  • recipient (String, Knockapi::Models::RecipientReference::ObjectReference)

    A reference to a recipient, either a user identifier (string) or an object refer

  • source (Knockapi::Models::Message::Source)

    The workflow or guide that triggered the message.

  • status (Symbol, Knockapi::Models::Message::Status)

    The message delivery status.

  • updated_at (Time)

    The timestamp when the resource was last updated.

  • actors (Array<String, Knockapi::Models::RecipientReference::ObjectReference>) (defaults to: nil)

    One or more actors that are associated with this message. Note: this is a list t

  • archived_at (Time, nil) (defaults to: nil)

    Timestamp when the message was archived.

  • channel (Knockapi::Models::Message::Channel) (defaults to: nil)

    A configured channel, which is a way to route messages to a provider.

  • clicked_at (Time, nil) (defaults to: nil)

    Timestamp when the message was clicked.

  • data (Hash{Symbol=>Object}, nil) (defaults to: nil)

    Data associated with the message’s workflow run. Includes the workflow trigger r

  • interacted_at (Time, nil) (defaults to: nil)

    Timestamp when the message was interacted with.

  • link_clicked_at (Time, nil) (defaults to: nil)

    Timestamp when a link in the message was clicked.

  • metadata (Hash{Symbol=>Object}, nil) (defaults to: nil)

    The metadata associated with the message.

  • read_at (Time, nil) (defaults to: nil)

    Timestamp when the message was read.

  • scheduled_at (Time, nil) (defaults to: nil)

    Timestamp when the message was scheduled to be sent.

  • seen_at (Time, nil) (defaults to: nil)

    Timestamp when the message was seen.

  • tenant (String, nil) (defaults to: nil)

    The ID of the ‘tenant` associated with the message. Only present when a `tenant`

  • workflow (String, nil) (defaults to: nil)

    The key of the workflow that generated the message.



# File 'lib/knockapi/models/message.rb', line 152


Instance Attribute Details

#_typenameString

The typename of the schema.

Returns:

  • (String)


17
# File 'lib/knockapi/models/message.rb', line 17

required :_typename, String, api_name: :__typename

#actorsArray<String, Knockapi::Models::RecipientReference::ObjectReference>?

One or more actors that are associated with this message. Note: this is a list that can contain up to 10 actors if the message is produced from a [batch](/designing-workflows/batch-function).



71
# File 'lib/knockapi/models/message.rb', line 71

optional :actors, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] }

#archived_atTime?

Timestamp when the message was archived.

Returns:

  • (Time, nil)


77
# File 'lib/knockapi/models/message.rb', line 77

optional :archived_at, Time, nil?: true

#channelKnockapi::Models::Message::Channel?

A configured channel, which is a way to route messages to a provider.



83
# File 'lib/knockapi/models/message.rb', line 83

optional :channel, -> { Knockapi::Message::Channel }

#channel_idString

Deprecated.

Deprecated, use channel.id instead.

Returns:

  • (String)


25
# File 'lib/knockapi/models/message.rb', line 25

required :channel_id, String

#clicked_atTime?

Timestamp when the message was clicked.

Returns:

  • (Time, nil)


89
# File 'lib/knockapi/models/message.rb', line 89

optional :clicked_at, Time, nil?: true

#dataHash{Symbol=>Object}?

Data associated with the message’s workflow run. Includes the workflow trigger request’s ‘data` payload merged with any additional data returned by a [fetch function](/designing-workflows/fetch-function). For messages produced after a [batch step](/designing-workflows/batch-function), includes the payload `data` from the most-recent trigger request (the final `activity` in the batch).

Returns:



99
# File 'lib/knockapi/models/message.rb', line 99

optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true

#engagement_statusesArray<Symbol, Knockapi::Models::Message::EngagementStatus>

A list of engagement statuses.



31
32
# File 'lib/knockapi/models/message.rb', line 31

required :engagement_statuses,
-> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Message::EngagementStatus] }

#idString

The unique identifier for the message.

Returns:

  • (String)


11
# File 'lib/knockapi/models/message.rb', line 11

required :id, String

#inserted_atTime

Timestamp when the resource was created.

Returns:

  • (Time)


38
# File 'lib/knockapi/models/message.rb', line 38

required :inserted_at, Time

#interacted_atTime?

Timestamp when the message was interacted with.

Returns:

  • (Time, nil)


105
# File 'lib/knockapi/models/message.rb', line 105

optional :interacted_at, Time, nil?: true

Timestamp when a link in the message was clicked.

Returns:

  • (Time, nil)


111
# File 'lib/knockapi/models/message.rb', line 111

optional :link_clicked_at, Time, nil?: true

#metadataHash{Symbol=>Object}?

The metadata associated with the message.

Returns:



117
# File 'lib/knockapi/models/message.rb', line 117

optional :metadata, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true

#read_atTime?

Timestamp when the message was read.

Returns:

  • (Time, nil)


123
# File 'lib/knockapi/models/message.rb', line 123

optional :read_at, Time, nil?: true

#recipientString, Knockapi::Models::RecipientReference::ObjectReference

A reference to a recipient, either a user identifier (string) or an object reference (ID, collection).



45
# File 'lib/knockapi/models/message.rb', line 45

required :recipient, union: -> { Knockapi::RecipientReference }

#scheduled_atTime?

Timestamp when the message was scheduled to be sent.

Returns:

  • (Time, nil)


129
# File 'lib/knockapi/models/message.rb', line 129

optional :scheduled_at, Time, nil?: true

#seen_atTime?

Timestamp when the message was seen.

Returns:

  • (Time, nil)


135
# File 'lib/knockapi/models/message.rb', line 135

optional :seen_at, Time, nil?: true

#sourceKnockapi::Models::Message::Source

The workflow or guide that triggered the message.



51
# File 'lib/knockapi/models/message.rb', line 51

required :source, -> { Knockapi::Message::Source }

#statusSymbol, Knockapi::Models::Message::Status

The message delivery status.



57
# File 'lib/knockapi/models/message.rb', line 57

required :status, enum: -> { Knockapi::Message::Status }

#tenantString?

The ID of the ‘tenant` associated with the message. Only present when a `tenant` is provided on a workflow trigger request.

Returns:

  • (String, nil)


142
# File 'lib/knockapi/models/message.rb', line 142

optional :tenant, String, nil?: true

#updated_atTime

The timestamp when the resource was last updated.

Returns:

  • (Time)


63
# File 'lib/knockapi/models/message.rb', line 63

required :updated_at, Time

#workflowString?

Deprecated.

The key of the workflow that generated the message.

Returns:

  • (String, nil)


150
# File 'lib/knockapi/models/message.rb', line 150

optional :workflow, String, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/knockapi/models/message.rb', line 214