Class: Pago::V2026_04::Models::OrganizationCustomerPortalSettings

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  usage: "usage",
  subscription: "subscription",
  customer: "customer"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["usage", "subscription"].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(usage:, subscription:, customer: ::Pago::UNSET) ⇒ OrganizationCustomerPortalSettings

Returns a new instance of OrganizationCustomerPortalSettings.

Parameters:



34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
# File 'lib/pago/v2026_04/models.rb', line 34648

def initialize(
  usage:,
  subscription:,
  customer: ::Pago::UNSET
)
  super()
  assign(:usage, usage)
  assign(:subscription, subscription)
  assign(:customer, customer)
end

Instance Attribute Details

#customerModels::CustomerPortalCustomerSettings (readonly)



34646
34647
34648
# File 'lib/pago/v2026_04/models.rb', line 34646

def customer
  @customer
end

#subscriptionModels::CustomerPortalSubscriptionSettings (readonly)



34643
34644
34645
# File 'lib/pago/v2026_04/models.rb', line 34643

def subscription
  @subscription
end

#usageModels::CustomerPortalUsageSettings (readonly)



34640
34641
34642
# File 'lib/pago/v2026_04/models.rb', line 34640

def usage
  @usage
end

Class Method Details

.from_json(data) ⇒ OrganizationCustomerPortalSettings?

Parameters:

  • data (Hash, String, nil)

Returns:



34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
# File 'lib/pago/v2026_04/models.rb', line 34661

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(
      usage: (data.key?("usage") ? Models::CustomerPortalUsageSettings.from_json(data["usage"]) : ::Pago::UNSET),
      subscription: (data.key?("subscription") ? Models::CustomerPortalSubscriptionSettings.from_json(data["subscription"]) : ::Pago::UNSET),
      customer: (data.key?("customer") ? Models::CustomerPortalCustomerSettings.from_json(data["customer"]) : ::Pago::UNSET)
    ),
    data
  )
end