Class: WhopSDK::Models::PlanCreateParams::CustomField

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

Defined Under Namespace

Modules: FieldType

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(id: nil, field_type: nil, name: nil, order: nil, placeholder: nil, required: nil) ⇒ Object

Parameters:

  • id (String) (defaults to: nil)

    The ID of the custom field (if being updated).

  • field_type (Symbol, WhopSDK::Models::PlanCreateParams::CustomField::FieldType) (defaults to: nil)

    The type of the custom field.

  • name (String) (defaults to: nil)

    The name of the custom field.

  • order (Integer) (defaults to: nil)

    The order of the field.

  • placeholder (String, nil) (defaults to: nil)

    An example response displayed in the input field.

  • required (Boolean) (defaults to: nil)

    Whether or not the field is required.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/whop_sdk/models/plan_create_params.rb', line 235

class CustomField < WhopSDK::Internal::Type::BaseModel
  # @!attribute id
  #   The ID of the custom field (if being updated).
  #
  #   @return [String, nil]
  optional :id, String

  # @!attribute field_type
  #   The type of the custom field.
  #
  #   @return [Symbol, WhopSDK::Models::PlanCreateParams::CustomField::FieldType, nil]
  optional :field_type, enum: -> { WhopSDK::PlanCreateParams::CustomField::FieldType }

  # @!attribute name
  #   The name of the custom field.
  #
  #   @return [String, nil]
  optional :name, String

  # @!attribute order
  #   The order of the field.
  #
  #   @return [Integer, nil]
  optional :order, Integer

  # @!attribute placeholder
  #   An example response displayed in the input field.
  #
  #   @return [String, nil]
  optional :placeholder, String, nil?: true

  # @!attribute required
  #   Whether or not the field is required.
  #
  #   @return [Boolean, nil]
  optional :required, WhopSDK::Internal::Type::Boolean

  # @!method initialize(id: nil, field_type: nil, name: nil, order: nil, placeholder: nil, required: nil)
  #   @param id [String] The ID of the custom field (if being updated).
  #
  #   @param field_type [Symbol, WhopSDK::Models::PlanCreateParams::CustomField::FieldType] The type of the custom field.
  #
  #   @param name [String] The name of the custom field.
  #
  #   @param order [Integer] The order of the field.
  #
  #   @param placeholder [String, nil] An example response displayed in the input field.
  #
  #   @param required [Boolean] Whether or not the field is required.

  # The type of the custom field.
  #
  # @see WhopSDK::Models::PlanCreateParams::CustomField#field_type
  module FieldType
    extend WhopSDK::Internal::Type::Enum

    TEXT = :text

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

Instance Attribute Details

#field_typeSymbol, ...

The type of the custom field.



246
# File 'lib/whop_sdk/models/plan_create_params.rb', line 246

optional :field_type, enum: -> { WhopSDK::PlanCreateParams::CustomField::FieldType }

#idString?

The ID of the custom field (if being updated).

Parameters:

  • (String)

Returns:

  • (String, nil)


240
# File 'lib/whop_sdk/models/plan_create_params.rb', line 240

optional :id, String

#nameString?

The name of the custom field.

Parameters:

  • (String)

Returns:

  • (String, nil)


252
# File 'lib/whop_sdk/models/plan_create_params.rb', line 252

optional :name, String

#orderInteger?

The order of the field.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


258
# File 'lib/whop_sdk/models/plan_create_params.rb', line 258

optional :order, Integer

#placeholderString?

An example response displayed in the input field.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


264
# File 'lib/whop_sdk/models/plan_create_params.rb', line 264

optional :placeholder, String, nil?: true

#requiredBoolean?

Whether or not the field is required.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


270
# File 'lib/whop_sdk/models/plan_create_params.rb', line 270

optional :required, WhopSDK::Internal::Type::Boolean

Instance Method Details

#to_hash{

Returns:

  • ({)


212
# File 'sig/whop_sdk/models/plan_create_params.rbs', line 212

def to_hash: -> {