Class: CyberSourceMergedSpec::WatchlistScreeningInformation1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::WatchlistScreeningInformation1
- Defined in:
- lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb
Overview
WatchlistScreeningInformation1 Model.
Instance Attribute Summary collapse
-
#info_codes ⇒ Array[String]
Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction.
-
#ip_country_confidence ⇒ Integer
Likelihood that the country associated with the customer’s IP address was identified correctly.
-
#watch_list ⇒ ExportComplianceWatchList
Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(ip_country_confidence: SKIP, info_codes: SKIP, watch_list: SKIP, additional_properties: nil) ⇒ WatchlistScreeningInformation1
constructor
A new instance of WatchlistScreeningInformation1.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ip_country_confidence: SKIP, info_codes: SKIP, watch_list: SKIP, additional_properties: nil) ⇒ WatchlistScreeningInformation1
Returns a new instance of WatchlistScreeningInformation1.
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 70 def initialize(ip_country_confidence: SKIP, info_codes: SKIP, watch_list: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ip_country_confidence = ip_country_confidence unless ip_country_confidence == SKIP @info_codes = info_codes unless info_codes == SKIP @watch_list = watch_list unless watch_list == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#info_codes ⇒ Array[String]
Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction. This field can contain one or more of these values:
MATCH-DPC: Denied Parties List match.UNV-DPC: Denied Parties List unavailable.MATCH-BCO: Billing country restricted.MATCH-EMCO: Email country restricted.MATCH-HCO: Host name country restricted.MATCH-IPCO: IP country restricted.MATCH-SCO: Shipping country restricted.
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 31 def info_codes @info_codes end |
#ip_country_confidence ⇒ Integer
Likelihood that the country associated with the customer’s IP address was identified correctly. Returns a value from 1–100, where 100 indicates the highest likelihood. If the country cannot be determined, the value is –1.
17 18 19 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 17 def ip_country_confidence @ip_country_confidence end |
#watch_list ⇒ ExportComplianceWatchList
Returned when the Denied Parties List check (first two codes) or the export service (all others) would have declined the transaction. This field can contain one or more of these values:
MATCH-DPC: Denied Parties List match.UNV-DPC: Denied Parties List unavailable.MATCH-BCO: Billing country restricted.MATCH-EMCO: Email country restricted.MATCH-HCO: Host name country restricted.MATCH-IPCO: IP country restricted.MATCH-SCO: Shipping country restricted.
45 46 47 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 45 def watch_list @watch_list end |
Class Method Details
.from_element(root) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 105 def self.from_element(root) ip_country_confidence = XmlUtilities.from_element(root, 'ipCountryConfidence', Integer) info_codes = XmlUtilities.from_element_to_array(root, 'infoCodes', String) watch_list = XmlUtilities.from_element(root, 'exportComplianceWatchList', ExportComplianceWatchList) new(ip_country_confidence: ip_country_confidence, info_codes: info_codes, watch_list: watch_list, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ip_country_confidence = hash.key?('ipCountryConfidence') ? hash['ipCountryConfidence'] : SKIP info_codes = hash.key?('infoCodes') ? hash['infoCodes'] : SKIP watch_list = ExportComplianceWatchList.from_hash(hash['watchList']) if hash['watchList'] # 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. WatchlistScreeningInformation1.new(ip_country_confidence: ip_country_confidence, info_codes: info_codes, watch_list: watch_list, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['ip_country_confidence'] = 'ipCountryConfidence' @_hash['info_codes'] = 'infoCodes' @_hash['watch_list'] = 'watchList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
57 58 59 60 61 62 63 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 57 def self.optionals %w[ ip_country_confidence info_codes watch_list ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
142 143 144 145 146 147 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 142 def inspect class_name = self.class.name.split('::').last "<#{class_name} ip_country_confidence: #{@ip_country_confidence.inspect}, info_codes:"\ " #{@info_codes.inspect}, watch_list: #{@watch_list.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
134 135 136 137 138 139 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 134 def to_s class_name = self.class.name.split('::').last "<#{class_name} ip_country_confidence: #{@ip_country_confidence}, info_codes:"\ " #{@info_codes}, watch_list: #{@watch_list}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/cyber_source_merged_spec/models/watchlist_screening_information1.rb', line 119 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'ipCountryConfidence', ip_country_confidence) XmlUtilities.add_array_as_subelement(doc, root, 'infoCodes', info_codes) XmlUtilities.add_as_subelement(doc, root, 'exportComplianceWatchList', watch_list) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |