Class: Courier::Models::WorkspacePreferenceTopicCreateRequest

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/courier/models/workspace_preference_topic_create_request.rb,
sig/courier/models/workspace_preference_topic_create_request.rbs

Defined Under Namespace

Modules: AllowedPreference, DefaultStatus Classes: Digest

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(default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::WorkspacePreferenceTopicCreateRequest for more details.

Request body for creating a preference topic.

Parameters:



# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 72

Instance Attribute Details

#allowed_preferences ⇒ Array<Symbol, Courier::Models::WorkspacePreferenceTopicCreateRequest::AllowedPreference>?

Preference controls a recipient may customize for this topic. Defaults to empty if omitted.

Parameters:

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

Returns:



23
24
25
26
27
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 23

optional :allowed_preferences,
-> {
  Courier::Internal::Type::ArrayOf[enum: Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference]
},
nil?: true

#default_status ⇒ Symbol, Courier::Models::WorkspacePreferenceTopicCreateRequest::DefaultStatus

The default subscription status applied when a recipient has not set their own.

Parameters:

  • value (Courier::Models::WorkspacePreferenceTopicCreateRequest::default_status)

Returns:



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

required :default_status, enum: -> { Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus }

#description ⇒ String?

Optional description shown under the topic on the hosted preferences page.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


33
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 33

optional :description, String, nil?: true

#digest ⇒ Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest?

A topic's digest, as supplied when the topic itself is created: the template that renders it, the cadences it delivers on, and how collected events are retained.

Identical to TopicDigestRequest, which a replace uses, except that schedules is required — a topic being created has no stored schedules for an absent key to leave alone.

Send null for the whole object to turn a digest off, which unlinks the template and removes its schedules. There is no enabled flag, and schedules: [] is rejected, because both states are un-deliverable rather than merely off.

Parameters:

  • value (Courier::WorkspacePreferenceTopicCreateRequest::Digest, nil)

Returns:



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

optional :digest, -> { Courier::WorkspacePreferenceTopicCreateRequest::Digest }, nil?: true

#include_unsubscribe_header ⇒ Boolean?

Whether to include a list-unsubscribe header on emails for this topic.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


56
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 56

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

#name ⇒ String

Human-readable name for the preference topic.

Parameters:

  • value (String)

Returns:

  • (String)


16
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 16

required :name, String

#routing_options ⇒ Array<Symbol, Courier::Models::ChannelClassification>?

Default channels delivered for this topic. Defaults to empty if omitted.

Parameters:

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

Returns:



62
63
64
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 62

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

#topic_data ⇒ Hash{Symbol=>Object}?

Arbitrary metadata associated with the topic.

Parameters:

  • value (::Hash[Symbol, top], nil)

Returns:

  • (Hash{Symbol=>Object}, nil)


70
# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 70

optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/courier/models/workspace_preference_topic_create_request.rb', line 104

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


43
# File 'sig/courier/models/workspace_preference_topic_create_request.rbs', line 43

def to_hash: -> {