Class: Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row

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

Defined Under Namespace

Modules: ChannelType, Type

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(name:, type:, channel_types: nil, description: nil, identifier: nil) ⇒ Object

Some parameter documentations has been truncated, see Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row for more details.

A preference row in the preference center configuration.

Parameters:



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
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 123

class Row < Knockapi::Internal::Type::BaseModel
  # @!attribute name
  #   The display name of the preference row.
  #
  #   @return [String]
  required :name, String

  # @!attribute type
  #   The type of this preference row. `workflow` targets a workflow, `channel`
  #   targets a specific channel, `category` targets a workflow category,
  #   `channel_types` controls per-channel-type opt-in/out, and
  #   `commercial_subscribed` is the commercial notification toggle.
  #
  #   @return [Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::Type]
  required :type, enum: -> { Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::Type }

  # @!attribute channel_types
  #   The list of channel types this preference is scoped to. An empty list (or
  #   `null`) means the preference applies to all channel types. Present for
  #   `workflow`, `category`, and `channel_types` types.
  #
  #   @return [Array<Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::ChannelType>, nil]
  optional :channel_types,
           -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::ChannelType] },
           nil?: true

  # @!attribute description
  #   A description shown below the preference row name.
  #
  #   @return [String, nil]
  optional :description, String

  # @!attribute identifier
  #   The category name, workflow key, or channel ID this row controls (e.g.
  #   `marketing`, `new-project-mentions`, or a channel UUID). Present for `workflow`,
  #   `channel`, and `category` types.
  #
  #   @return [String, nil]
  optional :identifier, String, nil?: true

  # @!method initialize(name:, type:, channel_types: nil, description: nil, identifier: nil)
  #   Some parameter documentations has been truncated, see
  #   {Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row} for
  #   more details.
  #
  #   A preference row in the preference center configuration.
  #
  #   @param name [String] The display name of the preference row.
  #
  #   @param type [Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::Type] The type of this preference row. `workflow` targets a workflow, `channel` target
  #
  #   @param channel_types [Array<Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::ChannelType>, nil] The list of channel types this preference is scoped to. An empty list (or `null`
  #
  #   @param description [String] A description shown below the preference row name.
  #
  #   @param identifier [String, nil] The category name, workflow key, or channel ID this row controls (e.g. `marketin

  # The type of this preference row. `workflow` targets a workflow, `channel`
  # targets a specific channel, `category` targets a workflow category,
  # `channel_types` controls per-channel-type opt-in/out, and
  # `commercial_subscribed` is the commercial notification toggle.
  #
  # @see Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row#type
  module Type
    extend Knockapi::Internal::Type::Enum

    WORKFLOW = :workflow
    CHANNEL = :channel
    CATEGORY = :category
    CHANNEL_TYPES = :channel_types
    COMMERCIAL_SUBSCRIBED = :commercial_subscribed

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  module ChannelType
    extend Knockapi::Internal::Type::Enum

    EMAIL = :email
    IN_APP = :in_app
    IN_APP_FEED = :in_app_feed
    IN_APP_GUIDE = :in_app_guide
    SMS = :sms
    PUSH = :push
    CHAT = :chat
    HTTP = :http
    LOG = :log
    DEFERRED_LOG = :deferred_log

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#channel_types ⇒ Array<Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::ChannelType>?

The list of channel types this preference is scoped to. An empty list (or null) means the preference applies to all channel types. Present for workflow, category, and channel_types types.

Parameters:

  • value (::Array[Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::channel_type], nil)

Returns:



145
146
147
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 145

optional :channel_types,
-> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::ChannelType] },
nil?: true

#description ⇒ String?

A description shown below the preference row name.

Parameters:

  • (String)

Returns:

  • (String, nil)


153
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 153

optional :description, String

#identifier ⇒ String?

The category name, workflow key, or channel ID this row controls (e.g. marketing, new-project-mentions, or a channel UUID). Present for workflow, channel, and category types.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


161
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 161

optional :identifier, String, nil?: true

#name ⇒ String

The display name of the preference row.

Parameters:

  • value (String)

Returns:

  • (String)


128
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 128

required :name, String

#type ⇒ Symbol, Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::Type

The type of this preference row. workflow targets a workflow, channel targets a specific channel, category targets a workflow category, channel_types controls per-channel-type opt-in/out, and commercial_subscribed is the commercial notification toggle.

Parameters:

  • value (Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::type_)

Returns:



137
# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 137

required :type, enum: -> { Knockapi::Models::Users::PreferenceCenterGetConfigResponse::Config::Row::Type }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/knockapi/models/users/preference_center_get_config_response.rb', line 195

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


129
# File 'sig/knockapi/models/users/preference_center_get_config_response.rbs', line 129

def to_hash: -> {