Class: Knockapi::Models::Recipients::PreferenceSetRequest

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

Defined Under Namespace

Modules: Category, Channel, CommercialSubscribed, PersistenceStrategy, 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(_persistence_strategy: nil, categories: nil, channel_types: nil, channels: nil, commercial_subscribed: nil, workflows: nil) ⇒ Object

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

A request to set a preference set for a recipient.

Parameters:

  • (defaults to: nil)

    Controls how the preference set is persisted. 'replace' will completely replace

  • (defaults to: nil)

    An object where the key is the category and the values are the preference settin

  • (defaults to: nil)

    Channel type preferences.

  • (defaults to: nil)

    Channel preferences.

  • (defaults to: nil)

    Whether the recipient is subscribed to commercial communications. When false, th

  • (defaults to: nil)

    An object where the key is the workflow key and the values are the preference se



# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 65

Instance Attribute Details

#_persistence_strategy ⇒ Symbol, ...

Controls how the preference set is persisted. 'replace' will completely replace the preference set, 'merge' will merge with existing preferences.

Returns:



12
13
14
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 12

optional :_persistence_strategy,
enum: -> { Knockapi::Recipients::PreferenceSetRequest::PersistenceStrategy },
api_name: :__persistence_strategy__

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

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

Parameters:

Returns:



21
22
23
24
25
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 21

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

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

Channel type preferences.

Parameters:

Returns:



31
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 31

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

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

Channel preferences.

Parameters:

Returns:



37
38
39
40
41
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 37

optional :channels,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSetRequest::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:

Returns:



50
51
52
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 50

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

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

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

Parameters:

Returns:



59
60
61
62
63
# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 59

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

Class Method Details

.values ⇒ Array<Symbol>

Returns:



# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 93

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

Returns:



# File 'lib/knockapi/models/recipients/preference_set_request.rb', line 151

Instance Method Details

#to_hash ⇒ {

Returns:



40
# File 'sig/knockapi/models/recipients/preference_set_request.rbs', line 40

def to_hash: -> {