Class: Pago::V2026_04::Models::BenefitMeterCreditCreate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema to create a benefit of type meter_unit.
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", type: "type", description: "description", organization_id: "organization_id", visibility: "visibility", properties: "properties" }.freeze
- REQUIRED_KEYS =
["type", "description", "properties"].freeze
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description of the benefit.
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
-
#organization_id ⇒ String?
readonly
The ID of the organization owning the benefit.
- #properties ⇒ Models::BenefitMeterCreditCreateProperties readonly
- #type ⇒ String readonly
-
#visibility ⇒ String?
readonly
The visibility of the benefit in the customer portal.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, type:, description:, organization_id: ::Pago::UNSET, visibility: ::Pago::UNSET, properties:) ⇒ BenefitMeterCreditCreate
constructor
A new instance of BenefitMeterCreditCreate.
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:, description:, organization_id: ::Pago::UNSET, visibility: ::Pago::UNSET, properties:) ⇒ BenefitMeterCreditCreate
Returns a new instance of BenefitMeterCreditCreate.
7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 |
# File 'lib/pago/v2026_04/models.rb', line 7480 def initialize( metadata: ::Pago::UNSET, type:, description:, organization_id: ::Pago::UNSET, visibility: ::Pago::UNSET, properties: ) super() assign(:metadata, ) assign(:type, type) assign(:description, description) assign(:organization_id, organization_id) assign(:visibility, visibility) assign(:properties, properties) end |
Instance Attribute Details
#description ⇒ String (readonly)
The description of the benefit. Will be displayed on products having this benefit.
7467 7468 7469 |
# File 'lib/pago/v2026_04/models.rb', line 7467 def description @description end |
#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.
7460 7461 7462 |
# File 'lib/pago/v2026_04/models.rb', line 7460 def @metadata end |
#organization_id ⇒ String? (readonly)
The ID of the organization owning the benefit. Required unless you use an organization token.
7471 7472 7473 |
# File 'lib/pago/v2026_04/models.rb', line 7471 def organization_id @organization_id end |
#properties ⇒ Models::BenefitMeterCreditCreateProperties (readonly)
7478 7479 7480 |
# File 'lib/pago/v2026_04/models.rb', line 7478 def properties @properties end |
#type ⇒ String (readonly)
7463 7464 7465 |
# File 'lib/pago/v2026_04/models.rb', line 7463 def type @type end |
#visibility ⇒ String? (readonly)
The visibility of the benefit in the customer portal.
7475 7476 7477 |
# File 'lib/pago/v2026_04/models.rb', line 7475 def visibility @visibility end |
Class Method Details
.from_json(data) ⇒ BenefitMeterCreditCreate?
7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 |
# File 'lib/pago/v2026_04/models.rb', line 7499 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), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET), properties: (data.key?("properties") ? Models::BenefitMeterCreditCreateProperties.from_json(data["properties"]) : ::Pago::UNSET) ), data ) end |