Class: Pago::V2026_04::Models::CustomerStateTeam

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

Overview

A team customer along with additional state information:

  • Active subscriptions
  • Granted benefits
  • Active meters

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  metadata: "metadata",
  external_id: "external_id",
  email: "email",
  email_verified: "email_verified",
  type: "type",
  name: "name",
  billing_name: "billing_name",
  billing_address: "billing_address",
  tax_id: "tax_id",
  locale: "locale",
  organization_id: "organization_id",
  default_payment_method_id: "default_payment_method_id",
  deleted_at: "deleted_at",
  avatar_url: "avatar_url",
  active_subscriptions: "active_subscriptions",
  granted_benefits: "granted_benefits",
  active_meters: "active_meters"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "metadata", "email_verified", "type", "name", "billing_name", "billing_address", "tax_id", "organization_id", "deleted_at", "avatar_url", "active_subscriptions", "granted_benefits", "active_meters"].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(id:, created_at:, modified_at:, metadata:, external_id: ::Pago::UNSET, email: ::Pago::UNSET, email_verified:, type:, name:, billing_name:, billing_address:, tax_id:, locale: ::Pago::UNSET, organization_id:, default_payment_method_id: ::Pago::UNSET, deleted_at:, avatar_url:, active_subscriptions:, granted_benefits:, active_meters:) ⇒ CustomerStateTeam

Returns a new instance of CustomerStateTeam.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • metadata: (Hash[String, untyped])
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • email: (String, nil) (defaults to: ::Pago::UNSET)
  • email_verified: (Boolean)
  • type: (String)
  • name: (String, nil)
  • billing_name: (String, nil)
  • billing_address: (Models::Address, nil)
  • tax_id: (Array[untyped], nil)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String)
  • default_payment_method_id: (String, nil) (defaults to: ::Pago::UNSET)
  • deleted_at: (String, nil)
  • avatar_url: (String, nil)
  • active_subscriptions: (Array[Models::CustomerStateSubscription])
  • granted_benefits: (Array[Models::CustomerStateBenefitGrant])
  • active_meters: (Array[Models::CustomerStateMeter])


20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
# File 'lib/pago/v2026_04/models.rb', line 20644

def initialize(
  id:,
  created_at:,
  modified_at:,
  metadata:,
  external_id: ::Pago::UNSET,
  email: ::Pago::UNSET,
  email_verified:,
  type:,
  name:,
  billing_name:,
  billing_address:,
  tax_id:,
  locale: ::Pago::UNSET,
  organization_id:,
  default_payment_method_id: ::Pago::UNSET,
  deleted_at:,
  avatar_url:,
  active_subscriptions:,
  granted_benefits:,
  active_meters:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:metadata, )
  assign(:external_id, external_id)
  assign(:email, email)
  assign(:email_verified, email_verified)
  assign(:type, type)
  assign(:name, name)
  assign(:billing_name, billing_name)
  assign(:billing_address, billing_address)
  assign(:tax_id, tax_id)
  assign(:locale, locale)
  assign(:organization_id, organization_id)
  assign(:default_payment_method_id, default_payment_method_id)
  assign(:deleted_at, deleted_at)
  assign(:avatar_url, avatar_url)
  assign(:active_subscriptions, active_subscriptions)
  assign(:granted_benefits, granted_benefits)
  assign(:active_meters, active_meters)
end

Instance Attribute Details

#active_metersArray<Models::CustomerStateMeter> (readonly)

The customer's active meters.

Returns:



20642
20643
20644
# File 'lib/pago/v2026_04/models.rb', line 20642

def active_meters
  @active_meters
end

#active_subscriptionsArray<Models::CustomerStateSubscription> (readonly)

The customer's active subscriptions.



20634
20635
20636
# File 'lib/pago/v2026_04/models.rb', line 20634

def active_subscriptions
  @active_subscriptions
end

#avatar_urlString? (readonly)

Returns:

  • (String, nil)


20630
20631
20632
# File 'lib/pago/v2026_04/models.rb', line 20630

def avatar_url
  @avatar_url
end

#billing_addressModels::Address? (readonly)

Returns:



20609
20610
20611
# File 'lib/pago/v2026_04/models.rb', line 20609

def billing_address
  @billing_address
end

#billing_nameString? (readonly)

The name that should appear on the customer's invoices. Falls back to the customer name when not explicitly set.

Returns:

  • (String, nil)


20606
20607
20608
# File 'lib/pago/v2026_04/models.rb', line 20606

def billing_name
  @billing_name
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


20575
20576
20577
# File 'lib/pago/v2026_04/models.rb', line 20575

def created_at
  @created_at
end

#default_payment_method_idString? (readonly)

The ID of the customer's default payment method, if any. Use the payment methods endpoint to retrieve its details.

Returns:

  • (String, nil)


20623
20624
20625
# File 'lib/pago/v2026_04/models.rb', line 20623

def default_payment_method_id
  @default_payment_method_id
end

#deleted_atString? (readonly)

Timestamp for when the customer was soft deleted.

Returns:

  • (String, nil)


20627
20628
20629
# File 'lib/pago/v2026_04/models.rb', line 20627

def deleted_at
  @deleted_at
end

#emailString? (readonly)

The email address of the customer. This must be unique within the organization.

Returns:

  • (String, nil)


20590
20591
20592
# File 'lib/pago/v2026_04/models.rb', line 20590

def email
  @email
end

#email_verifiedBoolean (readonly)

Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.

Returns:

  • (Boolean)


20594
20595
20596
# File 'lib/pago/v2026_04/models.rb', line 20594

def email_verified
  @email_verified
end

#external_idString? (readonly)

The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.

Returns:

  • (String, nil)


20586
20587
20588
# File 'lib/pago/v2026_04/models.rb', line 20586

def external_id
  @external_id
end

#granted_benefitsArray<Models::CustomerStateBenefitGrant> (readonly)

The customer's active benefit grants.



20638
20639
20640
# File 'lib/pago/v2026_04/models.rb', line 20638

def granted_benefits
  @granted_benefits
end

#idString (readonly)

The ID of the customer.

Returns:

  • (String)


20571
20572
20573
# File 'lib/pago/v2026_04/models.rb', line 20571

def id
  @id
end

#localeString? (readonly)

Returns:

  • (String, nil)


20615
20616
20617
# File 'lib/pago/v2026_04/models.rb', line 20615

def locale
  @locale
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


20582
20583
20584
# File 'lib/pago/v2026_04/models.rb', line 20582

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


20579
20580
20581
# File 'lib/pago/v2026_04/models.rb', line 20579

def modified_at
  @modified_at
end

#nameString? (readonly)

The name of the customer.

Returns:

  • (String, nil)


20602
20603
20604
# File 'lib/pago/v2026_04/models.rb', line 20602

def name
  @name
end

#organization_idString (readonly)

The ID of the organization owning the customer.

Returns:

  • (String)


20619
20620
20621
# File 'lib/pago/v2026_04/models.rb', line 20619

def organization_id
  @organization_id
end

#tax_idArray<Object>? (readonly)

Returns:

  • (Array<Object>, nil)


20612
20613
20614
# File 'lib/pago/v2026_04/models.rb', line 20612

def tax_id
  @tax_id
end

#typeString (readonly)

The type of customer. Team customers can have multiple members.

Returns:

  • (String)


20598
20599
20600
# File 'lib/pago/v2026_04/models.rb', line 20598

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerStateTeam?

Parameters:

  • data (Hash, String, nil)

Returns:



20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
# File 'lib/pago/v2026_04/models.rb', line 20691

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),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET),
      email_verified: (data.key?("email_verified") ? data["email_verified"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      billing_name: (data.key?("billing_name") ? data["billing_name"] : ::Pago::UNSET),
      billing_address: (data.key?("billing_address") ? Models::Address.from_json(data["billing_address"]) : ::Pago::UNSET),
      tax_id: (data.key?("tax_id") ? data["tax_id"] : ::Pago::UNSET),
      locale: (data.key?("locale") ? data["locale"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      default_payment_method_id: (data.key?("default_payment_method_id") ? data["default_payment_method_id"] : ::Pago::UNSET),
      deleted_at: (data.key?("deleted_at") ? data["deleted_at"] : ::Pago::UNSET),
      avatar_url: (data.key?("avatar_url") ? data["avatar_url"] : ::Pago::UNSET),
      active_subscriptions: (data.key?("active_subscriptions") ? ::Pago::Serde.array(data["active_subscriptions"]) { |item0| Models::CustomerStateSubscription.from_json(item0) } : ::Pago::UNSET),
      granted_benefits: (data.key?("granted_benefits") ? ::Pago::Serde.array(data["granted_benefits"]) { |item0| Models::CustomerStateBenefitGrant.from_json(item0) } : ::Pago::UNSET),
      active_meters: (data.key?("active_meters") ? ::Pago::Serde.array(data["active_meters"]) { |item0| Models::CustomerStateMeter.from_json(item0) } : ::Pago::UNSET)
    ),
    data
  )
end