class TreezorClient::Mandate

Attributes

contract_description[RW]
contract_identification_number[RW]
created_date[RW]

Date YYYY-MM-DD HH:MM:SS

created_ip[RW]
creditor_address[RW]
creditor_city[RW]
creditor_country[RW]
creditor_name[RW]
creditor_reference_identification_code[RW]
creditor_reference_party_name[RW]
creditor_zip_code[RW]
debtor_address[RW]
debtor_bic[RW]
debtor_city[RW]
debtor_country[RW]
debtor_iban[RW]
debtor_identification_code[RW]
debtor_name[RW]
debtor_reference_identification_code[RW]
debtor_reference_party_name[RW]
debtor_signature_ip[RW]
debtor_zip_code[RW]
is_paper[RW]
mandate_id[RW]
mandate_status[RW]
modified_date[RW]

Date YYYY-MM-DD HH:MM:SS

revocation_signature_date[RW]

Date YYYY-MM-DD HH:MM:SS

sdd_type[RW]
sepa_creditor_identifier[RW]
sequence_type[RW]
signature_date[RW]

Date YYYY-MM-DD

signed[RW]
title[RW]
unique_mandate_reference[RW]
user_id[RW]
user_id_ultimate_creditor[RW]

For SDDE Core third party credior mode

Public Class Methods

attribute_map() click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 119
def self.attribute_map
  {
    :'mandate_id' => :'mandateId',
    :'title' => :'title',
    :'legal_informations' => :'legalInformations',
    :'unique_mandate_reference' => :'uniqueMandateReference',
    :'mandate_status' => :'mandateStatus',
    :'user_id' => :'userId',
    :'debtor_name' => :'debtorName',
    :'debtor_address' => :'debtorAddress',
    :'debtor_city' => :'debtorCity',
    :'debtor_zip_code' => :'debtorZipCode',
    :'debtor_country' => :'debtorCountry',
    :'debtor_iban' => :'debtorIban',
    :'debtor_bic' => :'debtorBic',
    :'sequence_type' => :'sequenceType',
    :'creditor_name' => :'creditorName',
    :'sepa_creditor_identifier' => :'sepaCreditorIdentifier',
    :'creditor_address' => :'creditorAddress',
    :'creditor_city' => :'creditorCity',
    :'creditor_zip_code' => :'creditorZipCode',
    :'creditor_country' => :'creditorCountry',
    :'signature_date' => :'signatureDate',
    :'debtor_signature_ip' => :'debtorSignatureIp',
    :'signed' => :'signed',
    :'debtor_identification_code' => :'debtorIdentificationCode',
    :'debtor_reference_party_name' => :'debtorReferencePartyName',
    :'debtor_reference_identification_code' => :'debtorReferenceIdentificationCode',
    :'creditor_reference_party_name' => :'creditorReferencePartyName',
    :'creditor_reference_identification_code' => :'creditorReferenceIdentificationCode',
    :'contract_identification_number' => :'contractIdentificationNumber',
    :'contract_description' => :'contractDescription',
    :'is_paper' => :'isPaper',
    :'sdd_type' => :'sddType',
    :'revocation_signature_date' => :'revocationSignatureDate',
    :'created_ip' => :'createdIp',
    :'created_date' => :'createdDate',
    :'modified_date' => :'modifiedDate',
    :'user_id_ultimate_creditor' => :'userIdUltimateCreditor'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 206
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'mandateId')
    self.mandate_id = attributes[:'mandateId']
  end

  if attributes.has_key?(:'title')
    self.title = attributes[:'title']
  end

  if attributes.has_key?(:'legalInformations')
    self.legal_informations = attributes[:'legalInformations']
  end

  if attributes.has_key?(:'uniqueMandateReference')
    self.unique_mandate_reference = attributes[:'uniqueMandateReference']
  end

  if attributes.has_key?(:'mandateStatus')
    self.mandate_status = attributes[:'mandateStatus']
  end

  if attributes.has_key?(:'userId')
    self.user_id = attributes[:'userId']
  end

  if attributes.has_key?(:'debtorName')
    self.debtor_name = attributes[:'debtorName']
  end

  if attributes.has_key?(:'debtorAddress')
    self.debtor_address = attributes[:'debtorAddress']
  end

  if attributes.has_key?(:'debtorCity')
    self.debtor_city = attributes[:'debtorCity']
  end

  if attributes.has_key?(:'debtorZipCode')
    self.debtor_zip_code = attributes[:'debtorZipCode']
  end

  if attributes.has_key?(:'debtorCountry')
    self.debtor_country = attributes[:'debtorCountry']
  end

  if attributes.has_key?(:'debtorIban')
    self.debtor_iban = attributes[:'debtorIban']
  end

  if attributes.has_key?(:'debtorBic')
    self.debtor_bic = attributes[:'debtorBic']
  end

  if attributes.has_key?(:'sequenceType')
    self.sequence_type = attributes[:'sequenceType']
  end

  if attributes.has_key?(:'creditorName')
    self.creditor_name = attributes[:'creditorName']
  end

  if attributes.has_key?(:'sepaCreditorIdentifier')
    self.sepa_creditor_identifier = attributes[:'sepaCreditorIdentifier']
  end

  if attributes.has_key?(:'creditorAddress')
    self.creditor_address = attributes[:'creditorAddress']
  end

  if attributes.has_key?(:'creditorCity')
    self.creditor_city = attributes[:'creditorCity']
  end

  if attributes.has_key?(:'creditorZipCode')
    self.creditor_zip_code = attributes[:'creditorZipCode']
  end

  if attributes.has_key?(:'creditorCountry')
    self.creditor_country = attributes[:'creditorCountry']
  end

  if attributes.has_key?(:'signatureDate')
    self.signature_date = attributes[:'signatureDate']
  end

  if attributes.has_key?(:'debtorSignatureIp')
    self.debtor_signature_ip = attributes[:'debtorSignatureIp']
  end

  if attributes.has_key?(:'signed')
    self.signed = attributes[:'signed']
  end

  if attributes.has_key?(:'debtorIdentificationCode')
    self.debtor_identification_code = attributes[:'debtorIdentificationCode']
  end

  if attributes.has_key?(:'debtorReferencePartyName')
    self.debtor_reference_party_name = attributes[:'debtorReferencePartyName']
  end

  if attributes.has_key?(:'debtorReferenceIdentificationCode')
    self.debtor_reference_identification_code = attributes[:'debtorReferenceIdentificationCode']
  end

  if attributes.has_key?(:'creditorReferencePartyName')
    self.creditor_reference_party_name = attributes[:'creditorReferencePartyName']
  end

  if attributes.has_key?(:'creditorReferenceIdentificationCode')
    self.creditor_reference_identification_code = attributes[:'creditorReferenceIdentificationCode']
  end

  if attributes.has_key?(:'contractIdentificationNumber')
    self.contract_identification_number = attributes[:'contractIdentificationNumber']
  end

  if attributes.has_key?(:'contractDescription')
    self.contract_description = attributes[:'contractDescription']
  end

  if attributes.has_key?(:'isPaper')
    self.is_paper = attributes[:'isPaper']
  end

  if attributes.has_key?(:'sddType')
    self.sdd_type = attributes[:'sddType']
  end

  if attributes.has_key?(:'revocationSignatureDate')
    self.revocation_signature_date = attributes[:'revocationSignatureDate']
  end

  if attributes.has_key?(:'createdIp')
    self.created_ip = attributes[:'createdIp']
  end

  if attributes.has_key?(:'createdDate')
    self.created_date = attributes[:'createdDate']
  end

  if attributes.has_key?(:'modifiedDate')
    self.modified_date = attributes[:'modifiedDate']
  end

  if attributes.has_key?(:'userIdUltimateCreditor')
    self.user_id_ultimate_creditor = attributes[:'userIdUltimateCreditor']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/treezor_client/models/mandate.rb, line 162
def self.swagger_types
  {
    :'mandate_id' => :'Integer',
    :'title' => :'String',
    :'legal_informations' => :'String',
    :'unique_mandate_reference' => :'String',
    :'mandate_status' => :'String',
    :'user_id' => :'Integer',
    :'debtor_name' => :'String',
    :'debtor_address' => :'String',
    :'debtor_city' => :'String',
    :'debtor_zip_code' => :'String',
    :'debtor_country' => :'String',
    :'debtor_iban' => :'String',
    :'debtor_bic' => :'String',
    :'sequence_type' => :'String',
    :'creditor_name' => :'String',
    :'sepa_creditor_identifier' => :'String',
    :'creditor_address' => :'String',
    :'creditor_city' => :'String',
    :'creditor_zip_code' => :'String',
    :'creditor_country' => :'String',
    :'signature_date' => :'String',
    :'debtor_signature_ip' => :'String',
    :'signed' => :'Integer',
    :'debtor_identification_code' => :'String',
    :'debtor_reference_party_name' => :'String',
    :'debtor_reference_identification_code' => :'String',
    :'creditor_reference_party_name' => :'String',
    :'creditor_reference_identification_code' => :'String',
    :'contract_identification_number' => :'String',
    :'contract_description' => :'String',
    :'is_paper' => :'BOOLEAN',
    :'sdd_type' => :'String',
    :'revocation_signature_date' => :'String',
    :'created_ip' => :'String',
    :'created_date' => :'String',
    :'modified_date' => :'String',
    :'user_id_ultimate_creditor' => :'Integer'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 412
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      mandate_id == o.mandate_id &&
      title == o.title &&
      legal_informations == o.legal_informations &&
      unique_mandate_reference == o.unique_mandate_reference &&
      mandate_status == o.mandate_status &&
      user_id == o.user_id &&
      debtor_name == o.debtor_name &&
      debtor_address == o.debtor_address &&
      debtor_city == o.debtor_city &&
      debtor_zip_code == o.debtor_zip_code &&
      debtor_country == o.debtor_country &&
      debtor_iban == o.debtor_iban &&
      debtor_bic == o.debtor_bic &&
      sequence_type == o.sequence_type &&
      creditor_name == o.creditor_name &&
      sepa_creditor_identifier == o.sepa_creditor_identifier &&
      creditor_address == o.creditor_address &&
      creditor_city == o.creditor_city &&
      creditor_zip_code == o.creditor_zip_code &&
      creditor_country == o.creditor_country &&
      signature_date == o.signature_date &&
      debtor_signature_ip == o.debtor_signature_ip &&
      signed == o.signed &&
      debtor_identification_code == o.debtor_identification_code &&
      debtor_reference_party_name == o.debtor_reference_party_name &&
      debtor_reference_identification_code == o.debtor_reference_identification_code &&
      creditor_reference_party_name == o.creditor_reference_party_name &&
      creditor_reference_identification_code == o.creditor_reference_identification_code &&
      contract_identification_number == o.contract_identification_number &&
      contract_description == o.contract_description &&
      is_paper == o.is_paper &&
      sdd_type == o.sdd_type &&
      revocation_signature_date == o.revocation_signature_date &&
      created_ip == o.created_ip &&
      created_date == o.created_date &&
      modified_date == o.modified_date &&
      user_id_ultimate_creditor == o.user_id_ultimate_creditor
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/treezor_client/models/mandate.rb, line 490
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
    temp_model = TreezorClient.const_get(type).new
    temp_model.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/treezor_client/models/mandate.rb, line 556
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/treezor_client/models/mandate.rb, line 469
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the 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/treezor_client/models/mandate.rb, line 456
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 462
def hash
  [mandate_id, title, legal_informations, unique_mandate_reference, mandate_status, user_id, debtor_name, debtor_address, debtor_city, debtor_zip_code, debtor_country, debtor_iban, debtor_bic, sequence_type, creditor_name, sepa_creditor_identifier, creditor_address, creditor_city, creditor_zip_code, creditor_country, signature_date, debtor_signature_ip, signed, debtor_identification_code, debtor_reference_party_name, debtor_reference_identification_code, creditor_reference_party_name, creditor_reference_identification_code, contract_identification_number, contract_description, is_paper, sdd_type, revocation_signature_date, created_ip, created_date, modified_date, user_id_ultimate_creditor].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/treezor_client/models/mandate.rb, line 363
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
mandate_status=(mandate_status) click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 382
def mandate_status=(mandate_status)
  validator = EnumAttributeValidator.new('String', ['PENDING', 'CANCELED', 'VALIDATED'])
  unless validator.valid?(mandate_status)
    fail ArgumentError, 'invalid value for "mandate_status", must be one of #{validator.allowable_values}.'
  end
  @mandate_status = mandate_status
end
sdd_type=(sdd_type) click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 402
def sdd_type=(sdd_type)
  validator = EnumAttributeValidator.new('String', ['core', 'b2b'])
  unless validator.valid?(sdd_type)
    fail ArgumentError, 'invalid value for "sdd_type", must be one of #{validator.allowable_values}.'
  end
  @sdd_type = sdd_type
end
sequence_type=(sequence_type) click to toggle source

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

# File lib/treezor_client/models/mandate.rb, line 392
def sequence_type=(sequence_type)
  validator = EnumAttributeValidator.new('String', ['one-off', 'recurrent'])
  unless validator.valid?(sequence_type)
    fail ArgumentError, 'invalid value for "sequence_type", must be one of #{validator.allowable_values}.'
  end
  @sequence_type = sequence_type
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/treezor_client/models/mandate.rb, line 536
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/treezor_client/models/mandate.rb, line 542
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    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/treezor_client/models/mandate.rb, line 530
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/treezor_client/models/mandate.rb, line 370
def valid?
  mandate_status_validator = EnumAttributeValidator.new('String', ['PENDING', 'CANCELED', 'VALIDATED'])
  return false unless mandate_status_validator.valid?(@mandate_status)
  sequence_type_validator = EnumAttributeValidator.new('String', ['one-off', 'recurrent'])
  return false unless sequence_type_validator.valid?(@sequence_type)
  sdd_type_validator = EnumAttributeValidator.new('String', ['core', 'b2b'])
  return false unless sdd_type_validator.valid?(@sdd_type)
  true
end