Class: VisaAcceptanceMergedSpec::Match

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/match.rb

Overview

Match Model.

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(addresses: SKIP, sanction_list: SKIP, aliases: SKIP, programs: SKIP, additional_properties: nil) ⇒ Match

Returns a new instance of Match.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 57

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

  @addresses = addresses unless addresses == SKIP
  @sanction_list = sanction_list unless sanction_list == SKIP
  @aliases = aliases unless aliases == SKIP
  @programs = programs unless programs == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressesArray[String]

Address found on the list specified in export_matchN_list for the entity (name and address) in the request.

Returns:

  • (Array[String])


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 15

def addresses
  @addresses
end

#aliasesArray[String]

Name found on the list specified in export_matchN_list for the entity (name and address) in the request.

Returns:

  • (Array[String])


25
26
27
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 25

def aliases
  @aliases
end

#programsArray[String]

Sub-lists matched by the order data. List members are separated by carets (^).

Returns:

  • (Array[String])


30
31
32
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 30

def programs
  @programs
end

#sanction_listString

List on which the first Denied Parties List check match appears. For a list of codes, see "Denied Parties List Check Codes," page 56.

Returns:

  • (String)


20
21
22
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 20

def sanction_list
  @sanction_list
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  addresses = hash.key?('addresses') ? hash['addresses'] : SKIP
  sanction_list = hash.key?('sanctionList') ? hash['sanctionList'] : SKIP
  aliases = hash.key?('aliases') ? hash['aliases'] : SKIP
  programs = hash.key?('programs') ? hash['programs'] : SKIP

  # 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.
  Match.new(addresses: addresses,
            sanction_list: sanction_list,
            aliases: aliases,
            programs: programs,
            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['addresses'] = 'addresses'
  @_hash['sanction_list'] = 'sanctionList'
  @_hash['aliases'] = 'aliases'
  @_hash['programs'] = 'programs'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
50
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 43

def self.optionals
  %w[
    addresses
    sanction_list
    aliases
    programs
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



102
103
104
105
106
107
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 102

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

#to_sObject

Provides a human-readable string representation of the object.



95
96
97
98
99
# File 'lib/visa_acceptance_merged_spec/models/match.rb', line 95

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