Class: Pago::V2026_04::Models::PortalAuthenticatedUser

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

Overview

Information about the authenticated portal user.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  type: "type",
  name: "name",
  email: "email",
  customer_id: "customer_id",
  member_id: "member_id",
  role: "role"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["type", "name", "email", "customer_id"].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(type:, name:, email:, customer_id:, member_id: ::Pago::UNSET, role: ::Pago::UNSET) ⇒ PortalAuthenticatedUser

Returns a new instance of PortalAuthenticatedUser.

Parameters:

  • type: (String)
  • name: (String, nil)
  • email: (String)
  • customer_id: (String)
  • member_id: (String, nil) (defaults to: ::Pago::UNSET)
  • role: (String, nil) (defaults to: ::Pago::UNSET)


35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
# File 'lib/pago/v2026_04/models.rb', line 35955

def initialize(
  type:,
  name:,
  email:,
  customer_id:,
  member_id: ::Pago::UNSET,
  role: ::Pago::UNSET
)
  super()
  assign(:type, type)
  assign(:name, name)
  assign(:email, email)
  assign(:customer_id, customer_id)
  assign(:member_id, member_id)
  assign(:role, role)
end

Instance Attribute Details

#customer_idString (readonly)

Associated customer ID.

Returns:

  • (String)


35945
35946
35947
# File 'lib/pago/v2026_04/models.rb', line 35945

def customer_id
  @customer_id
end

#emailString (readonly)

User's email address.

Returns:

  • (String)


35941
35942
35943
# File 'lib/pago/v2026_04/models.rb', line 35941

def email
  @email
end

#member_idString? (readonly)

Member ID. Only set for members.

Returns:

  • (String, nil)


35949
35950
35951
# File 'lib/pago/v2026_04/models.rb', line 35949

def member_id
  @member_id
end

#nameString? (readonly)

User's name, if available.

Returns:

  • (String, nil)


35937
35938
35939
# File 'lib/pago/v2026_04/models.rb', line 35937

def name
  @name
end

#roleString? (readonly)

Member role (owner, billing_manager, member). Only set for members.

Returns:

  • (String, nil)


35953
35954
35955
# File 'lib/pago/v2026_04/models.rb', line 35953

def role
  @role
end

#typeString (readonly)

Type of authenticated user: 'customer' or 'member'

Returns:

  • (String)


35933
35934
35935
# File 'lib/pago/v2026_04/models.rb', line 35933

def type
  @type
end

Class Method Details

.from_json(data) ⇒ PortalAuthenticatedUser?

Parameters:

  • data (Hash, String, nil)

Returns:



35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
# File 'lib/pago/v2026_04/models.rb', line 35974

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