Class: Pago::V2026_04::Models::CustomFieldUpdateSelect

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema to update a custom field of type select.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  metadata: "metadata",
  name: "name",
  slug: "slug",
  type: "type",
  properties: "properties"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["type"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(metadata: ::Pago::UNSET, name: ::Pago::UNSET, slug: ::Pago::UNSET, type:, properties: ::Pago::UNSET) ⇒ CustomFieldUpdateSelect

Returns a new instance of CustomFieldUpdateSelect.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • name: (String, nil) (defaults to: ::Pago::UNSET)
  • slug: (String, nil) (defaults to: ::Pago::UNSET)
  • type: (String)
  • properties: (Models::CustomFieldSelectProperties, nil) (defaults to: ::Pago::UNSET)


14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
# File 'lib/pago/v2026_04/models.rb', line 14608

def initialize(
  metadata: ::Pago::UNSET,
  name: ::Pago::UNSET,
  slug: ::Pago::UNSET,
  type:,
  properties: ::Pago::UNSET
)
  super()
  assign(:metadata, )
  assign(:name, name)
  assign(:slug, slug)
  assign(:type, type)
  assign(:properties, properties)
end

Instance Attribute Details

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


14594
14595
14596
# File 'lib/pago/v2026_04/models.rb', line 14594

def 
  @metadata
end

#nameString? (readonly)

Returns:

  • (String, nil)


14597
14598
14599
# File 'lib/pago/v2026_04/models.rb', line 14597

def name
  @name
end

#propertiesModels::CustomFieldSelectProperties? (readonly)



14606
14607
14608
# File 'lib/pago/v2026_04/models.rb', line 14606

def properties
  @properties
end

#slugString? (readonly)

Returns:

  • (String, nil)


14600
14601
14602
# File 'lib/pago/v2026_04/models.rb', line 14600

def slug
  @slug
end

#typeString (readonly)

Returns:

  • (String)


14603
14604
14605
# File 'lib/pago/v2026_04/models.rb', line 14603

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomFieldUpdateSelect?

Parameters:

  • data (Hash, String, nil)

Returns:



14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
# File 'lib/pago/v2026_04/models.rb', line 14625

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      slug: (data.key?("slug") ? data["slug"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::CustomFieldSelectProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end