Class: Pago::V2026_04::Models::CustomerTeamCreate

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])
{
  metadata: "metadata",
  external_id: "external_id",
  name: "name",
  billing_address: "billing_address",
  tax_id: "tax_id",
  locale: "locale",
  organization_id: "organization_id",
  owner: "owner",
  type: "type",
  email: "email"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["type"].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(metadata: ::Pago::UNSET, external_id: ::Pago::UNSET, name: ::Pago::UNSET, billing_address: ::Pago::UNSET, tax_id: ::Pago::UNSET, locale: ::Pago::UNSET, organization_id: ::Pago::UNSET, owner: ::Pago::UNSET, type:, email: ::Pago::UNSET) ⇒ CustomerTeamCreate

Returns a new instance of CustomerTeamCreate.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • external_id: (String, nil) (defaults to: ::Pago::UNSET)
  • name: (String, nil) (defaults to: ::Pago::UNSET)
  • billing_address: (Models::AddressInput, nil) (defaults to: ::Pago::UNSET)
  • tax_id: (String, nil) (defaults to: ::Pago::UNSET)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String, nil) (defaults to: ::Pago::UNSET)
  • owner: (Models::MemberOwnerCreate, nil) (defaults to: ::Pago::UNSET)
  • type: (String)
  • email: (String, nil) (defaults to: ::Pago::UNSET)


21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
# File 'lib/pago/v2026_04/models.rb', line 21788

def initialize(
  metadata: ::Pago::UNSET,
  external_id: ::Pago::UNSET,
  name: ::Pago::UNSET,
  billing_address: ::Pago::UNSET,
  tax_id: ::Pago::UNSET,
  locale: ::Pago::UNSET,
  organization_id: ::Pago::UNSET,
  owner: ::Pago::UNSET,
  type:,
  email: ::Pago::UNSET
)
  super()
  assign(:metadata, )
  assign(:external_id, external_id)
  assign(:name, name)
  assign(:billing_address, billing_address)
  assign(:tax_id, tax_id)
  assign(:locale, locale)
  assign(:organization_id, organization_id)
  assign(:owner, owner)
  assign(:type, type)
  assign(:email, email)
end

Instance Attribute Details

#billing_addressModels::AddressInput? (readonly)

Returns:



21765
21766
21767
# File 'lib/pago/v2026_04/models.rb', line 21765

def billing_address
  @billing_address
end

#emailString? (readonly)

The email address of the team customer. Optional for team customers — if omitted, an owner with an email must be provided.

Returns:

  • (String, nil)


21786
21787
21788
# File 'lib/pago/v2026_04/models.rb', line 21786

def email
  @email
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)


21759
21760
21761
# File 'lib/pago/v2026_04/models.rb', line 21759

def external_id
  @external_id
end

#localeString? (readonly)

Returns:

  • (String, nil)


21771
21772
21773
# File 'lib/pago/v2026_04/models.rb', line 21771

def locale
  @locale
end

#metadataHash{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.

Returns:

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


21755
21756
21757
# File 'lib/pago/v2026_04/models.rb', line 21755

def 
  @metadata
end

#nameString? (readonly)

Returns:

  • (String, nil)


21762
21763
21764
# File 'lib/pago/v2026_04/models.rb', line 21762

def name
  @name
end

#organization_idString? (readonly)

The ID of the organization owning the customer. Required unless you use an organization token.

Returns:

  • (String, nil)


21775
21776
21777
# File 'lib/pago/v2026_04/models.rb', line 21775

def organization_id
  @organization_id
end

#ownerModels::MemberOwnerCreate? (readonly)

Optional owner member to create with the customer. If not provided, an owner member will be automatically created using the customer's email and name.

Returns:



21779
21780
21781
# File 'lib/pago/v2026_04/models.rb', line 21779

def owner
  @owner
end

#tax_idString? (readonly)

Returns:

  • (String, nil)


21768
21769
21770
# File 'lib/pago/v2026_04/models.rb', line 21768

def tax_id
  @tax_id
end

#typeString (readonly)

Returns:

  • (String)


21782
21783
21784
# File 'lib/pago/v2026_04/models.rb', line 21782

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerTeamCreate?

Parameters:

  • data (Hash, String, nil)

Returns:



21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
# File 'lib/pago/v2026_04/models.rb', line 21815

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),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      billing_address: (data.key?("billing_address") ? Models::AddressInput.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),
      owner: (data.key?("owner") ? Models::MemberOwnerCreate.from_json(data["owner"]) : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET)
    ),
    data
  )
end