Class: ThePlaidApi::CraMonitoringInsightsGetResponse

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

Overview

CraMonitoringInsightsGetResponse defines the response schema for ‘cra/monitoring_insights/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_insights_id:, items:, additional_properties: nil) ⇒ CraMonitoringInsightsGetResponse

Returns a new instance of CraMonitoringInsightsGetResponse.



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

def initialize(request_id:, user_insights_id:, items:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @request_id = request_id
  @user_insights_id = user_insights_id
  @items = items
  @additional_properties = additional_properties
end

Instance Attribute Details

#itemsArray[CraMonitoringInsightsItem]

An array of Monitoring Insights Items associated with the user.

Returns:



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

def items
  @items
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/cra_monitoring_insights_get_response.rb', line 17

def request_id
  @request_id
end

#user_insights_idString

A unique ID identifying a User Monitoring Insights Report. Like all Plaid identifiers, this ID is case sensitive.

Returns:

  • (String)


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

def user_insights_id
  @user_insights_id
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
81
82
83
84
85
86
87
88
89
# File 'lib/the_plaid_api/models/cra_monitoring_insights_get_response.rb', line 59

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_insights_id =
    hash.key?('user_insights_id') ? hash['user_insights_id'] : nil
  # Parameter is an array, so we need to iterate through it
  items = nil
  unless hash['items'].nil?
    items = []
    hash['items'].each do |structure|
      items << (CraMonitoringInsightsItem.from_hash(structure) if structure)
    end
  end

  items = nil unless hash.key?('items')

  # 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.
  CraMonitoringInsightsGetResponse.new(request_id: request_id,
                                       user_insights_id: user_insights_id,
                                       items: items,
                                       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/the_plaid_api/models/cra_monitoring_insights_get_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'request_id'
  @_hash['user_insights_id'] = 'user_insights_id'
  @_hash['items'] = 'items'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/the_plaid_api/models/cra_monitoring_insights_get_response.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
# File 'lib/the_plaid_api/models/cra_monitoring_insights_get_response.rb', line 99

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

#to_sObject

Provides a human-readable string representation of the object.



92
93
94
95
96
# File 'lib/the_plaid_api/models/cra_monitoring_insights_get_response.rb', line 92

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