Class: Zavudev::Models::TemplateCreateParams::Button

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/zavudev/models/template_create_params.rb

Defined Under Namespace

Modules: 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(text:, type:, otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, url: nil) ⇒ Object

Some parameter documentations has been truncated, see Zavudev::Models::TemplateCreateParams::Button for more details.

Parameters:

  • text (String)
  • type (Symbol, Zavudev::Models::TemplateCreateParams::Button::Type)
  • otp_type (Symbol, Zavudev::Models::TemplateCreateParams::Button::OtpType) (defaults to: nil)

    Required when type is ‘otp’. COPY_CODE shows copy button, ONE_TAP enables Androi

  • package_name (String) (defaults to: nil)

    Android package name. Required for ONE_TAP buttons.

  • phone_number (String) (defaults to: nil)
  • signature_hash (String) (defaults to: nil)

    Android app signature hash. Required for ONE_TAP buttons.

  • url (String) (defaults to: nil)


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
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
# File 'lib/zavudev/models/template_create_params.rb', line 124

class Button < Zavudev::Internal::Type::BaseModel
  # @!attribute text
  #
  #   @return [String]
  required :text, String

  # @!attribute type
  #
  #   @return [Symbol, Zavudev::Models::TemplateCreateParams::Button::Type]
  required :type, enum: -> { Zavudev::TemplateCreateParams::Button::Type }

  # @!attribute otp_type
  #   Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
  #   Android autofill.
  #
  #   @return [Symbol, Zavudev::Models::TemplateCreateParams::Button::OtpType, nil]
  optional :otp_type, enum: -> { Zavudev::TemplateCreateParams::Button::OtpType }, api_name: :otpType

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

  # @!attribute phone_number
  #
  #   @return [String, nil]
  optional :phone_number, String, api_name: :phoneNumber

  # @!attribute signature_hash
  #   Android app signature hash. Required for ONE_TAP buttons.
  #
  #   @return [String, nil]
  optional :signature_hash, String, api_name: :signatureHash

  # @!attribute url
  #
  #   @return [String, nil]
  optional :url, String

  # @!method initialize(text:, type:, otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, url: nil)
  #   Some parameter documentations has been truncated, see
  #   {Zavudev::Models::TemplateCreateParams::Button} for more details.
  #
  #   @param text [String]
  #
  #   @param type [Symbol, Zavudev::Models::TemplateCreateParams::Button::Type]
  #
  #   @param otp_type [Symbol, Zavudev::Models::TemplateCreateParams::Button::OtpType] Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables Androi
  #
  #   @param package_name [String] Android package name. Required for ONE_TAP buttons.
  #
  #   @param phone_number [String]
  #
  #   @param signature_hash [String] Android app signature hash. Required for ONE_TAP buttons.
  #
  #   @param url [String]

  # @see Zavudev::Models::TemplateCreateParams::Button#type
  module Type
    extend Zavudev::Internal::Type::Enum

    QUICK_REPLY = :quick_reply
    URL = :url
    PHONE = :phone
    OTP = :otp

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

  # Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
  # Android autofill.
  #
  # @see Zavudev::Models::TemplateCreateParams::Button#otp_type
  module OtpType
    extend Zavudev::Internal::Type::Enum

    COPY_CODE = :COPY_CODE
    ONE_TAP = :ONE_TAP

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

Instance Attribute Details

#otp_typeSymbol, ...

Required when type is ‘otp’. COPY_CODE shows copy button, ONE_TAP enables Android autofill.



140
# File 'lib/zavudev/models/template_create_params.rb', line 140

optional :otp_type, enum: -> { Zavudev::TemplateCreateParams::Button::OtpType }, api_name: :otpType

#package_nameString?

Android package name. Required for ONE_TAP buttons.

Returns:

  • (String, nil)


146
# File 'lib/zavudev/models/template_create_params.rb', line 146

optional :package_name, String, api_name: :packageName

#phone_numberString?

Returns:

  • (String, nil)


151
# File 'lib/zavudev/models/template_create_params.rb', line 151

optional :phone_number, String, api_name: :phoneNumber

#signature_hashString?

Android app signature hash. Required for ONE_TAP buttons.

Returns:

  • (String, nil)


157
# File 'lib/zavudev/models/template_create_params.rb', line 157

optional :signature_hash, String, api_name: :signatureHash

#textString

Returns:

  • (String)


128
# File 'lib/zavudev/models/template_create_params.rb', line 128

required :text, String

#typeSymbol, Zavudev::Models::TemplateCreateParams::Button::Type



133
# File 'lib/zavudev/models/template_create_params.rb', line 133

required :type, enum: -> { Zavudev::TemplateCreateParams::Button::Type }

#urlString?

Returns:

  • (String, nil)


162
# File 'lib/zavudev/models/template_create_params.rb', line 162

optional :url, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/zavudev/models/template_create_params.rb', line 191