Class: ThePlaidApi::StatusBreakdown

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

Overview

A detailed breakdown of the institution’s performance for a request type. The values for ‘success`, `error_plaid`, and `error_institution` sum to 1. The time range used for calculating the breakdown may range from the most recent few minutes to the past six hours. In general, smaller institutions will show status that was calculated over a longer period of time. For Investment updates, which are refreshed less frequently, the period assessed may be 24 hours or more. For more details, see [Institution status details](plaid.com/docs/account/activity/#institution-status-details ).

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(success:, error_plaid:, error_institution:, refresh_interval: SKIP, additional_properties: nil) ⇒ StatusBreakdown

Returns a new instance of StatusBreakdown.



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

def initialize(success:, error_plaid:, error_institution:,
               refresh_interval: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @success = success
  @error_plaid = error_plaid
  @error_institution = error_institution
  @refresh_interval = refresh_interval unless refresh_interval == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#error_institutionFloat

The percentage of logins that are failing due to an issue in the institution’s system, expressed as a decimal.

Returns:

  • (Float)


33
34
35
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 33

def error_institution
  @error_institution
end

#error_plaidFloat

The percentage of logins that are failing due to an internal Plaid issue, expressed as a decimal.

Returns:

  • (Float)


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

def error_plaid
  @error_plaid
end

#refresh_intervalRefreshInterval

How frequently data for subscription products like Investments, Transactions, and Liabilities, is being refreshed, relative to the institution’s normal scheduling. The ‘refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high.

Returns:



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

def refresh_interval
  @refresh_interval
end

#successFloat

The percentage of login attempts that are successful, expressed as a decimal.

Returns:

  • (Float)


23
24
25
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 23

def success
  @success
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  success = hash.key?('success') ? hash['success'] : nil
  error_plaid = hash.key?('error_plaid') ? hash['error_plaid'] : nil
  error_institution =
    hash.key?('error_institution') ? hash['error_institution'] : nil
  refresh_interval =
    hash.key?('refresh_interval') ? hash['refresh_interval'] : 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.
  StatusBreakdown.new(success: success,
                      error_plaid: error_plaid,
                      error_institution: error_institution,
                      refresh_interval: refresh_interval,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['success'] = 'success'
  @_hash['error_plaid'] = 'error_plaid'
  @_hash['error_institution'] = 'error_institution'
  @_hash['refresh_interval'] = 'refresh_interval'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



53
54
55
56
57
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 53

def self.optionals
  %w[
    refresh_interval
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
117
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 112

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} success: #{@success.inspect}, error_plaid: #{@error_plaid.inspect},"\
  " error_institution: #{@error_institution.inspect}, refresh_interval:"\
  " #{@refresh_interval.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
# File 'lib/the_plaid_api/models/status_breakdown.rb', line 104

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} success: #{@success}, error_plaid: #{@error_plaid}, error_institution:"\
  " #{@error_institution}, refresh_interval: #{@refresh_interval}, additional_properties:"\
  " #{@additional_properties}>"
end