Class: Knockapi::Models::Recipients::PreferenceSet

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/knockapi/models/recipients/preference_set.rb,
sig/knockapi/models/recipients/preference_set.rbs

Defined Under Namespace

Modules: Category, Channel, CommercialSubscribed, Workflow

Instance Attribute Summary collapse

Class Method 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(id:, categories: nil, channel_types: nil, channels: nil, commercial_subscribed: nil, workflows: nil) ⇒ Object

Some parameter documentations has been truncated, see Knockapi::Models::Recipients::PreferenceSet for more details.

A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets.

Parameters:



# File 'lib/knockapi/models/recipients/preference_set.rb', line 60

Instance Attribute Details

#categories ⇒ Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject}?

An object where the key is the category and the values are the preference settings for that category.

Parameters:

  • value (::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::category], nil)

Returns:



18
19
20
21
22
# File 'lib/knockapi/models/recipients/preference_set.rb', line 18

optional :categories,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Category]
},
nil?: true

#channel_types ⇒ Knockapi::Models::Recipients::PreferenceSetChannelTypes?

Channel type preferences.

Parameters:

  • value (Knockapi::Recipients::PreferenceSetChannelTypes, nil)

Returns:



28
# File 'lib/knockapi/models/recipients/preference_set.rb', line 28

optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true

#channels ⇒ Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}?

Channel preferences.

Parameters:

  • value (::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::channel], nil)

Returns:



34
35
36
# File 'lib/knockapi/models/recipients/preference_set.rb', line 34

optional :channels,
-> { Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Channel] },
nil?: true

#commercial_subscribed ⇒ Boolean, ...

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications. Can also be set to a settings object with conditions that are evaluated at notification send time.

Parameters:

  • value (Knockapi::Models::Recipients::PreferenceSet::commercial_subscribed, nil)

Returns:



45
46
47
# File 'lib/knockapi/models/recipients/preference_set.rb', line 45

optional :commercial_subscribed,
union: -> { Knockapi::Recipients::PreferenceSet::CommercialSubscribed },
nil?: true

#id ⇒ String

Unique identifier for the preference set.

Parameters:

  • value (String)

Returns:

  • (String)


11
# File 'lib/knockapi/models/recipients/preference_set.rb', line 11

required :id, String

#workflows ⇒ Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject}?

An object where the key is the workflow key and the values are the preference settings for that workflow.

Parameters:

  • value (::Hash[Symbol, Knockapi::Models::Recipients::PreferenceSet::workflow], nil)

Returns:



54
55
56
57
58
# File 'lib/knockapi/models/recipients/preference_set.rb', line 54

optional :workflows,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSet::Workflow]
},
nil?: true

Class Method Details

.variants ⇒ Array(Boolean, Knockapi::Models::PreferenceSetCommercialSubscribedSetting)



# File 'lib/knockapi/models/recipients/preference_set.rb', line 131

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


36
# File 'sig/knockapi/models/recipients/preference_set.rbs', line 36

def to_hash: -> {