Class: Pago::V2026_04::Models::BenefitMeterCredit
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A benefit of type meter_unit.
Use it to grant a number of units on a specific meter.
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", type: "type", description: "description", selectable: "selectable", deletable: "deletable", is_deleted: "is_deleted", organization_id: "organization_id", metadata: "metadata", visibility: "visibility", properties: "properties", visibility_configurable: "visibility_configurable" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "type", "description", "selectable", "deletable", "is_deleted", "organization_id", "metadata", "visibility", "properties", "visibility_configurable"].freeze
Instance Attribute Summary collapse
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#deletable ⇒ Boolean
readonly
Whether the benefit is deletable.
-
#description ⇒ String
readonly
The description of the benefit.
-
#id ⇒ String
readonly
The ID of the benefit.
-
#is_deleted ⇒ Boolean
readonly
Whether the benefit is deleted.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#organization_id ⇒ String
readonly
The ID of the organization owning the benefit.
- #properties ⇒ Models::BenefitMeterCreditProperties readonly
-
#selectable ⇒ Boolean
readonly
Whether the benefit is selectable when creating a product.
- #type ⇒ String readonly
- #visibility ⇒ String readonly
- #visibility_configurable ⇒ Boolean readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable:) ⇒ BenefitMeterCredit
constructor
A new instance of BenefitMeterCredit.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable:) ⇒ BenefitMeterCredit
Returns a new instance of BenefitMeterCredit.
7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 |
# File 'lib/pago/v2026_04/models.rb', line 7377 def initialize( id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, metadata:, visibility:, properties:, visibility_configurable: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:type, type) assign(:description, description) assign(:selectable, selectable) assign(:deletable, deletable) assign(:is_deleted, is_deleted) assign(:organization_id, organization_id) assign(:metadata, ) assign(:visibility, visibility) assign(:properties, properties) assign(:visibility_configurable, visibility_configurable) end |
Instance Attribute Details
#created_at ⇒ String (readonly)
Creation timestamp of the object.
7336 7337 7338 |
# File 'lib/pago/v2026_04/models.rb', line 7336 def created_at @created_at end |
#deletable ⇒ Boolean (readonly)
Whether the benefit is deletable.
7355 7356 7357 |
# File 'lib/pago/v2026_04/models.rb', line 7355 def deletable @deletable end |
#description ⇒ String (readonly)
The description of the benefit.
7347 7348 7349 |
# File 'lib/pago/v2026_04/models.rb', line 7347 def description @description end |
#id ⇒ String (readonly)
The ID of the benefit.
7332 7333 7334 |
# File 'lib/pago/v2026_04/models.rb', line 7332 def id @id end |
#is_deleted ⇒ Boolean (readonly)
Whether the benefit is deleted.
7359 7360 7361 |
# File 'lib/pago/v2026_04/models.rb', line 7359 def is_deleted @is_deleted end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
7366 7367 7368 |
# File 'lib/pago/v2026_04/models.rb', line 7366 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
7340 7341 7342 |
# File 'lib/pago/v2026_04/models.rb', line 7340 def modified_at @modified_at end |
#organization_id ⇒ String (readonly)
The ID of the organization owning the benefit.
7363 7364 7365 |
# File 'lib/pago/v2026_04/models.rb', line 7363 def organization_id @organization_id end |
#properties ⇒ Models::BenefitMeterCreditProperties (readonly)
7372 7373 7374 |
# File 'lib/pago/v2026_04/models.rb', line 7372 def properties @properties end |
#selectable ⇒ Boolean (readonly)
Whether the benefit is selectable when creating a product.
7351 7352 7353 |
# File 'lib/pago/v2026_04/models.rb', line 7351 def selectable @selectable end |
#type ⇒ String (readonly)
7343 7344 7345 |
# File 'lib/pago/v2026_04/models.rb', line 7343 def type @type end |
#visibility ⇒ String (readonly)
7369 7370 7371 |
# File 'lib/pago/v2026_04/models.rb', line 7369 def visibility @visibility end |
#visibility_configurable ⇒ Boolean (readonly)
7375 7376 7377 |
# File 'lib/pago/v2026_04/models.rb', line 7375 def visibility_configurable @visibility_configurable end |
Class Method Details
.from_json(data) ⇒ BenefitMeterCredit?
7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 |
# File 'lib/pago/v2026_04/models.rb', line 7410 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), description: (data.key?("description") ? data["description"] : ::Pago::UNSET), selectable: (data.key?("selectable") ? data["selectable"] : ::Pago::UNSET), deletable: (data.key?("deletable") ? data["deletable"] : ::Pago::UNSET), is_deleted: (data.key?("is_deleted") ? data["is_deleted"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET), properties: (data.key?("properties") ? Models::BenefitMeterCreditProperties.from_json(data["properties"]) : ::Pago::UNSET), visibility_configurable: (data.key?("visibility_configurable") ? data["visibility_configurable"] : ::Pago::UNSET) ), data ) end |