Class: CyberSourceMergedSpec::ExportComplianceInformation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/export_compliance_information.rb

Overview

ExportComplianceInformation 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(address_operator: SKIP, weights: SKIP, sanction_lists: SKIP, additional_properties: nil) ⇒ ExportComplianceInformation

Returns a new instance of ExportComplianceInformation.



65
66
67
68
69
70
71
72
73
74
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 65

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

  @address_operator = address_operator unless address_operator == SKIP
  @weights = weights unless weights == SKIP
  @sanction_lists = sanction_lists unless sanction_lists == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#address_operatorString

Parts of the customer’s information that must match with an entry in the DPL (denied parties list) before a match occurs. This field can contain one of the following values:

  • AND: (default) The customer’s name or company and the customer’s address must appear in the database.
  • OR: The customer’s name must appear in the database.
  • IGNORE: You want the service to detect a match only of the customer’s name or company but not of the address.

Returns:

  • (String)


21
22
23
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 21

def address_operator
  @address_operator
end

#sanction_listsArray[String]

Use this field to specify which list(s) you want checked with the request. The reply will include the list name as well as the response data. To check against multiple lists, enter multiple list codes separated by a caret (^). For more information, see "Restricted and Denied Parties List," page 68.

Returns:

  • (Array[String])


40
41
42
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 40

def sanction_lists
  @sanction_lists
end

#weightsWeights

Parts of the customer’s information that must match with an entry in the DPL (denied parties list) before a match occurs. This field can contain one of the following values:

  • AND: (default) The customer’s name or company and the customer’s address must appear in the database.
  • OR: The customer’s name must appear in the database.
  • IGNORE: You want the service to detect a match only of the customer’s name or company but not of the address.

Returns:



32
33
34
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 32

def weights
  @weights
end

Class Method Details

.from_element(root) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 100

def self.from_element(root)
  address_operator = XmlUtilities.from_element(root, 'addressOperator',
                                               String)
  weights = XmlUtilities.from_element(root, 'Weights', Weights)
  sanction_lists = XmlUtilities.from_element_to_array(root, 'sanctionLists',
                                                      String)

  new(address_operator: address_operator,
      weights: weights,
      sanction_lists: sanction_lists,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address_operator =
    hash.key?('addressOperator') ? hash['addressOperator'] : SKIP
  weights = Weights.from_hash(hash['weights']) if hash['weights']
  sanction_lists = hash.key?('sanctionLists') ? hash['sanctionLists'] : 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.
  ExportComplianceInformation.new(address_operator: address_operator,
                                  weights: weights,
                                  sanction_lists: sanction_lists,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address_operator'] = 'addressOperator'
  @_hash['weights'] = 'weights'
  @_hash['sanction_lists'] = 'sanctionLists'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



52
53
54
55
56
57
58
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 52

def self.optionals
  %w[
    address_operator
    weights
    sanction_lists
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 135

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

#to_sObject

Provides a human-readable string representation of the object.



128
129
130
131
132
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 128

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

#to_xml_element(doc, root_name) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/cyber_source_merged_spec/models/export_compliance_information.rb', line 113

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'addressOperator',
                                 address_operator)
  XmlUtilities.add_as_subelement(doc, root, 'Weights', weights)
  XmlUtilities.add_array_as_subelement(doc, root, 'sanctionLists',
                                       sanction_lists)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end