Class: Telnyx::Models::WhatsappMessageContent::Template::Component

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/whatsapp_message_content.rb

Defined Under Namespace

Modules: SubType, Type Classes: Parameter

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(components: nil, language: nil, name: nil, template_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::WhatsappMessageContent::Template for more details.

Template message object. Provide either template_id or name + language to identify the template.

Parameters:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/telnyx/models/whatsapp_message_content.rb', line 148

class Component < Telnyx::Internal::Type::BaseModel
  # @!attribute index
  #   Button index (required for button components)
  #
  #   @return [Integer, nil]
  optional :index, Integer

  # @!attribute parameters
  #
  #   @return [Array<Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter>, nil]
  optional :parameters,
           -> { Telnyx::Internal::Type::ArrayOf[Telnyx::WhatsappMessageContent::Template::Component::Parameter] }

  # @!attribute sub_type
  #
  #   @return [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::SubType, nil]
  optional :sub_type, enum: -> { Telnyx::WhatsappMessageContent::Template::Component::SubType }

  # @!attribute type
  #
  #   @return [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::Type, nil]
  optional :type, enum: -> { Telnyx::WhatsappMessageContent::Template::Component::Type }

  # @!method initialize(index: nil, parameters: nil, sub_type: nil, type: nil)
  #   @param index [Integer] Button index (required for button components)
  #
  #   @param parameters [Array<Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter>]
  #
  #   @param sub_type [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::SubType]
  #
  #   @param type [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::Type]

  class Parameter < Telnyx::Internal::Type::BaseModel
    # @!attribute text
    #
    #   @return [String, nil]
    optional :text, String

    # @!attribute type
    #
    #   @return [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter::Type, nil]
    optional :type, enum: -> { Telnyx::WhatsappMessageContent::Template::Component::Parameter::Type }

    # @!method initialize(text: nil, type: nil)
    #   @param text [String]
    #   @param type [Symbol, Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter::Type]

    # @see Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter#type
    module Type
      extend Telnyx::Internal::Type::Enum

      TEXT = :text
      IMAGE = :image
      VIDEO = :video
      DOCUMENT = :document
      CURRENCY = :currency
      DATE_TIME = :date_time

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  # @see Telnyx::Models::WhatsappMessageContent::Template::Component#sub_type
  module SubType
    extend Telnyx::Internal::Type::Enum

    QUICK_REPLY = :quick_reply
    URL = :url

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # @see Telnyx::Models::WhatsappMessageContent::Template::Component#type
  module Type
    extend Telnyx::Internal::Type::Enum

    HEADER = :header
    BODY = :body
    BUTTON = :button

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#indexInteger?

Button index (required for button components)

Returns:

  • (Integer, nil)


153
# File 'lib/telnyx/models/whatsapp_message_content.rb', line 153

optional :index, Integer

#parametersArray<Telnyx::Models::WhatsappMessageContent::Template::Component::Parameter>?



158
159
# File 'lib/telnyx/models/whatsapp_message_content.rb', line 158

optional :parameters,
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::WhatsappMessageContent::Template::Component::Parameter] }

#sub_typeSymbol, ...



164
# File 'lib/telnyx/models/whatsapp_message_content.rb', line 164

optional :sub_type, enum: -> { Telnyx::WhatsappMessageContent::Template::Component::SubType }

#typeSymbol, ...



169
# File 'lib/telnyx/models/whatsapp_message_content.rb', line 169

optional :type, enum: -> { Telnyx::WhatsappMessageContent::Template::Component::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/whatsapp_message_content.rb', line 206