Class: Pago::V2026_04::Models::CustomerOrganizationData

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema of an organization and related data for customer portal.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  organization: "organization",
  products: "products"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["organization", "products"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(organization:, products:) ⇒ CustomerOrganizationData

Returns a new instance of CustomerOrganizationData.

Parameters:



18374
18375
18376
18377
18378
18379
18380
18381
# File 'lib/pago/v2026_04/models.rb', line 18374

def initialize(
  organization:,
  products:
)
  super()
  assign(:organization, organization)
  assign(:products, products)
end

Instance Attribute Details

#organizationModels::CustomerOrganization (readonly)



18369
18370
18371
# File 'lib/pago/v2026_04/models.rb', line 18369

def organization
  @organization
end

#productsArray<Models::CustomerProduct> (readonly)

Returns:



18372
18373
18374
# File 'lib/pago/v2026_04/models.rb', line 18372

def products
  @products
end

Class Method Details

.from_json(data) ⇒ CustomerOrganizationData?

Parameters:

  • data (Hash, String, nil)

Returns:



18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
# File 'lib/pago/v2026_04/models.rb', line 18385

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(
      organization: (data.key?("organization") ? Models::CustomerOrganization.from_json(data["organization"]) : ::Pago::UNSET),
      products: (data.key?("products") ? ::Pago::Serde.array(data["products"]) { |item0| Models::CustomerProduct.from_json(item0) } : ::Pago::UNSET)
    ),
    data
  )
end