Class: Courier::Models::Users::PreferenceUpdateOrCreateTopicParams::Topic

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

Some parameter documentations has been truncated, see Courier::Models::Users::PreferenceUpdateOrCreateTopicParams::Topic for more details.

Parameters:

  • status (Symbol, Courier::Models::PreferenceStatus)

    The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level

  • custom_routing (Array<Symbol, Courier::Models::ChannelClassification>, nil) (defaults to: nil)

    The channels to deliver this topic on when has_custom_routing is true. One or mo

  • has_custom_routing (Boolean, nil) (defaults to: nil)

    Set to true to route this topic to the channels in custom_routing instead of the



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
# File 'lib/courier/models/users/preference_update_or_create_topic_params.rb', line 43

class Topic < Courier::Internal::Type::BaseModel
  # @!attribute status
  #   The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
  #   default, not a user choice; the API rejects opting a user out of a REQUIRED
  #   topic.
  #
  #   @return [Symbol, Courier::Models::PreferenceStatus]
  required :status, enum: -> { Courier::PreferenceStatus }

  # @!attribute custom_routing
  #   The channels to deliver this topic on when has_custom_routing is true. One or
  #   more of: direct_message, email, push, sms, webhook, inbox.
  #
  #   @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
  optional :custom_routing,
           -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
           nil?: true

  # @!attribute has_custom_routing
  #   Set to true to route this topic to the channels in custom_routing instead of the
  #   topic's default routing.
  #
  #   @return [Boolean, nil]
  optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true

  # @!method initialize(status:, custom_routing: nil, has_custom_routing: nil)
  #   Some parameter documentations has been truncated, see
  #   {Courier::Models::Users::PreferenceUpdateOrCreateTopicParams::Topic} for more
  #   details.
  #
  #   @param status [Symbol, Courier::Models::PreferenceStatus] The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
  #
  #   @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels to deliver this topic on when has_custom_routing is true. One or mo
  #
  #   @param has_custom_routing [Boolean, nil] Set to true to route this topic to the channels in custom_routing instead of the
end

Instance Attribute Details

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

The channels to deliver this topic on when has_custom_routing is true. One or more of: direct_message, email, push, sms, webhook, inbox.

Parameters:

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

Returns:



57
58
59
# File 'lib/courier/models/users/preference_update_or_create_topic_params.rb', line 57

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

#has_custom_routingBoolean?

Set to true to route this topic to the channels in custom_routing instead of the topic's default routing.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


66
# File 'lib/courier/models/users/preference_update_or_create_topic_params.rb', line 66

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

#statusSymbol, Courier::Models::PreferenceStatus

The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level default, not a user choice; the API rejects opting a user out of a REQUIRED topic.

Parameters:

  • value (Courier::Models::preference_status)

Returns:



50
# File 'lib/courier/models/users/preference_update_or_create_topic_params.rb', line 50

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

Instance Method Details

#to_hash{

Returns:

  • ({)


61
# File 'sig/courier/models/users/preference_update_or_create_topic_params.rbs', line 61

def to_hash: -> {