Class: Courier::Models::Users::TopicPreference

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/courier/models/users/topic_preference.rb,
sig/courier/models/users/topic_preference.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(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil) ⇒ Object

Parameters:



# File 'lib/courier/models/users/topic_preference.rb', line 40

Instance Attribute Details

#custom_routingArray<Symbol, Courier::Models::ChannelClassification>?

The Channels a user has chosen to receive notifications through for this topic

Parameters:

  • value (::Array[Courier::Models::channel_classification], nil)

Returns:



31
32
33
# File 'lib/courier/models/users/topic_preference.rb', line 31

optional :custom_routing,
-> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
nil?: true

#default_statusSymbol, Courier::Models::PreferenceStatus

Parameters:

  • value (Courier::Models::preference_status)

Returns:



10
# File 'lib/courier/models/users/topic_preference.rb', line 10

required :default_status, enum: -> { Courier::PreferenceStatus }

#has_custom_routingBoolean?

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


38
# File 'lib/courier/models/users/topic_preference.rb', line 38

optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true

#statusSymbol, Courier::Models::PreferenceStatus

Parameters:

  • value (Courier::Models::preference_status)

Returns:



15
# File 'lib/courier/models/users/topic_preference.rb', line 15

required :status, enum: -> { Courier::PreferenceStatus }

#topic_idString

Parameters:

  • value (String)

Returns:

  • (String)


20
# File 'lib/courier/models/users/topic_preference.rb', line 20

required :topic_id, String

#topic_nameString

Parameters:

  • value (String)

Returns:

  • (String)


25
# File 'lib/courier/models/users/topic_preference.rb', line 25

required :topic_name, String

Instance Method Details

#to_hash{

Returns:

  • ({)


36
# File 'sig/courier/models/users/topic_preference.rbs', line 36

def to_hash: -> {