Class: ThePlaidApi::UserUpdateRequest

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

Overview

UserUpdateRequest defines the request schema for ‘/user/update`

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(client_id: SKIP, secret: SKIP, user_id: SKIP, identity: SKIP, user_token: SKIP, consumer_report_user_identity: SKIP, additional_properties: nil) ⇒ UserUpdateRequest

Returns a new instance of UserUpdateRequest.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/the_plaid_api/models/user_update_request.rb', line 95

def initialize(client_id: SKIP, secret: SKIP, user_id: SKIP, identity: SKIP,
               user_token: SKIP, consumer_report_user_identity: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @user_id = user_id unless user_id == SKIP
  @identity = identity unless identity == SKIP
  @user_token = user_token unless user_token == SKIP
  unless consumer_report_user_identity == SKIP
    @consumer_report_user_identity =
      consumer_report_user_identity
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/user_update_request.rb', line 16

def client_id
  @client_id
end

#consumer_report_user_identityConsumerReportUserIdentity

This field is only used by integrations created before December 10, 2025. All other integrations must use the ‘identity` object instead. For more details, see [new user APIs](plaid.com/docs/api/users/user-apis). To create a Plaid Check Consumer Report for a user when using a `user_token`, this field must be present. If this field is not provided during user token creation, you can add it to the user later by calling `/user/update`. Once the field has been added to the user, you will be able to call `/link/token/create` with a non-empty `consumer_report_permissible_purpose` (which will automatically create a Plaid Check Consumer Report), or call `/cra/check_report/create` for that user.



60
61
62
# File 'lib/the_plaid_api/models/user_update_request.rb', line 60

def consumer_report_user_identity
  @consumer_report_user_identity
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:



38
39
40
# File 'lib/the_plaid_api/models/user_update_request.rb', line 38

def identity
  @identity
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/user_update_request.rb', line 21

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


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

def user_id
  @user_id
end

#user_tokenString

The user token associated with the User data is being requested for. This field is used only by customers with pre-existing integrations that already use the ‘user_token` field. All other customers should use the `user_id` instead. For more details, see [New User APIs](plaid.com/docs/api/users/user-apis).

Returns:

  • (String)


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

def user_token
  @user_token
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/the_plaid_api/models/user_update_request.rb', line 114

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  user_id = hash.key?('user_id') ? hash['user_id'] : SKIP
  identity = ClientUserIdentity.from_hash(hash['identity']) if hash['identity']
  user_token = hash.key?('user_token') ? hash['user_token'] : SKIP
  if hash['consumer_report_user_identity']
    consumer_report_user_identity = ConsumerReportUserIdentity.from_hash(hash['consumer_report_user_identity'])
  end

  # 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.
  UserUpdateRequest.new(client_id: client_id,
                        secret: secret,
                        user_id: user_id,
                        identity: identity,
                        user_token: user_token,
                        consumer_report_user_identity: consumer_report_user_identity,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/user_update_request.rb', line 63

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['user_id'] = 'user_id'
  @_hash['identity'] = 'identity'
  @_hash['user_token'] = 'user_token'
  @_hash['consumer_report_user_identity'] =
    'consumer_report_user_identity'
  @_hash
end

.nullablesObject

An array for nullable fields



88
89
90
91
92
93
# File 'lib/the_plaid_api/models/user_update_request.rb', line 88

def self.nullables
  %w[
    identity
    consumer_report_user_identity
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    client_id
    secret
    user_id
    identity
    user_token
    consumer_report_user_identity
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



153
154
155
156
157
158
159
# File 'lib/the_plaid_api/models/user_update_request.rb', line 153

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, user_id:"\
  " #{@user_id.inspect}, identity: #{@identity.inspect}, user_token: #{@user_token.inspect},"\
  " consumer_report_user_identity: #{@consumer_report_user_identity.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



145
146
147
148
149
150
# File 'lib/the_plaid_api/models/user_update_request.rb', line 145

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, user_id: #{@user_id},"\
  " identity: #{@identity}, user_token: #{@user_token}, consumer_report_user_identity:"\
  " #{@consumer_report_user_identity}, additional_properties: #{@additional_properties}>"
end