Class: CyberSourceMergedSpec::EmbeddedActions

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

Overview

Contains embedded actions, that includes status and response for every actions in the list.

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(capture: SKIP, decision: SKIP, consumer_authentication: SKIP, validate_consumer_authentication: SKIP, watchlist_screening: SKIP, token_create: SKIP, token_update: SKIP, additional_properties: nil) ⇒ EmbeddedActions

Returns a new instance of EmbeddedActions.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 73

def initialize(capture: SKIP, decision: SKIP, consumer_authentication: SKIP,
               validate_consumer_authentication: SKIP,
               watchlist_screening: SKIP, token_create: SKIP,
               token_update: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @capture = capture unless capture == SKIP
  @decision = decision unless decision == SKIP
  @consumer_authentication = consumer_authentication unless consumer_authentication == SKIP
  unless validate_consumer_authentication == SKIP
    @validate_consumer_authentication =
      validate_consumer_authentication
  end
  @watchlist_screening = watchlist_screening unless watchlist_screening == SKIP
  @token_create = token_create unless token_create == SKIP
  @token_update = token_update unless token_update == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#captureCapture1

TODO: Write general description for this method

Returns:



15
16
17
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 15

def capture
  @capture
end

#consumer_authenticationConsumerauthentication

TODO: Write general description for this method



23
24
25
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 23

def consumer_authentication
  @consumer_authentication
end

#decisionDecision

TODO: Write general description for this method

Returns:



19
20
21
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 19

def decision
  @decision
end

#token_createTokencreate

TODO: Write general description for this method

Returns:



35
36
37
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 35

def token_create
  @token_create
end

#token_updateTokenupdate

TODO: Write general description for this method

Returns:



39
40
41
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 39

def token_update
  @token_update
end

#validate_consumer_authenticationValidateconsumerauthentication

TODO: Write general description for this method



27
28
29
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 27

def validate_consumer_authentication
  @validate_consumer_authentication
end

#watchlist_screeningWatchlistscreening

TODO: Write general description for this method

Returns:



31
32
33
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 31

def watchlist_screening
  @watchlist_screening
end

Class Method Details

.from_element(root) ⇒ Object



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 128

def self.from_element(root)
  capture = XmlUtilities.from_element(root, 'CAPTURE1', Capture1)
  decision = XmlUtilities.from_element(root, 'DECISION', Decision)
  consumer_authentication = XmlUtilities.from_element(
    root, 'CONSUMERAUTHENTICATION', Consumerauthentication
  )
  validate_consumer_authentication = XmlUtilities.from_element(
    root, 'VALIDATECONSUMERAUTHENTICATION',
    Validateconsumerauthentication
  )
  watchlist_screening = XmlUtilities.from_element(root,
                                                  'WATCHLISTSCREENING',
                                                  Watchlistscreening)
  token_create = XmlUtilities.from_element(root, 'TOKENCREATE', Tokencreate)
  token_update = XmlUtilities.from_element(root, 'TOKENUPDATE', Tokenupdate)

  new(capture: capture,
      decision: decision,
      consumer_authentication: consumer_authentication,
      validate_consumer_authentication: validate_consumer_authentication,
      watchlist_screening: watchlist_screening,
      token_create: token_create,
      token_update: token_update,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  capture = Capture1.from_hash(hash['CAPTURE']) if hash['CAPTURE']
  decision = Decision.from_hash(hash['DECISION']) if hash['DECISION']
  consumer_authentication = Consumerauthentication.from_hash(hash['CONSUMER_AUTHENTICATION']) if
    hash['CONSUMER_AUTHENTICATION']
  if hash['VALIDATE_CONSUMER_AUTHENTICATION']
    validate_consumer_authentication = Validateconsumerauthentication.from_hash(hash['VALIDATE_CONSUMER_AUTHENTICATION'])
  end
  watchlist_screening = Watchlistscreening.from_hash(hash['WATCHLIST_SCREENING']) if
    hash['WATCHLIST_SCREENING']
  token_create = Tokencreate.from_hash(hash['TOKEN_CREATE']) if hash['TOKEN_CREATE']
  token_update = Tokenupdate.from_hash(hash['TOKEN_UPDATE']) if hash['TOKEN_UPDATE']

  # 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.
  EmbeddedActions.new(capture: capture,
                      decision: decision,
                      consumer_authentication: consumer_authentication,
                      validate_consumer_authentication: validate_consumer_authentication,
                      watchlist_screening: watchlist_screening,
                      token_create: token_create,
                      token_update: token_update,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['capture'] = 'CAPTURE'
  @_hash['decision'] = 'DECISION'
  @_hash['consumer_authentication'] = 'CONSUMER_AUTHENTICATION'
  @_hash['validate_consumer_authentication'] =
    'VALIDATE_CONSUMER_AUTHENTICATION'
  @_hash['watchlist_screening'] = 'WATCHLIST_SCREENING'
  @_hash['token_create'] = 'TOKEN_CREATE'
  @_hash['token_update'] = 'TOKEN_UPDATE'
  @_hash
end

.nullablesObject

An array for nullable fields



69
70
71
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 69

def self.nullables
  []
end

.optionalsObject

An array for optional fields



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 56

def self.optionals
  %w[
    capture
    decision
    consumer_authentication
    validate_consumer_authentication
    watchlist_screening
    token_create
    token_update
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
192
193
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 185

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} capture: #{@capture.inspect}, decision: #{@decision.inspect},"\
  " consumer_authentication: #{@consumer_authentication.inspect},"\
  " validate_consumer_authentication: #{@validate_consumer_authentication.inspect},"\
  " watchlist_screening: #{@watchlist_screening.inspect}, token_create:"\
  " #{@token_create.inspect}, token_update: #{@token_update.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



175
176
177
178
179
180
181
182
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 175

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} capture: #{@capture}, decision: #{@decision}, consumer_authentication:"\
  " #{@consumer_authentication}, validate_consumer_authentication:"\
  " #{@validate_consumer_authentication}, watchlist_screening: #{@watchlist_screening},"\
  " token_create: #{@token_create}, token_update: #{@token_update}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/cyber_source_merged_spec/models/embedded_actions.rb', line 154

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

  XmlUtilities.add_as_subelement(doc, root, 'CAPTURE1', capture)
  XmlUtilities.add_as_subelement(doc, root, 'DECISION', decision)
  XmlUtilities.add_as_subelement(doc, root, 'CONSUMERAUTHENTICATION',
                                 consumer_authentication)
  XmlUtilities.add_as_subelement(doc, root,
                                 'VALIDATECONSUMERAUTHENTICATION',
                                 validate_consumer_authentication)
  XmlUtilities.add_as_subelement(doc, root, 'WATCHLISTSCREENING',
                                 watchlist_screening)
  XmlUtilities.add_as_subelement(doc, root, 'TOKENCREATE', token_create)
  XmlUtilities.add_as_subelement(doc, root, 'TOKENUPDATE', token_update)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end