Class: WhopSDK::Models::Plan::CustomField

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/plan.rb,
sig/whop_sdk/models/plan.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:, field_type:, name:, order:, placeholder:, required:) ⇒ Object

Custom input fields collected on the checkout form.

Parameters:

  • id (String)

    Custom field ID.

  • field_type (Symbol, WhopSDK::Models::Plan::CustomField::FieldType)

    Custom field input type.

  • name (String)

    Field label shown to customer at checkout.

  • order (Float)

    Field position on checkout form.

  • placeholder (String, nil)

    Placeholder text shown in empty field.

  • required (Boolean)

    Whether the customer must complete this field to check out.



# File 'lib/whop_sdk/models/plan.rb', line 391

Instance Attribute Details

#field_typeSymbol, WhopSDK::Models::Plan::CustomField::FieldType

Custom field input type.

Parameters:

  • value (WhopSDK::Models::Plan::CustomField::field_type)

Returns:



365
# File 'lib/whop_sdk/models/plan.rb', line 365

required :field_type, enum: -> { WhopSDK::Plan::CustomField::FieldType }

#idString

Custom field ID.

Parameters:

  • value (String)

Returns:

  • (String)


359
# File 'lib/whop_sdk/models/plan.rb', line 359

required :id, String

#nameString

Field label shown to customer at checkout.

Parameters:

  • value (String)

Returns:

  • (String)


371
# File 'lib/whop_sdk/models/plan.rb', line 371

required :name, String

#orderFloat

Field position on checkout form.

Parameters:

  • value (Float)

Returns:

  • (Float)


377
# File 'lib/whop_sdk/models/plan.rb', line 377

required :order, Float

#placeholderString?

Placeholder text shown in empty field.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


383
# File 'lib/whop_sdk/models/plan.rb', line 383

required :placeholder, String, nil?: true

#requiredBoolean

Whether the customer must complete this field to check out.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


389
# File 'lib/whop_sdk/models/plan.rb', line 389

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

Instance Method Details

#to_hash{

Returns:

  • ({)


385
# File 'sig/whop_sdk/models/plan.rbs', line 385

def to_hash: -> {