Class: Plaid::AssetsProductReadyWebhook

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/models/assets_product_ready_webhook.rb

Overview

Fired when the Asset Report has been generated and ‘/asset_report/get` is ready to be called. If you attempt to retrieve an Asset Report before this webhook has fired, you’ll receive a response with the HTTP status code 400 and a Plaid error code of `PRODUCT_NOT_READY`.

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(webhook_type:, webhook_code:, asset_report_id:, additional_properties: nil) ⇒ AssetsProductReadyWebhook

Returns a new instance of AssetsProductReadyWebhook.



47
48
49
50
51
52
53
54
55
56
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 47

def initialize(webhook_type:, webhook_code:, asset_report_id:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @webhook_type = webhook_type
  @webhook_code = webhook_code
  @asset_report_id = asset_report_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#asset_report_idString

The ‘asset_report_id` that can be provided to `/asset_report/get` to retrieve the Asset Report.

Returns:

  • (String)


26
27
28
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 26

def asset_report_id
  @asset_report_id
end

#webhook_codeString

‘PRODUCT_READY`

Returns:

  • (String)


21
22
23
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 21

def webhook_code
  @webhook_code
end

#webhook_typeString

‘ASSETS`

Returns:

  • (String)


17
18
19
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 17

def webhook_type
  @webhook_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  webhook_type = hash.key?('webhook_type') ? hash['webhook_type'] : nil
  webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil
  asset_report_id =
    hash.key?('asset_report_id') ? hash['asset_report_id'] : nil

  # 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.
  AssetsProductReadyWebhook.new(webhook_type: webhook_type,
                                webhook_code: webhook_code,
                                asset_report_id: asset_report_id,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['webhook_type'] = 'webhook_type'
  @_hash['webhook_code'] = 'webhook_code'
  @_hash['asset_report_id'] = 'asset_report_id'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



38
39
40
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 38

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
95
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 90

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type.inspect}, webhook_code:"\
  " #{@webhook_code.inspect}, asset_report_id: #{@asset_report_id.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
87
# File 'lib/plaid/models/assets_product_ready_webhook.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type}, webhook_code: #{@webhook_code},"\
  " asset_report_id: #{@asset_report_id}, additional_properties: #{@additional_properties}>"
end