Class: Notiflows::Models::Notification

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/notiflows/models/notification.rb

Overview

Defined Under Namespace

Modules: Status

Instance Attribute 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:, created_at:, data:, notiflow_id:, notiflow_run_id:, recipient_id:, status:, updated_at:, actor: nil, actor_id: nil, deliveries: nil, processed_at: nil, recipient: nil, topic: nil) ⇒ Object

Some parameter documentations has been truncated, see Notiflows::Models::Notification for more details.

A notification sent to a recipient through a notiflow run

Parameters:

  • id (String) —

    Notification ID

  • created_at (Time) —

    When the notification was created

  • data (Object) —

    Template variables passed when running the notiflow

  • notiflow_id (String) —

    ID of the notiflow that generated this notification

  • notiflow_run_id (String) —

    ID of the specific notiflow run

  • recipient_id (String) —

    Internal ID of the recipient user

  • status (Symbol, Notiflows::Models::Notification::Status) —

    Notification processing status:

  • updated_at (Time) —

    When the notification was last updated

  • actor (Notiflows::Models::User, nil) (defaults to: nil) —

    A user (recipient) in your project

  • actor_id (String, nil) (defaults to: nil) —

    Internal ID of the actor (user who triggered the notification)

  • deliveries (Array<Notiflows::Models::Delivery>) (defaults to: nil) —

    Delivery attempts for this notification (when expanded)

  • processed_at (Time, nil) (defaults to: nil) —

    When the notification was processed

  • recipient (Notiflows::Models::User) (defaults to: nil) —

    A user (recipient) in your project

  • topic (String, nil) (defaults to: nil) —

    Topic name if triggered via topic



# File 'lib/notiflows/models/notification.rb', line 96

Instance Attribute Details

#actor ⇒ Notiflows::Models::User?

A user (recipient) in your project

Returns:



64
# File 'lib/notiflows/models/notification.rb', line 64

optional :actor, -> { Notiflows::User }, nil?: true

#actor_id ⇒ String?

Internal ID of the actor (user who triggered the notification)

Returns:

  • (String, nil)


70
# File 'lib/notiflows/models/notification.rb', line 70

optional :actor_id, String, nil?: true

#created_at ⇒ Time

When the notification was created

Returns:

  • (Time)


17
# File 'lib/notiflows/models/notification.rb', line 17

required :created_at, Time

#data ⇒ Object

Template variables passed when running the notiflow

Returns:

  • (Object)


23
# File 'lib/notiflows/models/notification.rb', line 23

required :data, Notiflows::Internal::Type::Unknown

#deliveries ⇒ Array<Notiflows::Models::Delivery>?

Delivery attempts for this notification (when expanded)

Returns:



76
# File 'lib/notiflows/models/notification.rb', line 76

optional :deliveries, -> { Notiflows::Internal::Type::ArrayOf[Notiflows::Delivery] }

#id ⇒ String

Notification ID

Returns:

  • (String)


11
# File 'lib/notiflows/models/notification.rb', line 11

required :id, String

#notiflow_id ⇒ String

ID of the notiflow that generated this notification

Returns:

  • (String)


29
# File 'lib/notiflows/models/notification.rb', line 29

required :notiflow_id, String

#notiflow_run_id ⇒ String

ID of the specific notiflow run

Returns:

  • (String)


35
# File 'lib/notiflows/models/notification.rb', line 35

required :notiflow_run_id, String

#processed_at ⇒ Time?

When the notification was processed

Returns:

  • (Time, nil)


82
# File 'lib/notiflows/models/notification.rb', line 82

optional :processed_at, Time, nil?: true

#recipient ⇒ Notiflows::Models::User?

A user (recipient) in your project

Returns:



88
# File 'lib/notiflows/models/notification.rb', line 88

optional :recipient, -> { Notiflows::User }

#recipient_id ⇒ String

Internal ID of the recipient user

Returns:

  • (String)


41
# File 'lib/notiflows/models/notification.rb', line 41

required :recipient_id, String

#status ⇒ Symbol, Notiflows::Models::Notification::Status

Notification processing status:

  • pending: Queued for processing
  • processing: Currently being processed
  • processed: Successfully processed (deliveries created)
  • failed: Processing failed


52
# File 'lib/notiflows/models/notification.rb', line 52

required :status, enum: -> { Notiflows::Notification::Status }

#topic ⇒ String?

Topic name if triggered via topic

Returns:

  • (String, nil)


94
# File 'lib/notiflows/models/notification.rb', line 94

optional :topic, String, nil?: true

#updated_at ⇒ Time

When the notification was last updated

Returns:

  • (Time)


58
# File 'lib/notiflows/models/notification.rb', line 58

required :updated_at, Time