Class: Knockapi::Models::Users::BulkSetPreferencesParams::Preferences

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

Defined Under Namespace

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

Some parameter documentations has been truncated, see Knockapi::Models::Users::BulkSetPreferencesParams::Preferences for more details.

A preference set to apply in a bulk operation. Always replaces existing preferences for the specified set.

Parameters:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 34

class Preferences < Knockapi::Internal::Type::BaseModel
  # @!attribute id
  #   Identifier for the preference set to update. Can be `default` or a tenant ID.
  #
  #   @return [String, nil]
  optional :id, String

  # @!attribute categories
  #   An object where the key is the category and the values are the preference
  #   settings for that category.
  #
  #   @return [Hash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Category::PreferenceSetWorkflowCategorySettingObject}, nil]
  optional :categories,
           -> {
             Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Category]
           },
           nil?: true

  # @!attribute channel_types
  #   Channel type preferences.
  #
  #   @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
  optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true

  # @!attribute channels
  #   Channel preferences.
  #
  #   @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
  optional :channels,
           -> {
             Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Channel]
           },
           nil?: true

  # @!attribute commercial_subscribed
  #   Whether the recipient is subscribed to commercial communications. When false,
  #   the recipient will not receive commercial workflow notifications.
  #
  #   @return [Boolean, nil]
  optional :commercial_subscribed, Knockapi::Internal::Type::Boolean, nil?: true

  # @!attribute workflows
  #   An object where the key is the workflow key and the values are the preference
  #   settings for that workflow.
  #
  #   @return [Hash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil]
  optional :workflows,
           -> {
             Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Workflow]
           },
           nil?: true

  # @!method initialize(id: nil, categories: nil, channel_types: nil, channels: nil, commercial_subscribed: nil, workflows: nil)
  #   Some parameter documentations has been truncated, see
  #   {Knockapi::Models::Users::BulkSetPreferencesParams::Preferences} for more
  #   details.
  #
  #   A preference set to apply in a bulk operation. Always replaces existing
  #   preferences for the specified set.
  #
  #   @param id [String] Identifier for the preference set to update. Can be `default` or a tenant ID.
  #
  #   @param categories [Hash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Category::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the category and the values are the preference settin
  #
  #   @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
  #
  #   @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
  #
  #   @param commercial_subscribed [Boolean, nil] Whether the recipient is subscribed to commercial communications. When false, th
  #
  #   @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se

  # Workflow or category preferences within a preference set
  module Category
    extend Knockapi::Internal::Type::Union

    variant Knockapi::Internal::Type::Boolean

    # The settings object for a workflow or category, where you can specify channel types or conditions.
    variant -> { Knockapi::Users::BulkSetPreferencesParams::Preferences::Category::PreferenceSetWorkflowCategorySettingObject }

    class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel
      # @!attribute channel_types
      #   Channel type preferences.
      #
      #   @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
      optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true

      # @!attribute channels
      #   Channel preferences.
      #
      #   @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
      optional :channels,
               -> do
                 Knockapi::Internal::Type::HashOf[
                   union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Category::PreferenceSetWorkflowCategorySettingObject::Channel
                 ]
               end,
               nil?: true

      # @!attribute conditions
      #   A list of conditions to apply to a channel type.
      #
      #   @return [Array<Knockapi::Models::Condition>, nil]
      optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true

      # @!method initialize(channel_types: nil, channels: nil, conditions: nil)
      #   The settings object for a workflow or category, where you can specify channel
      #   types or conditions.
      #
      #   @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
      #
      #   @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
      #
      #   @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.

      # Whether the specific channel (by channel_id) is enabled for the preference set,
      # or a settings object with conditions.
      module Channel
        extend Knockapi::Internal::Type::Union

        variant Knockapi::Internal::Type::Boolean

        # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
        variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }

        # @!method self.variants
        #   @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
      end
    end

    # @!method self.variants
    #   @return [Array(Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Category::PreferenceSetWorkflowCategorySettingObject)]
  end

  # Whether the specific channel (by channel_id) is enabled for the preference set,
  # or a settings object with conditions.
  module Channel
    extend Knockapi::Internal::Type::Union

    variant Knockapi::Internal::Type::Boolean

    # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
    variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }

    # @!method self.variants
    #   @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
  end

  # Workflow or category preferences within a preference set
  module Workflow
    extend Knockapi::Internal::Type::Union

    variant Knockapi::Internal::Type::Boolean

    # The settings object for a workflow or category, where you can specify channel types or conditions.
    variant -> { Knockapi::Users::BulkSetPreferencesParams::Preferences::Workflow::PreferenceSetWorkflowCategorySettingObject }

    class PreferenceSetWorkflowCategorySettingObject < Knockapi::Internal::Type::BaseModel
      # @!attribute channel_types
      #   Channel type preferences.
      #
      #   @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
      optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true

      # @!attribute channels
      #   Channel preferences.
      #
      #   @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
      optional :channels,
               -> do
                 Knockapi::Internal::Type::HashOf[
                   union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel
                 ]
               end,
               nil?: true

      # @!attribute conditions
      #   A list of conditions to apply to a channel type.
      #
      #   @return [Array<Knockapi::Models::Condition>, nil]
      optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true

      # @!method initialize(channel_types: nil, channels: nil, conditions: nil)
      #   The settings object for a workflow or category, where you can specify channel
      #   types or conditions.
      #
      #   @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
      #
      #   @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
      #
      #   @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.

      # Whether the specific channel (by channel_id) is enabled for the preference set,
      # or a settings object with conditions.
      module Channel
        extend Knockapi::Internal::Type::Union

        variant Knockapi::Internal::Type::Boolean

        # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
        variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }

        # @!method self.variants
        #   @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
      end
    end

    # @!method self.variants
    #   @return [Array(Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::Workflow::PreferenceSetWorkflowCategorySettingObject)]
  end
end

Instance Attribute Details

#categoriesHash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::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::Users::BulkSetPreferencesParams::Preferences::category], nil)

Returns:



46
47
48
49
50
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 46

optional :categories,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Category]
},
nil?: true

#channel_typesKnockapi::Models::Recipients::PreferenceSetChannelTypes?

Channel type preferences.

Parameters:

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

Returns:



56
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 56

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

#channelsHash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}?

Channel preferences.

Parameters:

  • value (::Hash[Symbol, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::channel], nil)

Returns:



62
63
64
65
66
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 62

optional :channels,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Channel]
},
nil?: true

#commercial_subscribedBoolean?

Whether the recipient is subscribed to commercial communications. When false, the recipient will not receive commercial workflow notifications.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


73
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 73

optional :commercial_subscribed, Knockapi::Internal::Type::Boolean, nil?: true

#idString?

Identifier for the preference set to update. Can be default or a tenant ID.

Parameters:

  • (String)

Returns:

  • (String, nil)


39
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 39

optional :id, String

#workflowsHash{Symbol=>Boolean, Knockapi::Models::Users::BulkSetPreferencesParams::Preferences::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::Users::BulkSetPreferencesParams::Preferences::workflow], nil)

Returns:



80
81
82
83
84
# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 80

optional :workflows,
-> {
  Knockapi::Internal::Type::HashOf[union: Knockapi::Users::BulkSetPreferencesParams::Preferences::Workflow]
},
nil?: true

Class Method Details

.variantsArray(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)



# File 'lib/knockapi/models/users/bulk_set_preferences_params.rb', line 160

Instance Method Details

#to_hash{

Returns:

  • ({)


65
# File 'sig/knockapi/models/users/bulk_set_preferences_params.rbs', line 65

def to_hash: -> {