Class: Pago::V2026_04::Models::AttachedCustomField
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema of a custom field attached to a resource.
Constant Summary collapse
- JSON_KEYS =
{ custom_field_id: "custom_field_id", custom_field: "custom_field", order: "order", required: "required" }.freeze
- REQUIRED_KEYS =
["custom_field_id", "custom_field", "order", "required"].freeze
Instance Attribute Summary collapse
- #custom_field ⇒ Object readonly
-
#custom_field_id ⇒ String
readonly
ID of the custom field.
-
#order ⇒ Integer
readonly
Order of the custom field in the resource.
-
#required ⇒ Boolean
readonly
Whether the value is required for this custom field.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(custom_field_id:, custom_field:, order:, required:) ⇒ AttachedCustomField
constructor
A new instance of AttachedCustomField.
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:, custom_field:, order:, required:) ⇒ AttachedCustomField
Returns a new instance of AttachedCustomField.
353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/pago/v2026_04/models.rb', line 353 def initialize( custom_field_id:, custom_field:, order:, required: ) super() assign(:custom_field_id, custom_field_id) assign(:custom_field, custom_field) assign(:order, order) assign(:required, required) end |
Instance Attribute Details
#custom_field ⇒ Object (readonly)
343 344 345 |
# File 'lib/pago/v2026_04/models.rb', line 343 def custom_field @custom_field end |
#custom_field_id ⇒ String (readonly)
ID of the custom field.
340 341 342 |
# File 'lib/pago/v2026_04/models.rb', line 340 def custom_field_id @custom_field_id end |
#order ⇒ Integer (readonly)
Order of the custom field in the resource.
347 348 349 |
# File 'lib/pago/v2026_04/models.rb', line 347 def order @order end |
#required ⇒ Boolean (readonly)
Whether the value is required for this custom field.
351 352 353 |
# File 'lib/pago/v2026_04/models.rb', line 351 def required @required end |
Class Method Details
.from_json(data) ⇒ AttachedCustomField?
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/pago/v2026_04/models.rb', line 368 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), custom_field: (data.key?("custom_field") ? Unions::CustomField.from_json(data["custom_field"]) : ::Pago::UNSET), order: (data.key?("order") ? data["order"] : ::Pago::UNSET), required: (data.key?("required") ? data["required"] : ::Pago::UNSET) ), data ) end |