Class: Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button

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

Defined Under Namespace

Modules: FlowAction, OtpType, Type

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(type:, autofill_text: nil, example: nil, flow_action: nil, flow_id: nil, navigate_screen: nil, otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, text: nil, url: nil, zero_tap_terms_accepted: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button for more details.

Parameters:

  • type (Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type)
  • autofill_text (String) (defaults to: nil)

    Custom autofill button text for ONE_TAP OTP buttons.

  • example (Array<String>) (defaults to: nil)

    Sample values for URL variable.

  • flow_action (Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::FlowAction) (defaults to: nil)

    Flow action type for FLOW-type buttons.

  • flow_id (String) (defaults to: nil)

    Flow ID for FLOW-type buttons.

  • navigate_screen (String) (defaults to: nil)

    Target screen name for FLOW buttons with navigate action.

  • otp_type (Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::OtpType) (defaults to: nil)
  • package_name (String) (defaults to: nil)

    Android package name. Required for ONE_TAP OTP buttons.

  • phone_number (String) (defaults to: nil)

    Phone number in E.164 format.

  • signature_hash (String) (defaults to: nil)

    Android app signing key hash. Required for ONE_TAP OTP buttons.

  • text (String) (defaults to: nil)

    Button label text. Maximum 25 characters. Required for URL, PHONE_NUMBER, and QU

  • url (String) (defaults to: nil)

    URL for URL-type buttons. Supports one variable ({1}).

  • zero_tap_terms_accepted (Boolean) (defaults to: nil)

    Whether zero-tap terms have been accepted.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 26

class Button < Telnyx::Internal::Type::BaseModel
  # @!attribute type
  #
  #   @return [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type]
  required :type, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type }

  # @!attribute autofill_text
  #   Custom autofill button text for ONE_TAP OTP buttons.
  #
  #   @return [String, nil]
  optional :autofill_text, String

  # @!attribute example
  #   Sample values for URL variable.
  #
  #   @return [Array<String>, nil]
  optional :example, Telnyx::Internal::Type::ArrayOf[String]

  # @!attribute flow_action
  #   Flow action type for FLOW-type buttons.
  #
  #   @return [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::FlowAction, nil]
  optional :flow_action, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::FlowAction }

  # @!attribute flow_id
  #   Flow ID for FLOW-type buttons.
  #
  #   @return [String, nil]
  optional :flow_id, String

  # @!attribute navigate_screen
  #   Target screen name for FLOW buttons with navigate action.
  #
  #   @return [String, nil]
  optional :navigate_screen, String

  # @!attribute otp_type
  #
  #   @return [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::OtpType, nil]
  optional :otp_type, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::OtpType }

  # @!attribute package_name
  #   Android package name. Required for ONE_TAP OTP buttons.
  #
  #   @return [String, nil]
  optional :package_name, String

  # @!attribute phone_number
  #   Phone number in E.164 format.
  #
  #   @return [String, nil]
  optional :phone_number, String

  # @!attribute signature_hash
  #   Android app signing key hash. Required for ONE_TAP OTP buttons.
  #
  #   @return [String, nil]
  optional :signature_hash, String

  # @!attribute text
  #   Button label text. Maximum 25 characters. Required for URL, PHONE_NUMBER, and
  #   QUICK_REPLY buttons. Not required for OTP buttons (Meta supplies the label).
  #
  #   @return [String, nil]
  optional :text, String

  # @!attribute url
  #   URL for URL-type buttons. Supports one variable ({{1}}).
  #
  #   @return [String, nil]
  optional :url, String

  # @!attribute zero_tap_terms_accepted
  #   Whether zero-tap terms have been accepted.
  #
  #   @return [Boolean, nil]
  optional :zero_tap_terms_accepted, Telnyx::Internal::Type::Boolean

  # @!method initialize(type:, autofill_text: nil, example: nil, flow_action: nil, flow_id: nil, navigate_screen: nil, otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, text: nil, url: nil, zero_tap_terms_accepted: nil)
  #   Some parameter documentations has been truncated, see
  #   {Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button} for more
  #   details.
  #
  #   @param type [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type]
  #
  #   @param autofill_text [String] Custom autofill button text for ONE_TAP OTP buttons.
  #
  #   @param example [Array<String>] Sample values for URL variable.
  #
  #   @param flow_action [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::FlowAction] Flow action type for FLOW-type buttons.
  #
  #   @param flow_id [String] Flow ID for FLOW-type buttons.
  #
  #   @param navigate_screen [String] Target screen name for FLOW buttons with navigate action.
  #
  #   @param otp_type [Symbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::OtpType]
  #
  #   @param package_name [String] Android package name. Required for ONE_TAP OTP buttons.
  #
  #   @param phone_number [String] Phone number in E.164 format.
  #
  #   @param signature_hash [String] Android app signing key hash. Required for ONE_TAP OTP buttons.
  #
  #   @param text [String] Button label text. Maximum 25 characters. Required for URL, PHONE_NUMBER, and QU
  #
  #   @param url [String] URL for URL-type buttons. Supports one variable ({{1}}).
  #
  #   @param zero_tap_terms_accepted [Boolean] Whether zero-tap terms have been accepted.

  # @see Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button#type
  module Type
    extend Telnyx::Internal::Type::Enum

    URL = :URL
    PHONE_NUMBER = :PHONE_NUMBER
    QUICK_REPLY = :QUICK_REPLY
    OTP = :OTP
    COPY_CODE = :COPY_CODE
    FLOW = :FLOW

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

  # Flow action type for FLOW-type buttons.
  #
  # @see Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button#flow_action
  module FlowAction
    extend Telnyx::Internal::Type::Enum

    NAVIGATE = :navigate
    DATA_EXCHANGE = :data_exchange

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

  # @see Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button#otp_type
  module OtpType
    extend Telnyx::Internal::Type::Enum

    COPY_CODE = :COPY_CODE
    ONE_TAP = :ONE_TAP

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

Instance Attribute Details

#autofill_textString?

Custom autofill button text for ONE_TAP OTP buttons.

Returns:

  • (String, nil)


36
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 36

optional :autofill_text, String

#exampleArray<String>?

Sample values for URL variable.

Returns:

  • (Array<String>, nil)


42
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 42

optional :example, Telnyx::Internal::Type::ArrayOf[String]

#flow_actionSymbol, ...

Flow action type for FLOW-type buttons.



48
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 48

optional :flow_action, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::FlowAction }

#flow_idString?

Flow ID for FLOW-type buttons.

Returns:

  • (String, nil)


54
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 54

optional :flow_id, String

Target screen name for FLOW buttons with navigate action.

Returns:

  • (String, nil)


60
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 60

optional :navigate_screen, String

#otp_typeSymbol, ...



65
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 65

optional :otp_type, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::OtpType }

#package_nameString?

Android package name. Required for ONE_TAP OTP buttons.

Returns:

  • (String, nil)


71
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 71

optional :package_name, String

#phone_numberString?

Phone number in E.164 format.

Returns:

  • (String, nil)


77
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 77

optional :phone_number, String

#signature_hashString?

Android app signing key hash. Required for ONE_TAP OTP buttons.

Returns:

  • (String, nil)


83
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 83

optional :signature_hash, String

#textString?

Button label text. Maximum 25 characters. Required for URL, PHONE_NUMBER, and QUICK_REPLY buttons. Not required for OTP buttons (Meta supplies the label).

Returns:

  • (String, nil)


90
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 90

optional :text, String

#typeSymbol, Telnyx::Models::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type



30
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 30

required :type, enum: -> { Telnyx::Whatsapp::WhatsappTemplateButtonsComponent::Button::Type }

#urlString?

URL for URL-type buttons. Supports one variable ({1}).

Returns:

  • (String, nil)


96
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 96

optional :url, String

#zero_tap_terms_acceptedBoolean?

Whether zero-tap terms have been accepted.

Returns:

  • (Boolean, nil)


102
# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 102

optional :zero_tap_terms_accepted, Telnyx::Internal::Type::Boolean

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/whatsapp/whatsapp_template_buttons_component.rb', line 146