Class: Zavudev::Models::Template::Button

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/zavudev/models/template.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(otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, text: nil, type: nil, url: nil) ⇒ Object

Parameters:

  • otp_type (Symbol, Zavudev::Models::Template::Button::OtpType) (defaults to: nil)

    OTP button type. Required when type is ‘otp’.

  • 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.

  • text (String) (defaults to: nil)
  • type (Symbol, Zavudev::Models::Template::Button::Type) (defaults to: nil)
  • url (String) (defaults to: nil)


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
234
235
236
237
238
239
240
241
# File 'lib/zavudev/models/template.rb', line 162

class Button < Zavudev::Internal::Type::BaseModel
  # @!attribute otp_type
  #   OTP button type. Required when type is 'otp'.
  #
  #   @return [Symbol, Zavudev::Models::Template::Button::OtpType, nil]
  optional :otp_type, enum: -> { Zavudev::Template::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 text
  #
  #   @return [String, nil]
  optional :text, String

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

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

  # @!method initialize(otp_type: nil, package_name: nil, phone_number: nil, signature_hash: nil, text: nil, type: nil, url: nil)
  #   @param otp_type [Symbol, Zavudev::Models::Template::Button::OtpType] OTP button type. Required when type is 'otp'.
  #
  #   @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 text [String]
  #
  #   @param type [Symbol, Zavudev::Models::Template::Button::Type]
  #
  #   @param url [String]

  # OTP button type. Required when type is 'otp'.
  #
  # @see Zavudev::Models::Template::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

  # @see Zavudev::Models::Template::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
end

Instance Attribute Details

#otp_typeSymbol, ...

OTP button type. Required when type is ‘otp’.



167
# File 'lib/zavudev/models/template.rb', line 167

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

#package_nameString?

Android package name. Required for ONE_TAP buttons.

Returns:

  • (String, nil)


173
# File 'lib/zavudev/models/template.rb', line 173

optional :package_name, String, api_name: :packageName

#phone_numberString?

Returns:

  • (String, nil)


178
# File 'lib/zavudev/models/template.rb', line 178

optional :phone_number, String, api_name: :phoneNumber

#signature_hashString?

Android app signature hash. Required for ONE_TAP buttons.

Returns:

  • (String, nil)


184
# File 'lib/zavudev/models/template.rb', line 184

optional :signature_hash, String, api_name: :signatureHash

#textString?

Returns:

  • (String, nil)


189
# File 'lib/zavudev/models/template.rb', line 189

optional :text, String

#typeSymbol, ...

Returns:



194
# File 'lib/zavudev/models/template.rb', line 194

optional :type, enum: -> { Zavudev::Template::Button::Type }

#urlString?

Returns:

  • (String, nil)


199
# File 'lib/zavudev/models/template.rb', line 199

optional :url, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/zavudev/models/template.rb', line 225