Class: Courier::Models::Notifications::Previews::CreatePreviewRunRequest

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

Direct Known Subclasses

RunCreateParams

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(data: nil, device_ids: nil, device_set_id: nil, locale: nil, template_version: nil) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::Notifications::Previews::CreatePreviewRunRequest for more details.

Request body for creating a preview run of the template in the path. Provide exactly one of device_set_id or device_ids. The template is the path's {id}; a template_id here is an unknown key and a 400.

Parameters:

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

    Template variables to render with, the same shape as the data object on a send

  • device_ids (Array<String>) (defaults to: nil) —

    The devices to render on, by PreviewDevice.id, for a one-off run. Mutually exc

  • device_set_id (String) (defaults to: nil) —

    A saved device set naming the devices to render on. Mutually exclusive with `dev

  • locale (String) (defaults to: nil) —

    Render the template's content for this locale, e.g. "fr-FR".

  • template_version (String) (defaults to: nil) —

    Which version of the template to render. Omit for the latest saved draft, which



# File 'lib/courier/models/notifications/previews/create_preview_run_request.rb', line 46

Instance Attribute Details

#data ⇒ Hash{Symbol=>Object}?

Template variables to render with, the same shape as the data object on a send.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


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

optional :data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]

#device_ids ⇒ Array<String>?

The devices to render on, by PreviewDevice.id, for a one-off run. Mutually exclusive with device_set_id.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


20
# File 'lib/courier/models/notifications/previews/create_preview_run_request.rb', line 20

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

#device_set_id ⇒ String?

A saved device set naming the devices to render on. Mutually exclusive with device_ids.

Parameters:

  • (String)

Returns:

  • (String, nil)


27
# File 'lib/courier/models/notifications/previews/create_preview_run_request.rb', line 27

optional :device_set_id, String

#locale ⇒ String?

Render the template's content for this locale, e.g. "fr-FR".

Parameters:

  • (String)

Returns:

  • (String, nil)


33
# File 'lib/courier/models/notifications/previews/create_preview_run_request.rb', line 33

optional :locale, String

#template_version ⇒ String?

Which version of the template to render. Omit for the latest saved draft, which always exists and is what the editor shows. published renders the live version; a zero-padded v002 renders that specific publish. Versions are 1-based, so v000 is not a version, and the unpadded v2 is rejected — that spelling belongs to journeys' AutomationVersionId, a different scheme in which v0 means published.

Parameters:

  • (String)

Returns:

  • (String, nil)


44
# File 'lib/courier/models/notifications/previews/create_preview_run_request.rb', line 44

optional :template_version, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


43
# File 'sig/courier/models/notifications/previews/create_preview_run_request.rbs', line 43

def to_hash: -> {