class VeloPayments::PayorV1

Attributes

address[RW]
allows_language_choice[RW]

Whether or not the payor allows language choice in the UI.

collective_alias[RW]

How the payor has chosen to refer to payees.

dba_name[RW]

The payor’s 'Doing Business As' name.

funding_account_account_name[RW]

The funding account name to be used for the payor.

funding_account_account_number[RW]

The funding account number to be used for the payor.

funding_account_routing_number[RW]

The funding account routing number to be used for the payor.

includes_reports[RW]
kyc_state[RW]
language[RW]

The payor’s language preference. Must be one of [EN, FR].

manual_lockout[RW]

Whether or not the payor has been manually locked by the backoffice.

max_master_payor_admins[RW]
payee_grace_period_days[RW]

The grace period for paying payees in days.

payee_grace_period_processing_enabled[RW]

Whether grace period processing is enabled.

payor_id[RW]
payor_name[RW]

The name of the payor.

primary_contact_email[RW]

Primary contact email for the payor.

primary_contact_name[RW]

Name of primary contact for the payor.

primary_contact_phone[RW]

Primary contact phone number for the payor.

reminder_emails_opt_out[RW]

Whether or not the payor has opted-out of reminder emails being sent.

support_contact[RW]

The payor’s support contact email address.

Public Class Methods

attribute_map() click to toggle source

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

# File lib/velopayments/models/payor_v1.rb, line 98
def self.attribute_map
  {
    :'payor_id' => :'payorId',
    :'payor_name' => :'payorName',
    :'address' => :'address',
    :'primary_contact_name' => :'primaryContactName',
    :'primary_contact_phone' => :'primaryContactPhone',
    :'primary_contact_email' => :'primaryContactEmail',
    :'funding_account_routing_number' => :'fundingAccountRoutingNumber',
    :'funding_account_account_number' => :'fundingAccountAccountNumber',
    :'funding_account_account_name' => :'fundingAccountAccountName',
    :'kyc_state' => :'kycState',
    :'manual_lockout' => :'manualLockout',
    :'payee_grace_period_processing_enabled' => :'payeeGracePeriodProcessingEnabled',
    :'payee_grace_period_days' => :'payeeGracePeriodDays',
    :'collective_alias' => :'collectiveAlias',
    :'support_contact' => :'supportContact',
    :'dba_name' => :'dbaName',
    :'allows_language_choice' => :'allowsLanguageChoice',
    :'reminder_emails_opt_out' => :'reminderEmailsOptOut',
    :'language' => :'language',
    :'includes_reports' => :'includesReports',
    :'max_master_payor_admins' => :'maxMasterPayorAdmins'
  }
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/velopayments/models/payor_v1.rb, line 330
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/velopayments/models/payor_v1.rb, line 159
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::PayorV1` 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 `VeloPayments::PayorV1`. 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?(:'payor_id')
    self.payor_id = attributes[:'payor_id']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

List of attributes with nullable: true

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

Attribute type mapping.

# File lib/velopayments/models/payor_v1.rb, line 125
def self.openapi_types
  {
    :'payor_id' => :'String',
    :'payor_name' => :'String',
    :'address' => :'PayorAddress',
    :'primary_contact_name' => :'String',
    :'primary_contact_phone' => :'String',
    :'primary_contact_email' => :'String',
    :'funding_account_routing_number' => :'String',
    :'funding_account_account_number' => :'String',
    :'funding_account_account_name' => :'String',
    :'kyc_state' => :'KycState',
    :'manual_lockout' => :'Boolean',
    :'payee_grace_period_processing_enabled' => :'Boolean',
    :'payee_grace_period_days' => :'Integer',
    :'collective_alias' => :'String',
    :'support_contact' => :'String',
    :'dba_name' => :'String',
    :'allows_language_choice' => :'Boolean',
    :'reminder_emails_opt_out' => :'Boolean',
    :'language' => :'String',
    :'includes_reports' => :'Boolean',
    :'max_master_payor_admins' => :'Integer'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/velopayments/models/payor_v1.rb, line 289
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      payor_id == o.payor_id &&
      payor_name == o.payor_name &&
      address == o.address &&
      primary_contact_name == o.primary_contact_name &&
      primary_contact_phone == o.primary_contact_phone &&
      primary_contact_email == o.primary_contact_email &&
      funding_account_routing_number == o.funding_account_routing_number &&
      funding_account_account_number == o.funding_account_account_number &&
      funding_account_account_name == o.funding_account_account_name &&
      kyc_state == o.kyc_state &&
      manual_lockout == o.manual_lockout &&
      payee_grace_period_processing_enabled == o.payee_grace_period_processing_enabled &&
      payee_grace_period_days == o.payee_grace_period_days &&
      collective_alias == o.collective_alias &&
      support_contact == o.support_contact &&
      dba_name == o.dba_name &&
      allows_language_choice == o.allows_language_choice &&
      reminder_emails_opt_out == o.reminder_emails_opt_out &&
      language == o.language &&
      includes_reports == o.includes_reports &&
      max_master_payor_admins == o.max_master_payor_admins
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/velopayments/models/payor_v1.rb, line 358
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    VeloPayments.const_get(type).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/velopayments/models/payor_v1.rb, line 427
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/velopayments/models/payor_v1.rb, line 337
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if 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 # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

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

# File lib/velopayments/models/payor_v1.rb, line 317
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/velopayments/models/payor_v1.rb, line 323
def hash
  [payor_id, payor_name, address, primary_contact_name, primary_contact_phone, primary_contact_email, funding_account_routing_number, funding_account_account_number, funding_account_account_name, kyc_state, manual_lockout, payee_grace_period_processing_enabled, payee_grace_period_days, collective_alias, support_contact, dba_name, allows_language_choice, reminder_emails_opt_out, language, includes_reports, max_master_payor_admins].hash
end
language=(language) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] language Object to be assigned

# File lib/velopayments/models/payor_v1.rb, line 279
def language=(language)
  validator = EnumAttributeValidator.new('String', ["EN", "FR"])
  unless validator.valid?(language)
    fail ArgumentError, "invalid value for \"language\", must be one of #{validator.allowable_values}."
  end
  @language = language
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/velopayments/models/payor_v1.rb, line 259
def list_invalid_properties
  invalid_properties = Array.new
  if @payor_name.nil?
    invalid_properties.push('invalid value for "payor_name", payor_name 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/velopayments/models/payor_v1.rb, line 403
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/velopayments/models/payor_v1.rb, line 409
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/velopayments/models/payor_v1.rb, line 397
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/velopayments/models/payor_v1.rb, line 270
def valid?
  return false if @payor_name.nil?
  language_validator = EnumAttributeValidator.new('String', ["EN", "FR"])
  return false unless language_validator.valid?(@language)
  true
end