Class: Courier::Models::JourneyExperiment

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

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(bucketing_key:, variants:, id: nil, name: nil) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::JourneyExperiment for more details.

A/B experiment config for a send node. The recipient is deterministically bucketed by bucketingKey and routed to one of the variants in proportion to its weight. Present on a send node INSTEAD OF message.template.

Parameters:

  • bucketing_key (String)

    The value used to deterministically assign a recipient to a variant. Must be non

  • variants (Array<Courier::Models::JourneyExperimentVariant>)

    Between 2 and 10 weighted template variants.

  • id (String) (defaults to: nil)

    Unique experiment id (prefixed exp_). Omit to have one generated automatically

  • name (String) (defaults to: nil)

    Optional display name for the experiment.



# File 'lib/courier/models/journey_experiment.rb', line 32

Instance Attribute Details

#bucketing_keyString

The value used to deterministically assign a recipient to a variant. Must be non-empty with no leading or trailing whitespace.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/courier/models/journey_experiment.rb', line 11

required :bucketing_key, String, api_name: :bucketingKey

#idString?

Unique experiment id (prefixed exp_). Omit to have one generated automatically; when supplied it must be a valid exp_ id.

Parameters:

  • (String)

Returns:

  • (String, nil)


24
# File 'lib/courier/models/journey_experiment.rb', line 24

optional :id, String

#nameString?

Optional display name for the experiment.

Parameters:

  • (String)

Returns:

  • (String, nil)


30
# File 'lib/courier/models/journey_experiment.rb', line 30

optional :name, String

#variantsArray<Courier::Models::JourneyExperimentVariant>

Between 2 and 10 weighted template variants.

Parameters:

Returns:



17
# File 'lib/courier/models/journey_experiment.rb', line 17

required :variants, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyExperimentVariant] }

Instance Method Details

#to_hash{

Returns:

  • ({)


31
# File 'sig/courier/models/journey_experiment.rbs', line 31

def to_hash: -> {