Class: ThePlaidApi::BeaconUserCreateRequest

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

Overview

Request input for creating a Beacon User. The primary use for this endpoint is to add a new end user to Beacon for fraud and duplicate scanning. Some fields are optional, but it is recommended to provide as much information as possible to improve the accuracy of the fraud and duplicate scanning.

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(program_id:, client_user_id:, user:, access_tokens: SKIP, client_id: SKIP, secret: SKIP, additional_properties: nil) ⇒ BeaconUserCreateRequest

Returns a new instance of BeaconUserCreateRequest.



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 81

def initialize(program_id:, client_user_id:, user:, access_tokens: SKIP,
               client_id: SKIP, secret: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @program_id = program_id
  @client_user_id = client_user_id
  @user = user
  @access_tokens = access_tokens unless access_tokens == SKIP
  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#access_tokensArray[String]

Send this array of access tokens to link accounts to the Beacon User and have them evaluated for Account Insights. A maximum of 50 accounts total can be added to a single Beacon User.

Returns:

  • (Array[String])


40
41
42
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 40

def access_tokens
  @access_tokens
end

#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)


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

def client_id
  @client_id
end

#client_user_idString

A unique ID that identifies the end user in your system. Either a ‘user_id` or the `client_user_id` must be provided. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 27

def client_user_id
  @client_user_id
end

#program_idString

ID of the associated Beacon Program.

Returns:

  • (String)


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

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


51
52
53
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 51

def secret
  @secret
end

#userBeaconUserRequestData

A Beacon User’s data which is used to check against duplicate records and the Beacon Fraud Network. In order to create a Beacon User, in addition to the ‘name`, either the `date_of_birth` or the `depository_accounts` field must be provided.



34
35
36
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 34

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  program_id = hash.key?('program_id') ? hash['program_id'] : nil
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : nil
  user = BeaconUserRequestData.from_hash(hash['user']) if hash['user']
  access_tokens = hash.key?('access_tokens') ? hash['access_tokens'] : SKIP
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP

  # 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.
  BeaconUserCreateRequest.new(program_id: program_id,
                              client_user_id: client_user_id,
                              user: user,
                              access_tokens: access_tokens,
                              client_id: client_id,
                              secret: secret,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['program_id'] = 'program_id'
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['user'] = 'user'
  @_hash['access_tokens'] = 'access_tokens'
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash
end

.nullablesObject

An array for nullable fields



75
76
77
78
79
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 75

def self.nullables
  %w[
    access_tokens
  ]
end

.optionalsObject

An array for optional fields



66
67
68
69
70
71
72
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 66

def self.optionals
  %w[
    access_tokens
    client_id
    secret
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} program_id: #{@program_id.inspect}, client_user_id:"\
  " #{@client_user_id.inspect}, user: #{@user.inspect}, access_tokens:"\
  " #{@access_tokens.inspect}, client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



126
127
128
129
130
131
# File 'lib/the_plaid_api/models/beacon_user_create_request.rb', line 126

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} program_id: #{@program_id}, client_user_id: #{@client_user_id}, user:"\
  " #{@user}, access_tokens: #{@access_tokens}, client_id: #{@client_id}, secret: #{@secret},"\
  " additional_properties: #{@additional_properties}>"
end