Class: Courier::Models::Notifications::Previews::PreviewRun

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/courier/models/notifications/previews/preview_run.rb,
sig/courier/models/notifications/previews/preview_run.rbs

Overview

See Also:

  • Courier::Resources::Notifications::Previews::Runs#create

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 ⇒ Object



39
# File 'sig/courier/models/notifications/previews/preview_run.rbs', line 39

def initialize: (

Instance Attribute Details

#created_at ⇒ String

ISO-8601 timestamp of when the run was created.

Parameters:

  • value (String)

Returns:

  • (String)


19
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 19

required :created_at, String

#device_ids ⇒ Array<String>

The devices this run was submitted for, snapshotted when the run was created.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


25
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 25

required :device_ids, Courier::Internal::Type::ArrayOf[String]

#failure_reason ⇒ Symbol, ...

Why the run failed, when status is FAILED. NO_EMAIL_CHANNEL and TEMPLATE_NOT_SUPPORTED mean there was nothing to render; ALL_DEVICES_UNSUPPORTED means every requested device has been retired and the request can be fixed by choosing others.



49
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 49

optional :failure_reason, enum: -> { Courier::Notifications::Previews::PreviewRunFailureReason }

#id ⇒ String

Unique identifier for the preview run.

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 13

required :id, String

#status ⇒ Symbol, Courier::Models::Notifications::Previews::PreviewRunStatus

Where the run itself has got to. PENDING and RENDERED mean Courier is still preparing the email, SUBMITTED means it is with the rendering service, and COMPLETED means every device has reported. FAILED is the run as a whole failing — an individual device failing never fails the run.

Parameters:

  • value (Courier::Models::Notifications::Previews::preview_run_status)

Returns:



34
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 34

required :status, enum: -> { Courier::Notifications::Previews::PreviewRunStatus }

#template_id ⇒ String

The template that was rendered.

Parameters:

  • value (String)

Returns:

  • (String)


40
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 40

required :template_id, String

#template_version ⇒ String?

The version of the template that was rendered — draft, or a zero-padded published version such as v002. Absent until the render settles.

Parameters:

  • (String)

Returns:

  • (String, nil)


56
# File 'lib/courier/models/notifications/previews/preview_run.rb', line 56

optional :template_version, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


49
# File 'sig/courier/models/notifications/previews/preview_run.rbs', line 49

def to_hash: -> {