Class: Plaid::ProcessorBalanceGetRequestOptions

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

Overview

An optional object to filter ‘/processor/balance/get` results.

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(min_last_updated_datetime: SKIP, additional_properties: nil) ⇒ ProcessorBalanceGetRequestOptions

Returns a new instance of ProcessorBalanceGetRequestOptions.



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

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

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

Instance Attribute Details

#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`. If the balance that is pulled for `ins_128026` (Capital One) is older than the given timestamp, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response. This field is only used when the institution is `ins_128026` (Capital One), in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, this field is ignored.

Returns:

  • (DateTime)


25
26
27
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 25

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.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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.
  ProcessorBalanceGetRequestOptions.new(min_last_updated_datetime: min_last_updated_datetime,
                                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 28

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

.nullablesObject

An array for nullable fields



42
43
44
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 42

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 35

def self.optionals
  %w[
    min_last_updated_datetime
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 92

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

#to_custom_min_last_updated_datetimeObject



80
81
82
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 80

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.



85
86
87
88
89
# File 'lib/plaid/models/processor_balance_get_request_options.rb', line 85

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