Class: ThePlaidApi::UserGetResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/user_get_response.rb

Overview

UserGetResponse defines the response schema for ‘/user/get`.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(request_id:, user_id:, client_user_id:, created_at:, updated_at: SKIP, identity: SKIP, additional_properties: nil) ⇒ UserGetResponse

Returns a new instance of UserGetResponse.



76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/the_plaid_api/models/user_get_response.rb', line 76

def initialize(request_id:, user_id:, client_user_id:, created_at:,
               updated_at: SKIP, identity: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @request_id = request_id
  @user_id = user_id
  @client_user_id = client_user_id
  @created_at = created_at
  @updated_at = updated_at unless updated_at == SKIP
  @identity = identity unless identity == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_user_idString

Client provided user ID.

Returns:

  • (String)


28
29
30
# File 'lib/the_plaid_api/models/user_get_response.rb', line 28

def client_user_id
  @client_user_id
end

#created_atDateTime

Timestamp of user creation.

Returns:

  • (DateTime)


32
33
34
# File 'lib/the_plaid_api/models/user_get_response.rb', line 32

def created_at
  @created_at
end

#identityClientUserIdentity

The identity fields associated with a user. For a user to be eligible for a Plaid Check Consumer Report, all fields are required except ‘id_number`. Providing a partial SSN is strongly recommended, and improves the accuracy of matching user records during compliance processes such as file disclosure, dispute, or security freeze requests. If creating a report that will be shared with GSEs such as Fannie or Freddie, a full Social Security Number must be provided via the `id_number` field.

Returns:



46
47
48
# File 'lib/the_plaid_api/models/user_get_response.rb', line 46

def identity
  @identity
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/user_get_response.rb', line 17

def request_id
  @request_id
end

#updated_atDateTime

Timestamp of last user update.

Returns:

  • (DateTime)


36
37
38
# File 'lib/the_plaid_api/models/user_get_response.rb', line 36

def updated_at
  @updated_at
end

#user_idString

A unique user identifier, created by ‘/user/create`. Integrations that began using `/user/create` after December 10, 2025 use this field to identify a user instead of the `user_token`. For more details, see [new user APIs](plaid.com/docs/api/users/user-apis).

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/user_get_response.rb', line 24

def user_id
  @user_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/the_plaid_api/models/user_get_response.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  user_id = hash.key?('user_id') ? hash['user_id'] : nil
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : nil
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               end
  updated_at = if hash.key?('updated_at')
                 (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
               else
                 SKIP
               end
  identity = ClientUserIdentity.from_hash(hash['identity']) if hash['identity']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  UserGetResponse.new(request_id: request_id,
                      user_id: user_id,
                      client_user_id: client_user_id,
                      created_at: created_at,
                      updated_at: updated_at,
                      identity: identity,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
58
# File 'lib/the_plaid_api/models/user_get_response.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'request_id'
  @_hash['user_id'] = 'user_id'
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['identity'] = 'identity'
  @_hash
end

.nullablesObject

An array for nullable fields



69
70
71
72
73
74
# File 'lib/the_plaid_api/models/user_get_response.rb', line 69

def self.nullables
  %w[
    client_user_id
    identity
  ]
end

.optionalsObject

An array for optional fields



61
62
63
64
65
66
# File 'lib/the_plaid_api/models/user_get_response.rb', line 61

def self.optionals
  %w[
    updated_at
    identity
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



143
144
145
146
147
148
149
# File 'lib/the_plaid_api/models/user_get_response.rb', line 143

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id.inspect}, user_id: #{@user_id.inspect},"\
  " client_user_id: #{@client_user_id.inspect}, created_at: #{@created_at.inspect},"\
  " updated_at: #{@updated_at.inspect}, identity: #{@identity.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_created_atObject



126
127
128
# File 'lib/the_plaid_api/models/user_get_response.rb', line 126

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_updated_atObject



130
131
132
# File 'lib/the_plaid_api/models/user_get_response.rb', line 130

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



135
136
137
138
139
140
# File 'lib/the_plaid_api/models/user_get_response.rb', line 135

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id}, user_id: #{@user_id}, client_user_id:"\
  " #{@client_user_id}, created_at: #{@created_at}, updated_at: #{@updated_at}, identity:"\
  " #{@identity}, additional_properties: #{@additional_properties}>"
end