Class: CyberSourceMergedSpec::PersonalIdentification9

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

Overview

PersonalIdentification9 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(id: SKIP, type: SKIP, issued_by: SKIP, additional_properties: nil) ⇒ PersonalIdentification9

Returns a new instance of PersonalIdentification9.



51
52
53
54
55
56
57
58
59
60
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 51

def initialize(id: SKIP, type: SKIP, issued_by: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @type = type unless type == SKIP
  @issued_by = issued_by unless issued_by == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#idString

The value of the identification type.

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 14

def id
  @id
end

#issued_byIssuedBy

The type of the identification. Possible Values:

- driver license

Returns:



26
27
28
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 26

def issued_by
  @issued_by
end

#typeString

The type of the identification. Possible Values:

- driver license

Returns:

  • (String)


20
21
22
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 20

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



85
86
87
88
89
90
91
92
93
94
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 85

def self.from_element(root)
  id = XmlUtilities.from_element(root, 'id', String)
  type = XmlUtilities.from_element(root, 'type', String)
  issued_by = XmlUtilities.from_element(root, 'IssuedBy', IssuedBy)

  new(id: id,
      type: type,
      issued_by: issued_by,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  issued_by = IssuedBy.from_hash(hash['issuedBy']) if hash['issuedBy']

  # 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.
  PersonalIdentification9.new(id: id,
                              type: type,
                              issued_by: issued_by,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['type'] = 'type'
  @_hash['issued_by'] = 'issuedBy'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 38

def self.optionals
  %w[
    id
    type
    issued_by
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



116
117
118
119
120
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 116

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

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 109

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

#to_xml_element(doc, root_name) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/cyber_source_merged_spec/models/personal_identification9.rb', line 96

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

  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'IssuedBy', issued_by)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end