Class: ThePlaidApi::TransferMetricsGetResponse

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

Overview

Defines the response schema for ‘/transfer/metrics/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:, daily_debit_transfer_volume:, daily_credit_transfer_volume:, monthly_transfer_volume:, monthly_debit_transfer_volume:, monthly_credit_transfer_volume:, iso_currency_code:, return_rates: SKIP, authorization_usage: SKIP, additional_properties: nil) ⇒ TransferMetricsGetResponse

Returns a new instance of TransferMetricsGetResponse.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 88

def initialize(request_id:, daily_debit_transfer_volume:,
               daily_credit_transfer_volume:, monthly_transfer_volume:,
               monthly_debit_transfer_volume:,
               monthly_credit_transfer_volume:, iso_currency_code:,
               return_rates: SKIP, authorization_usage: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @request_id = request_id
  @daily_debit_transfer_volume = daily_debit_transfer_volume
  @daily_credit_transfer_volume = daily_credit_transfer_volume
  @monthly_transfer_volume = monthly_transfer_volume
  @monthly_debit_transfer_volume = monthly_debit_transfer_volume
  @monthly_credit_transfer_volume = monthly_credit_transfer_volume
  @iso_currency_code = iso_currency_code
  @return_rates = return_rates unless return_rates == SKIP
  @authorization_usage = authorization_usage unless authorization_usage == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#authorization_usageTransferMetricsGetAuthorizationUsage

Details regarding authorization usage.



53
54
55
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 53

def authorization_usage
  @authorization_usage
end

#daily_credit_transfer_volumeString

Sum of dollar amount of credit transfers in last 24 hours (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


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

def daily_credit_transfer_volume
  @daily_credit_transfer_volume
end

#daily_debit_transfer_volumeString

Sum of dollar amount of debit transfers in last 24 hours (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 21

def daily_debit_transfer_volume
  @daily_debit_transfer_volume
end

#iso_currency_codeString

The currency of the dollar amount, e.g. “USD”.

Returns:

  • (String)


45
46
47
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 45

def iso_currency_code
  @iso_currency_code
end

#monthly_credit_transfer_volumeString

Sum of dollar amount of credit transfers in current calendar month (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


41
42
43
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 41

def monthly_credit_transfer_volume
  @monthly_credit_transfer_volume
end

#monthly_debit_transfer_volumeString

Sum of dollar amount of debit transfers in current calendar month (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


36
37
38
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 36

def monthly_debit_transfer_volume
  @monthly_debit_transfer_volume
end

#monthly_transfer_volumeString

Sum of dollar amount of credit and debit transfers in current calendar month (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


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

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


16
17
18
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 16

def request_id
  @request_id
end

#return_ratesTransferMetricsGetReturnRates

Details regarding return rates.



49
50
51
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 49

def return_rates
  @return_rates
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 110

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  daily_debit_transfer_volume =
    hash.key?('daily_debit_transfer_volume') ? hash['daily_debit_transfer_volume'] : nil
  daily_credit_transfer_volume =
    hash.key?('daily_credit_transfer_volume') ? hash['daily_credit_transfer_volume'] : nil
  monthly_transfer_volume =
    hash.key?('monthly_transfer_volume') ? hash['monthly_transfer_volume'] : nil
  monthly_debit_transfer_volume =
    hash.key?('monthly_debit_transfer_volume') ? hash['monthly_debit_transfer_volume'] : nil
  monthly_credit_transfer_volume =
    hash.key?('monthly_credit_transfer_volume') ? hash['monthly_credit_transfer_volume'] : nil
  iso_currency_code =
    hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil
  return_rates = TransferMetricsGetReturnRates.from_hash(hash['return_rates']) if
    hash['return_rates']
  if hash['authorization_usage']
    authorization_usage = TransferMetricsGetAuthorizationUsage.from_hash(hash['authorization_usage'])
  end

  # 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.
  TransferMetricsGetResponse.new(request_id: request_id,
                                 daily_debit_transfer_volume: daily_debit_transfer_volume,
                                 daily_credit_transfer_volume: daily_credit_transfer_volume,
                                 monthly_transfer_volume: monthly_transfer_volume,
                                 monthly_debit_transfer_volume: monthly_debit_transfer_volume,
                                 monthly_credit_transfer_volume: monthly_credit_transfer_volume,
                                 iso_currency_code: iso_currency_code,
                                 return_rates: return_rates,
                                 authorization_usage: authorization_usage,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 56

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'request_id'
  @_hash['daily_debit_transfer_volume'] = 'daily_debit_transfer_volume'
  @_hash['daily_credit_transfer_volume'] = 'daily_credit_transfer_volume'
  @_hash['monthly_transfer_volume'] = 'monthly_transfer_volume'
  @_hash['monthly_debit_transfer_volume'] =
    'monthly_debit_transfer_volume'
  @_hash['monthly_credit_transfer_volume'] =
    'monthly_credit_transfer_volume'
  @_hash['iso_currency_code'] = 'iso_currency_code'
  @_hash['return_rates'] = 'return_rates'
  @_hash['authorization_usage'] = 'authorization_usage'
  @_hash
end

.nullablesObject

An array for nullable fields



81
82
83
84
85
86
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 81

def self.nullables
  %w[
    return_rates
    authorization_usage
  ]
end

.optionalsObject

An array for optional fields



73
74
75
76
77
78
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 73

def self.optionals
  %w[
    return_rates
    authorization_usage
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 166

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id.inspect}, daily_debit_transfer_volume:"\
  " #{@daily_debit_transfer_volume.inspect}, daily_credit_transfer_volume:"\
  " #{@daily_credit_transfer_volume.inspect}, monthly_transfer_volume:"\
  " #{@monthly_transfer_volume.inspect}, monthly_debit_transfer_volume:"\
  " #{@monthly_debit_transfer_volume.inspect}, monthly_credit_transfer_volume:"\
  " #{@monthly_credit_transfer_volume.inspect}, iso_currency_code:"\
  " #{@iso_currency_code.inspect}, return_rates: #{@return_rates.inspect},"\
  " authorization_usage: #{@authorization_usage.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



154
155
156
157
158
159
160
161
162
163
# File 'lib/the_plaid_api/models/transfer_metrics_get_response.rb', line 154

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id}, daily_debit_transfer_volume:"\
  " #{@daily_debit_transfer_volume}, daily_credit_transfer_volume:"\
  " #{@daily_credit_transfer_volume}, monthly_transfer_volume: #{@monthly_transfer_volume},"\
  " monthly_debit_transfer_volume: #{@monthly_debit_transfer_volume},"\
  " monthly_credit_transfer_volume: #{@monthly_credit_transfer_volume}, iso_currency_code:"\
  " #{@iso_currency_code}, return_rates: #{@return_rates}, authorization_usage:"\
  " #{@authorization_usage}, additional_properties: #{@additional_properties}>"
end