Class: Pago::V2026_04::Models::AttachedCustomFieldCreate
- 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 =
{ custom_field_id: "custom_field_id", required: "required" }.freeze
- REQUIRED_KEYS =
["custom_field_id", "required"].freeze
Instance Attribute Summary collapse
-
#custom_field_id ⇒ String
readonly
ID of the custom field to attach.
-
#required ⇒ Boolean
readonly
Whether the value is required for this custom field.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(custom_field_id:, required:) ⇒ AttachedCustomFieldCreate
constructor
A new instance of AttachedCustomFieldCreate.
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.
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_id ⇒ String (readonly)
ID of the custom field to attach.
395 396 397 |
# File 'lib/pago/v2026_04/models.rb', line 395 def custom_field_id @custom_field_id end |
#required ⇒ Boolean (readonly)
Whether the value is required for this custom field.
399 400 401 |
# File 'lib/pago/v2026_04/models.rb', line 399 def required @required end |
Class Method Details
.from_json(data) ⇒ AttachedCustomFieldCreate?
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 |