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, digest_schedule_id: nil, has_custom_routing: nil) ⇒ Topic

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

  • digest_schedule_id (String, nil) (defaults to: nil) —

    Put this recipient on one of the topic's digest schedules. Send null to clear

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

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

  • status: (Courier::Models::preference_status)
  • custom_routing: (::Array[Courier::Models::channel_classification], nil) (defaults to: nil)
  • digest_schedule_id: (String, nil) (defaults to: nil)
  • has_custom_routing: (Boolean, nil) (defaults to: nil)


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
# 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 digest_schedule_id
  #   Put this recipient on one of the topic's digest schedules. Send `null` to clear
  #   the choice and return them to the topic's default. Omit to leave an existing
  #   choice alone, unlike the routing fields, which this endpoint replaces. An id
  #   that is not an active schedule on the topic is rejected with a `400` before
  #   anything is written.
  #
  #   @return [String, nil]
  optional :digest_schedule_id, String, 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, digest_schedule_id: 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 digest_schedule_id [String, nil] Put this recipient on one of the topic's digest schedules. Send `null` to clear
  #
  #   @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_routing ⇒ Array<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

#digest_schedule_id ⇒ String?

Put this recipient on one of the topic's digest schedules. Send null to clear the choice and return them to the topic's default. Omit to leave an existing choice alone, unlike the routing fields, which this endpoint replaces. An id that is not an active schedule on the topic is rejected with a 400 before anything is written.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :digest_schedule_id, String, nil?: true

#has_custom_routing ⇒ Boolean?

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)


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

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

#status ⇒ Symbol, 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 ⇒ { status: Courier::Models::preference_status, custom_routing: ::Array[Courier::Models::channel_classification]?, digest_schedule_id: String?, has_custom_routing: bool? }

Returns:

  • ({ status: Courier::Models::preference_status, custom_routing: ::Array[Courier::Models::channel_classification]?, digest_schedule_id: String?, has_custom_routing: bool? })


65
66
67
68
69
70
# File 'sig/courier/models/users/preference_update_or_create_topic_params.rbs', line 65

def to_hash: -> {
  status: Courier::Models::preference_status,
  custom_routing: ::Array[Courier::Models::channel_classification]?,
  digest_schedule_id: String?,
  has_custom_routing: bool?
}