Class: ThePlaidApi::SandboxIncomeFireWebhookRequest

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

Overview

SandboxIncomeFireWebhookRequest defines the request schema for ‘/sandbox/income/fire_webhook`

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(item_id:, webhook:, webhook_code:, client_id: SKIP, secret: SKIP, user_id: SKIP, verification_status: SKIP, additional_properties: nil) ⇒ SandboxIncomeFireWebhookRequest

Returns a new instance of SandboxIncomeFireWebhookRequest.



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

def initialize(item_id:, webhook:, webhook_code:, client_id: SKIP,
               secret: SKIP, user_id: SKIP, verification_status: 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
  @item_id = item_id
  @user_id = user_id unless user_id == SKIP
  @webhook = webhook
  @verification_status = verification_status unless verification_status == SKIP
  @webhook_code = webhook_code
  @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)


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

def client_id
  @client_id
end

#item_idString

The Item ID associated with the verification.

Returns:

  • (String)


26
27
28
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 26

def item_id
  @item_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)


22
23
24
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 22

def secret
  @secret
end

#user_idString

The Plaid ‘user_id` of the User associated with this webhook, warning, or error.

Returns:

  • (String)


31
32
33
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 31

def user_id
  @user_id
end

#verification_statusVerificationStatus3

‘VERIFICATION_STATUS_PROCESSING_COMPLETE`: The income verification status processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the `/income/verification/paystubs/get` endpoint and check the document metadata to see which documents were successfully parsed. `VERIFICATION_STATUS_PROCESSING_FAILED`: A failure occurred when attempting to process the verification documentation. `VERIFICATION_STATUS_PENDING_APPROVAL`: (deprecated) The income verification has been sent to the user for review.

Returns:



47
48
49
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 47

def verification_status
  @verification_status
end

#webhookString

The URL to which the webhook should be sent.

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 35

def webhook
  @webhook
end

#webhook_codeSandboxIncomeWebhookFireRequestWebhookCode

The webhook codes that can be fired by this test endpoint.



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

def webhook_code
  @webhook_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
125
126
127
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 98

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  item_id = hash.key?('item_id') ? hash['item_id'] : nil
  webhook = hash.key?('webhook') ? hash['webhook'] : nil
  webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil
  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
  verification_status =
    hash.key?('verification_status') ? hash['verification_status'] : 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.
  SandboxIncomeFireWebhookRequest.new(item_id: item_id,
                                      webhook: webhook,
                                      webhook_code: webhook_code,
                                      client_id: client_id,
                                      secret: secret,
                                      user_id: user_id,
                                      verification_status: verification_status,
                                      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
64
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['item_id'] = 'item_id'
  @_hash['user_id'] = 'user_id'
  @_hash['webhook'] = 'webhook'
  @_hash['verification_status'] = 'verification_status'
  @_hash['webhook_code'] = 'webhook_code'
  @_hash
end

.nullablesObject

An array for nullable fields



77
78
79
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 77

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    client_id
    secret
    user_id
    verification_status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



138
139
140
141
142
143
144
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 138

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

#to_sObject

Provides a human-readable string representation of the object.



130
131
132
133
134
135
# File 'lib/the_plaid_api/models/sandbox_income_fire_webhook_request.rb', line 130

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