Class: Courier::Models::NotificationElementPutRequest

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

Direct Known Subclasses

NotificationPutElementParams

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(type:, channels: nil, data: nil, if_: nil, loop_: nil, ref: nil, state: nil) ⇒ NotificationElementPutRequest

Request body for updating a single element. Additional type-specific fields are allowed.

Parameters:

  • type (String) —

    Element type (text, meta, action, image, etc.).

  • channels (Array<String>) (defaults to: nil)
  • data (Hash{Symbol=>Object}) (defaults to: nil)
  • if_ (String) (defaults to: nil)
  • loop_ (String) (defaults to: nil)
  • ref (String) (defaults to: nil)
  • state (Symbol, Courier::Models::NotificationTemplateState) (defaults to: nil) —

    Template state. Defaults to DRAFT.

  • type: (String)
  • channels: (::Array[String]) (defaults to: nil)
  • data: (::Hash[Symbol, top]) (defaults to: nil)
  • if_: (String) (defaults to: nil)
  • loop_: (String) (defaults to: nil)
  • ref: (String) (defaults to: nil)
  • state: (Courier::Models::notification_template_state) (defaults to: nil)


# File 'lib/courier/models/notification_element_put_request.rb', line 43

Instance Attribute Details

#channels ⇒ Array<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


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

optional :channels, Courier::Internal::Type::ArrayOf[String]

#data ⇒ Hash{Symbol=>Object}?

Parameters:

  • (::Hash[Symbol, top])

Returns:

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


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

optional :data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]

#if_ ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :if_, String, api_name: :if

#loop_ ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


30
# File 'lib/courier/models/notification_element_put_request.rb', line 30

optional :loop_, String, api_name: :loop

#ref ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


35
# File 'lib/courier/models/notification_element_put_request.rb', line 35

optional :ref, String

#state ⇒ Symbol, ...

Template state. Defaults to DRAFT.

Parameters:

  • (Courier::Models::notification_template_state)

Returns:



41
# File 'lib/courier/models/notification_element_put_request.rb', line 41

optional :state, enum: -> { Courier::NotificationTemplateState }

#type ⇒ String

Element type (text, meta, action, image, etc.).

Parameters:

  • value (String)

Returns:

  • (String)


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

required :type, String

Instance Method Details

#to_hash ⇒ { type: String, channels: ::Array[String], data: ::Hash[Symbol, top], if_: String, loop_: String, ref: String, state: Courier::Models::notification_template_state }

Returns:

  • ({ type: String, channels: ::Array[String], data: ::Hash[Symbol, top], if_: String, loop_: String, ref: String, state: Courier::Models::notification_template_state })


53
54
55
56
57
58
59
60
61
# File 'sig/courier/models/notification_element_put_request.rbs', line 53

def to_hash: -> {
  type: String,
  channels: ::Array[String],
  data: ::Hash[Symbol, top],
  if_: String,
  loop_: String,
  ref: String,
  state: Courier::Models::notification_template_state
}