Class: Pago::V2026_04::Models::Member

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

Overview

A member of a customer.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  customer_id: "customer_id",
  email: "email",
  name: "name",
  external_id: "external_id",
  role: "role"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "customer_id", "email", "name", "external_id", "role"].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:, customer_id:, email:, name:, external_id:, role:) ⇒ Member

Returns a new instance of Member.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • customer_id: (String)
  • email: (String)
  • name: (String, nil)
  • external_id: (String, nil)
  • role: (String)


28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
# File 'lib/pago/v2026_04/models.rb', line 28805

def initialize(
  id:,
  created_at:,
  modified_at:,
  customer_id:,
  email:,
  name:,
  external_id:,
  role:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:customer_id, customer_id)
  assign(:email, email)
  assign(:name, name)
  assign(:external_id, external_id)
  assign(:role, role)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


28780
28781
28782
# File 'lib/pago/v2026_04/models.rb', line 28780

def created_at
  @created_at
end

#customer_idString (readonly)

The ID of the customer this member belongs to.

Returns:

  • (String)


28788
28789
28790
# File 'lib/pago/v2026_04/models.rb', line 28788

def customer_id
  @customer_id
end

#emailString (readonly)

The email address of the member.

Returns:

  • (String)


28792
28793
28794
# File 'lib/pago/v2026_04/models.rb', line 28792

def email
  @email
end

#external_idString? (readonly)

The ID of the member in your system. This must be unique within the customer.

Returns:

  • (String, nil)


28800
28801
28802
# File 'lib/pago/v2026_04/models.rb', line 28800

def external_id
  @external_id
end

#idString (readonly)

The ID of the member.

Returns:

  • (String)


28776
28777
28778
# File 'lib/pago/v2026_04/models.rb', line 28776

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


28784
28785
28786
# File 'lib/pago/v2026_04/models.rb', line 28784

def modified_at
  @modified_at
end

#nameString? (readonly)

The name of the member.

Returns:

  • (String, nil)


28796
28797
28798
# File 'lib/pago/v2026_04/models.rb', line 28796

def name
  @name
end

#roleString (readonly)

Returns:

  • (String)


28803
28804
28805
# File 'lib/pago/v2026_04/models.rb', line 28803

def role
  @role
end

Class Method Details

.from_json(data) ⇒ Member?

Parameters:

  • data (Hash, String, nil)

Returns:



28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
# File 'lib/pago/v2026_04/models.rb', line 28828

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),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      email: (data.key?("email") ? data["email"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      external_id: (data.key?("external_id") ? data["external_id"] : ::Pago::UNSET),
      role: (data.key?("role") ? data["role"] : ::Pago::UNSET)
    ),
    data
  )
end