Class: Cadenya::Models::WidgetSpec

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/cadenya/models/widget_spec.rb,
sig/cadenya/models/widget_spec.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(agent_id:, origin_allowlist: nil, variation_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Cadenya::Models::WidgetSpec for more details.

WidgetSpec is the user-provided configuration for a widget.

Parameters:

  • agent_id (String)

    Agent this widget is bound to. Accepts the canonical agent_… form or the

  • origin_allowlist (Array<String>) (defaults to: nil)

    Web origins allowed to embed and use this widget, enforced at the edge on

  • variation_id (String) (defaults to: nil)

    Optional explicit variation pin. Must belong to the widget's agent. When



# File 'lib/cadenya/models/widget_spec.rb', line 32

Instance Attribute Details

#agent_idString

Agent this widget is bound to. Accepts the canonical agent_… form or the external_id:<value> form. Sessions copy the agent at mint: re-pointing a widget's agent affects new sessions only.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/cadenya/models/widget_spec.rb', line 12

required :agent_id, String, api_name: :agentId

#origin_allowlistArray<String>?

Web origins allowed to embed and use this widget, enforced at the edge on every browser request. Exact origins only (scheme + host + optional port), no paths, no wildcard subdomains.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


20
# File 'lib/cadenya/models/widget_spec.rb', line 20

optional :origin_allowlist, Cadenya::Internal::Type::ArrayOf[String], api_name: :originAllowlist

#variation_idString?

Optional explicit variation pin. Must belong to the widget's agent. When set, every objective created through the widget runs this variation — bypassing the agent's variation_selection_mode (staged rollout: pin in production, follow in staging, promote by clearing). When unset, the agent's selection mode chooses per conversation.

Parameters:

  • (String)

Returns:

  • (String, nil)


30
# File 'lib/cadenya/models/widget_spec.rb', line 30

optional :variation_id, String, api_name: :variationId

Instance Method Details

#to_hash{

Returns:

  • ({)


27
# File 'sig/cadenya/models/widget_spec.rbs', line 27

def to_hash: -> {