Class: CyberSourceMergedSpec::Links223

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

Overview

Links223 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(mself: SKIP, reversal: SKIP, refund: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ Links223

Returns a new instance of Links223.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 65

def initialize(mself: SKIP, reversal: SKIP, refund: SKIP, customer: SKIP,
               payment_instrument: SKIP, instrument_identifier: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @mself = mself unless mself == SKIP
  @reversal = reversal unless reversal == SKIP
  @refund = refund unless refund == SKIP
  @customer = customer unless customer == SKIP
  @payment_instrument = payment_instrument unless payment_instrument == SKIP
  @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#customerCustomer58

A GET link to the customer supplied in the AFT

Returns:



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

def customer
  @customer
end

#instrument_identifierInstrumentIdentifier35

A GET link to the instrument identifier used in the AFT



34
35
36
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 34

def instrument_identifier
  @instrument_identifier
end

#mselfSelf221

A GET link to the AFT

Returns:



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

def mself
  @mself
end

#payment_instrumentPaymentInstrument24

A GET link to the payment instrument supplied in the AFT

Returns:



30
31
32
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 30

def payment_instrument
  @payment_instrument
end

#refundRefund1

A POST link for a refund

Returns:



22
23
24
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 22

def refund
  @refund
end

#reversalReversal6

A POST link for a reversal

Returns:



18
19
20
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 18

def reversal
  @reversal
end

Class Method Details

.from_element(root) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 111

def self.from_element(root)
  mself = XmlUtilities.from_element(root, 'Self221', Self221)
  reversal = XmlUtilities.from_element(root, 'Reversal6', Reversal6)
  refund = XmlUtilities.from_element(root, 'Refund1', Refund1)
  customer = XmlUtilities.from_element(root, 'Customer58', Customer58)
  payment_instrument = XmlUtilities.from_element(root,
                                                 'PaymentInstrument24',
                                                 PaymentInstrument24)
  instrument_identifier = XmlUtilities.from_element(
    root, 'InstrumentIdentifier35', InstrumentIdentifier35
  )

  new(mself: mself,
      reversal: reversal,
      refund: refund,
      customer: customer,
      payment_instrument: payment_instrument,
      instrument_identifier: instrument_identifier,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mself = Self221.from_hash(hash['self']) if hash['self']
  reversal = Reversal6.from_hash(hash['reversal']) if hash['reversal']
  refund = Refund1.from_hash(hash['refund']) if hash['refund']
  customer = Customer58.from_hash(hash['customer']) if hash['customer']
  payment_instrument = PaymentInstrument24.from_hash(hash['paymentInstrument']) if
    hash['paymentInstrument']
  instrument_identifier = InstrumentIdentifier35.from_hash(hash['instrumentIdentifier']) if
    hash['instrumentIdentifier']

  # 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.
  Links223.new(mself: mself,
               reversal: reversal,
               refund: refund,
               customer: customer,
               payment_instrument: payment_instrument,
               instrument_identifier: instrument_identifier,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mself'] = 'self'
  @_hash['reversal'] = 'reversal'
  @_hash['refund'] = 'refund'
  @_hash['customer'] = 'customer'
  @_hash['payment_instrument'] = 'paymentInstrument'
  @_hash['instrument_identifier'] = 'instrumentIdentifier'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 49

def self.optionals
  %w[
    mself
    reversal
    refund
    customer
    payment_instrument
    instrument_identifier
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



158
159
160
161
162
163
164
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 158

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mself: #{@mself.inspect}, reversal: #{@reversal.inspect}, refund:"\
  " #{@refund.inspect}, customer: #{@customer.inspect}, payment_instrument:"\
  " #{@payment_instrument.inspect}, instrument_identifier: #{@instrument_identifier.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



150
151
152
153
154
155
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 150

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mself: #{@mself}, reversal: #{@reversal}, refund: #{@refund}, customer:"\
  " #{@customer}, payment_instrument: #{@payment_instrument}, instrument_identifier:"\
  " #{@instrument_identifier}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/cyber_source_merged_spec/models/links223.rb', line 132

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

  XmlUtilities.add_as_subelement(doc, root, 'Self221', mself)
  XmlUtilities.add_as_subelement(doc, root, 'Reversal6', reversal)
  XmlUtilities.add_as_subelement(doc, root, 'Refund1', refund)
  XmlUtilities.add_as_subelement(doc, root, 'Customer58', customer)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentInstrument24',
                                 payment_instrument)
  XmlUtilities.add_as_subelement(doc, root, 'InstrumentIdentifier35',
                                 instrument_identifier)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end