Class: Courier::Models::Notifications::Previews::PreviewRunDetail

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

Overview

See Also:

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

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



42
# File 'sig/courier/models/notifications/previews/preview_run_detail.rbs', line 42

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_detail.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_detail.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.



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

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_detail.rb', line 13

required :id, String

#results ⇒ Array<Courier::Models::Notifications::Previews::PreviewResult>

One entry per device in device_ids.

Parameters:

  • value (::Array[Courier::Notifications::Previews::PreviewResult])

Returns:



31
32
# File 'lib/courier/models/notifications/previews/preview_run_detail.rb', line 31

required :results,
-> { Courier::Internal::Type::ArrayOf[Courier::Notifications::Previews::PreviewResult] }

#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:



41
# File 'lib/courier/models/notifications/previews/preview_run_detail.rb', line 41

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

#template_id ⇒ String

The template that was rendered.

Parameters:

  • value (String)

Returns:

  • (String)


47
# File 'lib/courier/models/notifications/previews/preview_run_detail.rb', line 47

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)


63
# File 'lib/courier/models/notifications/previews/preview_run_detail.rb', line 63

optional :template_version, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


53
# File 'sig/courier/models/notifications/previews/preview_run_detail.rbs', line 53

def to_hash: -> {