Class: ThePlaidApi::AccountsBalanceGetRequestOptions

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

Overview

Optional parameters to ‘/accounts/balance/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(account_ids: SKIP, min_last_updated_datetime: SKIP, additional_properties: nil) ⇒ AccountsBalanceGetRequestOptions

Returns a new instance of AccountsBalanceGetRequestOptions.



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

def initialize(account_ids: SKIP, min_last_updated_datetime: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_ids =  unless  == SKIP
  unless min_last_updated_datetime == SKIP
    @min_last_updated_datetime =
      min_last_updated_datetime
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idsArray[String]

A list of ‘account_ids` to retrieve for the Item. The default value is `null`. Note: An error will be returned if a provided `account_id` is not associated with the Item.

Returns:

  • (Array[String])


18
19
20
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 18

def 
  @account_ids
end

#min_last_updated_datetimeDateTime

Timestamp in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (‘YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. This field is only necessary when the institution is `ins_128026` (Capital One), and one or more account types being requested is a non-depository account (such as a credit card) as Capital One does not provide real-time balance for non-depository accounts. In this case, a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, as well as for depository accounts at Capital One (including all checking and savings accounts) this field is ignored and real-time balance information will be fetched. If this field is not ignored, and no acceptable balance is available, an `INVALID_RESULT` error with the code `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned.

Returns:

  • (DateTime)


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

def min_last_updated_datetime
  @min_last_updated_datetime
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_ids') ? hash['account_ids'] : SKIP
  min_last_updated_datetime = if hash.key?('min_last_updated_datetime')
                                (DateTimeHelper.from_rfc3339(hash['min_last_updated_datetime']) if hash['min_last_updated_datetime'])
                              else
                                SKIP
                              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.
  AccountsBalanceGetRequestOptions.new(account_ids: ,
                                       min_last_updated_datetime: min_last_updated_datetime,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_ids'] = 'account_ids'
  @_hash['min_last_updated_datetime'] = 'min_last_updated_datetime'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 54

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 46

def self.optionals
  %w[
    account_ids
    min_last_updated_datetime
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 108

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

#to_custom_min_last_updated_datetimeObject



96
97
98
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 96

def to_custom_min_last_updated_datetime
  DateTimeHelper.to_rfc3339(min_last_updated_datetime)
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
# File 'lib/the_plaid_api/models/accounts_balance_get_request_options.rb', line 101

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