Class: Courier::Models::NotificationTemplateUpdateRequest

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

Direct Known Subclasses

NotificationReplaceParams

Defined Under Namespace

Modules: State

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(notification:, state: nil) ⇒ Object

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

Request body for replacing a notification template. All fields are required, since PUT is a full replacement, except alias, whose omission leaves the existing aliases in place. Unlike NotificationTemplateCreateRequest, notification.content is not required to place its elements inside a channel block: the requirement applies to creation only, so templates already stored without one stay editable.

Parameters:



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

Instance Attribute Details

#notification ⇒ Courier::Models::NotificationTemplateWritePayload

Template fields accepted in POST and PUT request bodies, nested under a notification key.



11
# File 'lib/courier/models/notification_template_update_request.rb', line 11

required :notification, -> { Courier::NotificationTemplateWritePayload }

#state ⇒ Symbol, ...

Template state after update. Case-insensitive input, normalized to uppercase in the response. Defaults to "DRAFT".



18
# File 'lib/courier/models/notification_template_update_request.rb', line 18

optional :state, enum: -> { Courier::NotificationTemplateUpdateRequest::State }

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


23
# File 'sig/courier/models/notification_template_update_request.rbs', line 23

def to_hash: -> {