Class: Pago::V2026_04::Models::AttachedCustomFieldCreate

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

Overview

Schema to attach a custom field to a resource.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  custom_field_id: "custom_field_id",
  required: "required"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["custom_field_id", "required"].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(custom_field_id:, required:) ⇒ AttachedCustomFieldCreate

Returns a new instance of AttachedCustomFieldCreate.

Parameters:

  • custom_field_id: (String)
  • required: (Boolean)


401
402
403
404
405
406
407
408
# File 'lib/pago/v2026_04/models.rb', line 401

def initialize(
  custom_field_id:,
  required:
)
  super()
  assign(:custom_field_id, custom_field_id)
  assign(:required, required)
end

Instance Attribute Details

#custom_field_idString (readonly)

ID of the custom field to attach.

Returns:

  • (String)


395
396
397
# File 'lib/pago/v2026_04/models.rb', line 395

def custom_field_id
  @custom_field_id
end

#requiredBoolean (readonly)

Whether the value is required for this custom field.

Returns:

  • (Boolean)


399
400
401
# File 'lib/pago/v2026_04/models.rb', line 399

def required
  @required
end

Class Method Details

.from_json(data) ⇒ AttachedCustomFieldCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/pago/v2026_04/models.rb', line 412

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(
      custom_field_id: (data.key?("custom_field_id") ? data["custom_field_id"] : ::Pago::UNSET),
      required: (data.key?("required") ? data["required"] : ::Pago::UNSET)
    ),
    data
  )
end