Class: Pago::V2026_04::Models::CustomerSession

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

Overview

A customer session that can be used to authenticate as a customer.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  token: "token",
  expires_at: "expires_at",
  return_url: "return_url",
  customer_portal_url: "customer_portal_url",
  customer_id: "customer_id",
  customer: "customer"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "token", "expires_at", "return_url", "customer_portal_url", "customer_id", "customer"].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(created_at:, modified_at:, id:, token:, expires_at:, return_url:, customer_portal_url:, customer_id:, customer:) ⇒ CustomerSession

Returns a new instance of CustomerSession.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • token: (String)
  • expires_at: (String)
  • return_url: (String, nil)
  • customer_portal_url: (String)
  • customer_id: (String)
  • customer: (Object)


19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
# File 'lib/pago/v2026_04/models.rb', line 19757

def initialize(
  created_at:,
  modified_at:,
  id:,
  token:,
  expires_at:,
  return_url:,
  customer_portal_url:,
  customer_id:,
  customer:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:token, token)
  assign(:expires_at, expires_at)
  assign(:return_url, return_url)
  assign(:customer_portal_url, customer_portal_url)
  assign(:customer_id, customer_id)
  assign(:customer, customer)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


19729
19730
19731
# File 'lib/pago/v2026_04/models.rb', line 19729

def created_at
  @created_at
end

#customerObject (readonly)

Returns:

  • (Object)


19755
19756
19757
# File 'lib/pago/v2026_04/models.rb', line 19755

def customer
  @customer
end

#customer_idString (readonly)

Returns:

  • (String)


19752
19753
19754
# File 'lib/pago/v2026_04/models.rb', line 19752

def customer_id
  @customer_id
end

#customer_portal_urlString (readonly)

Returns:

  • (String)


19749
19750
19751
# File 'lib/pago/v2026_04/models.rb', line 19749

def customer_portal_url
  @customer_portal_url
end

#expires_atString (readonly)

Returns:

  • (String)


19743
19744
19745
# File 'lib/pago/v2026_04/models.rb', line 19743

def expires_at
  @expires_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


19737
19738
19739
# File 'lib/pago/v2026_04/models.rb', line 19737

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


19733
19734
19735
# File 'lib/pago/v2026_04/models.rb', line 19733

def modified_at
  @modified_at
end

#return_urlString? (readonly)

Returns:

  • (String, nil)


19746
19747
19748
# File 'lib/pago/v2026_04/models.rb', line 19746

def return_url
  @return_url
end

#tokenString (readonly)

Returns:

  • (String)


19740
19741
19742
# File 'lib/pago/v2026_04/models.rb', line 19740

def token
  @token
end

Class Method Details

.from_json(data) ⇒ CustomerSession?

Parameters:

  • data (Hash, String, nil)

Returns:



19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
# File 'lib/pago/v2026_04/models.rb', line 19782

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(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      token: (data.key?("token") ? data["token"] : ::Pago::UNSET),
      expires_at: (data.key?("expires_at") ? data["expires_at"] : ::Pago::UNSET),
      return_url: (data.key?("return_url") ? data["return_url"] : ::Pago::UNSET),
      customer_portal_url: (data.key?("customer_portal_url") ? data["customer_portal_url"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      customer: (data.key?("customer") ? Unions::Customer.from_json(data["customer"]) : ::Pago::UNSET)
    ),
    data
  )
end