class Plaid::LiabilityOverride

Used to configure Sandbox test data for the Liabilities product

Attributes

balance_transfer_apr[RW]

The balance transfer APR percentage value. Can only be set if ‘type` is `credit`.

cash_apr[RW]

The cash APR percentage value. Can only be set if ‘type` is `credit`.

expected_payoff_date[RW]

Override the ‘expected_payoff_date` field. Can only be set if `type` is `student`.

guarantor[RW]

Override the ‘guarantor` field. Can only be set if `type` is `student`.

interest_capitalization_grace_period_months[RW]

If set, interest capitalization begins at the given number of months after loan origination. By default interest is never capitalized. Can only be set if ‘type` is `student`.

is_federal[RW]

Override the ‘is_federal` field. Can only be set if `type` is `student`.

is_overdue[RW]

Override the ‘is_overdue` field

last_payment_amount[RW]

Override the ‘last_payment_amount` field. Can only be set if `type` is `credit`.

loan_name[RW]

Override the ‘loan_name` field. Can only be set if `type` is `student`.

loan_status[RW]
minimum_payment_amount[RW]

Override the ‘minimum_payment_amount` field. Can only be set if `type` is `credit` or `student`.

nominal_apr[RW]

The interest rate on the loan as a percentage. Can only be set if ‘type` is `student`.

origination_date[RW]

The date on which the loan was initially lent, in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. Can only be set if ‘type` is `student`.

payment_reference_number[RW]

Override the ‘payment_reference_number` field. Can only be set if `type` is `student`.

principal[RW]

The original loan principal. Can only be set if ‘type` is `student`.

pslf_status[RW]
purchase_apr[RW]

The purchase APR percentage value. For simplicity, this is the only interest rate used to calculate interest charges. Can only be set if ‘type` is `credit`.

repayment_model[RW]
repayment_plan_description[RW]

Override the ‘repayment_plan.description` field. Can only be set if `type` is `student`.

repayment_plan_type[RW]

Override the ‘repayment_plan.type` field. Can only be set if `type` is `student`. Possible values are: `"extended graduated"`, `"extended standard"`, `"graduated"`, `"income-contingent repayment"`, `"income-based repayment"`, `"income-sensitive repayment"`, `"interest only"`, `"other"`, `"pay as you earn"`, `"revised pay as you earn"`, `"standard"`, or `"saving on a valuable education"`.

sequence_number[RW]

Override the ‘sequence_number` field. Can only be set if `type` is `student`.

servicer_address[RW]
special_apr[RW]

The special APR percentage value. Can only be set if ‘type` is `credit`.

type[RW]

The type of the liability object, either ‘credit` or `student`. Mortgages are not currently supported in the custom Sandbox.

Public Class Methods

acceptable_attributes() click to toggle source

Returns all the JSON keys this model knows about

# File lib/plaid/models/liability_override.rb, line 118
def self.acceptable_attributes
  attribute_map.values
end
attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/plaid/models/liability_override.rb, line 88
def self.attribute_map
  {
    :'type' => :'type',
    :'purchase_apr' => :'purchase_apr',
    :'cash_apr' => :'cash_apr',
    :'balance_transfer_apr' => :'balance_transfer_apr',
    :'special_apr' => :'special_apr',
    :'last_payment_amount' => :'last_payment_amount',
    :'minimum_payment_amount' => :'minimum_payment_amount',
    :'is_overdue' => :'is_overdue',
    :'origination_date' => :'origination_date',
    :'principal' => :'principal',
    :'nominal_apr' => :'nominal_apr',
    :'interest_capitalization_grace_period_months' => :'interest_capitalization_grace_period_months',
    :'repayment_model' => :'repayment_model',
    :'expected_payoff_date' => :'expected_payoff_date',
    :'guarantor' => :'guarantor',
    :'is_federal' => :'is_federal',
    :'loan_name' => :'loan_name',
    :'loan_status' => :'loan_status',
    :'payment_reference_number' => :'payment_reference_number',
    :'pslf_status' => :'pslf_status',
    :'repayment_plan_description' => :'repayment_plan_description',
    :'repayment_plan_type' => :'repayment_plan_type',
    :'sequence_number' => :'sequence_number',
    :'servicer_address' => :'servicer_address'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/plaid/models/liability_override.rb, line 449
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/plaid/models/liability_override.rb, line 160
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilityOverride` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilityOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'type')
    self.type = attributes[:'type']
  end

  if attributes.key?(:'purchase_apr')
    self.purchase_apr = attributes[:'purchase_apr']
  end

  if attributes.key?(:'cash_apr')
    self.cash_apr = attributes[:'cash_apr']
  end

  if attributes.key?(:'balance_transfer_apr')
    self.balance_transfer_apr = attributes[:'balance_transfer_apr']
  end

  if attributes.key?(:'special_apr')
    self.special_apr = attributes[:'special_apr']
  end

  if attributes.key?(:'last_payment_amount')
    self.last_payment_amount = attributes[:'last_payment_amount']
  end

  if attributes.key?(:'minimum_payment_amount')
    self.minimum_payment_amount = attributes[:'minimum_payment_amount']
  end

  if attributes.key?(:'is_overdue')
    self.is_overdue = attributes[:'is_overdue']
  end

  if attributes.key?(:'origination_date')
    self.origination_date = attributes[:'origination_date']
  end

  if attributes.key?(:'principal')
    self.principal = attributes[:'principal']
  end

  if attributes.key?(:'nominal_apr')
    self.nominal_apr = attributes[:'nominal_apr']
  end

  if attributes.key?(:'interest_capitalization_grace_period_months')
    self.interest_capitalization_grace_period_months = attributes[:'interest_capitalization_grace_period_months']
  end

  if attributes.key?(:'repayment_model')
    self.repayment_model = attributes[:'repayment_model']
  end

  if attributes.key?(:'expected_payoff_date')
    self.expected_payoff_date = attributes[:'expected_payoff_date']
  end

  if attributes.key?(:'guarantor')
    self.guarantor = attributes[:'guarantor']
  end

  if attributes.key?(:'is_federal')
    self.is_federal = attributes[:'is_federal']
  end

  if attributes.key?(:'loan_name')
    self.loan_name = attributes[:'loan_name']
  end

  if attributes.key?(:'loan_status')
    self.loan_status = attributes[:'loan_status']
  end

  if attributes.key?(:'payment_reference_number')
    self.payment_reference_number = attributes[:'payment_reference_number']
  end

  if attributes.key?(:'pslf_status')
    self.pslf_status = attributes[:'pslf_status']
  end

  if attributes.key?(:'repayment_plan_description')
    self.repayment_plan_description = attributes[:'repayment_plan_description']
  end

  if attributes.key?(:'repayment_plan_type')
    self.repayment_plan_type = attributes[:'repayment_plan_type']
  end

  if attributes.key?(:'sequence_number')
    self.sequence_number = attributes[:'sequence_number']
  end

  if attributes.key?(:'servicer_address')
    self.servicer_address = attributes[:'servicer_address']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/plaid/models/liability_override.rb, line 153
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/plaid/models/liability_override.rb, line 123
def self.openapi_types
  {
    :'type' => :'String',
    :'purchase_apr' => :'Float',
    :'cash_apr' => :'Float',
    :'balance_transfer_apr' => :'Float',
    :'special_apr' => :'Float',
    :'last_payment_amount' => :'Float',
    :'minimum_payment_amount' => :'Float',
    :'is_overdue' => :'Boolean',
    :'origination_date' => :'Date',
    :'principal' => :'Float',
    :'nominal_apr' => :'Float',
    :'interest_capitalization_grace_period_months' => :'Float',
    :'repayment_model' => :'StudentLoanRepaymentModel',
    :'expected_payoff_date' => :'Date',
    :'guarantor' => :'String',
    :'is_federal' => :'Boolean',
    :'loan_name' => :'String',
    :'loan_status' => :'StudentLoanStatus',
    :'payment_reference_number' => :'String',
    :'pslf_status' => :'PSLFStatus',
    :'repayment_plan_description' => :'String',
    :'repayment_plan_type' => :'String',
    :'sequence_number' => :'String',
    :'servicer_address' => :'Address'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/plaid/models/liability_override.rb, line 405
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      purchase_apr == o.purchase_apr &&
      cash_apr == o.cash_apr &&
      balance_transfer_apr == o.balance_transfer_apr &&
      special_apr == o.special_apr &&
      last_payment_amount == o.last_payment_amount &&
      minimum_payment_amount == o.minimum_payment_amount &&
      is_overdue == o.is_overdue &&
      origination_date == o.origination_date &&
      principal == o.principal &&
      nominal_apr == o.nominal_apr &&
      interest_capitalization_grace_period_months == o.interest_capitalization_grace_period_months &&
      repayment_model == o.repayment_model &&
      expected_payoff_date == o.expected_payoff_date &&
      guarantor == o.guarantor &&
      is_federal == o.is_federal &&
      loan_name == o.loan_name &&
      loan_status == o.loan_status &&
      payment_reference_number == o.payment_reference_number &&
      pslf_status == o.pslf_status &&
      repayment_plan_description == o.repayment_plan_description &&
      repayment_plan_type == o.repayment_plan_type &&
      sequence_number == o.sequence_number &&
      servicer_address == o.servicer_address
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/plaid/models/liability_override.rb, line 480
def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Plaid.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/plaid/models/liability_override.rb, line 551
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/plaid/models/liability_override.rb, line 456
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end
eql?(o) click to toggle source

@see the ‘==` method @param [Object] Object to be compared

# File lib/plaid/models/liability_override.rb, line 436
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/plaid/models/liability_override.rb, line 442
def hash
  [type, purchase_apr, cash_apr, balance_transfer_apr, special_apr, last_payment_amount, minimum_payment_amount, is_overdue, origination_date, principal, nominal_apr, interest_capitalization_grace_period_months, repayment_model, expected_payoff_date, guarantor, is_federal, loan_name, loan_status, payment_reference_number, pslf_status, repayment_plan_description, repayment_plan_type, sequence_number, servicer_address].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/plaid/models/liability_override.rb, line 272
def list_invalid_properties
  invalid_properties = Array.new
  if @type.nil?
    invalid_properties.push('invalid value for "type", type cannot be nil.')
  end

  if @purchase_apr.nil?
    invalid_properties.push('invalid value for "purchase_apr", purchase_apr cannot be nil.')
  end

  if @cash_apr.nil?
    invalid_properties.push('invalid value for "cash_apr", cash_apr cannot be nil.')
  end

  if @balance_transfer_apr.nil?
    invalid_properties.push('invalid value for "balance_transfer_apr", balance_transfer_apr cannot be nil.')
  end

  if @special_apr.nil?
    invalid_properties.push('invalid value for "special_apr", special_apr cannot be nil.')
  end

  if @last_payment_amount.nil?
    invalid_properties.push('invalid value for "last_payment_amount", last_payment_amount cannot be nil.')
  end

  if @minimum_payment_amount.nil?
    invalid_properties.push('invalid value for "minimum_payment_amount", minimum_payment_amount cannot be nil.')
  end

  if @is_overdue.nil?
    invalid_properties.push('invalid value for "is_overdue", is_overdue cannot be nil.')
  end

  if @origination_date.nil?
    invalid_properties.push('invalid value for "origination_date", origination_date cannot be nil.')
  end

  if @principal.nil?
    invalid_properties.push('invalid value for "principal", principal cannot be nil.')
  end

  if @nominal_apr.nil?
    invalid_properties.push('invalid value for "nominal_apr", nominal_apr cannot be nil.')
  end

  if @interest_capitalization_grace_period_months.nil?
    invalid_properties.push('invalid value for "interest_capitalization_grace_period_months", interest_capitalization_grace_period_months cannot be nil.')
  end

  if @repayment_model.nil?
    invalid_properties.push('invalid value for "repayment_model", repayment_model cannot be nil.')
  end

  if @expected_payoff_date.nil?
    invalid_properties.push('invalid value for "expected_payoff_date", expected_payoff_date cannot be nil.')
  end

  if @guarantor.nil?
    invalid_properties.push('invalid value for "guarantor", guarantor cannot be nil.')
  end

  if @is_federal.nil?
    invalid_properties.push('invalid value for "is_federal", is_federal cannot be nil.')
  end

  if @loan_name.nil?
    invalid_properties.push('invalid value for "loan_name", loan_name cannot be nil.')
  end

  if @loan_status.nil?
    invalid_properties.push('invalid value for "loan_status", loan_status cannot be nil.')
  end

  if @payment_reference_number.nil?
    invalid_properties.push('invalid value for "payment_reference_number", payment_reference_number cannot be nil.')
  end

  if @pslf_status.nil?
    invalid_properties.push('invalid value for "pslf_status", pslf_status cannot be nil.')
  end

  if @repayment_plan_description.nil?
    invalid_properties.push('invalid value for "repayment_plan_description", repayment_plan_description cannot be nil.')
  end

  if @repayment_plan_type.nil?
    invalid_properties.push('invalid value for "repayment_plan_type", repayment_plan_type cannot be nil.')
  end

  if @sequence_number.nil?
    invalid_properties.push('invalid value for "sequence_number", sequence_number cannot be nil.')
  end

  if @servicer_address.nil?
    invalid_properties.push('invalid value for "servicer_address", servicer_address cannot be nil.')
  end

  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/plaid/models/liability_override.rb, line 527
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/plaid/models/liability_override.rb, line 533
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/plaid/models/liability_override.rb, line 521
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/plaid/models/liability_override.rb, line 375
def valid?
  return false if @type.nil?
  return false if @purchase_apr.nil?
  return false if @cash_apr.nil?
  return false if @balance_transfer_apr.nil?
  return false if @special_apr.nil?
  return false if @last_payment_amount.nil?
  return false if @minimum_payment_amount.nil?
  return false if @is_overdue.nil?
  return false if @origination_date.nil?
  return false if @principal.nil?
  return false if @nominal_apr.nil?
  return false if @interest_capitalization_grace_period_months.nil?
  return false if @repayment_model.nil?
  return false if @expected_payoff_date.nil?
  return false if @guarantor.nil?
  return false if @is_federal.nil?
  return false if @loan_name.nil?
  return false if @loan_status.nil?
  return false if @payment_reference_number.nil?
  return false if @pslf_status.nil?
  return false if @repayment_plan_description.nil?
  return false if @repayment_plan_type.nil?
  return false if @sequence_number.nil?
  return false if @servicer_address.nil?
  true
end