Class: Pago::V2026_04::Models::CustomFieldCreateNumber
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema to create a custom field of type number.
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", type: "type", slug: "slug", name: "name", organization_id: "organization_id", properties: "properties" }.freeze
- REQUIRED_KEYS =
["type", "slug", "name", "properties"].freeze
Instance Attribute Summary collapse
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
-
#name ⇒ String
readonly
Name of the custom field.
-
#organization_id ⇒ String?
readonly
The ID of the organization owning the custom field.
- #properties ⇒ Models::CustomFieldNumberProperties readonly
-
#slug ⇒ String
readonly
Identifier of the custom field.
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, type:, slug:, name:, organization_id: ::Pago::UNSET, properties:) ⇒ CustomFieldCreateNumber
constructor
A new instance of CustomFieldCreateNumber.
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, type:, slug:, name:, organization_id: ::Pago::UNSET, properties:) ⇒ CustomFieldCreateNumber
Returns a new instance of CustomFieldCreateNumber.
13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 |
# File 'lib/pago/v2026_04/models.rb', line 13494 def initialize( metadata: ::Pago::UNSET, type:, slug:, name:, organization_id: ::Pago::UNSET, properties: ) super() assign(:metadata, ) assign(:type, type) assign(:slug, slug) assign(:name, name) assign(:organization_id, organization_id) assign(:properties, properties) end |
Instance Attribute Details
#metadata ⇒ Hash{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.
13474 13475 13476 |
# File 'lib/pago/v2026_04/models.rb', line 13474 def @metadata end |
#name ⇒ String (readonly)
Name of the custom field.
13485 13486 13487 |
# File 'lib/pago/v2026_04/models.rb', line 13485 def name @name end |
#organization_id ⇒ String? (readonly)
The ID of the organization owning the custom field. Required unless you use an organization token.
13489 13490 13491 |
# File 'lib/pago/v2026_04/models.rb', line 13489 def organization_id @organization_id end |
#properties ⇒ Models::CustomFieldNumberProperties (readonly)
13492 13493 13494 |
# File 'lib/pago/v2026_04/models.rb', line 13492 def properties @properties end |
#slug ⇒ String (readonly)
Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens.
13481 13482 13483 |
# File 'lib/pago/v2026_04/models.rb', line 13481 def slug @slug end |
#type ⇒ String (readonly)
13477 13478 13479 |
# File 'lib/pago/v2026_04/models.rb', line 13477 def type @type end |
Class Method Details
.from_json(data) ⇒ CustomFieldCreateNumber?
13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 |
# File 'lib/pago/v2026_04/models.rb', line 13513 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), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), slug: (data.key?("slug") ? data["slug"] : ::Pago::UNSET), name: (data.key?("name") ? data["name"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), properties: (data.key?("properties") ? Models::CustomFieldNumberProperties.from_json(data["properties"]) : ::Pago::UNSET) ), data ) end |