Class: VisaAcceptanceMergedSpec::EmbeddedActions2

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/embedded_actions2.rb

Overview

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

Returns a new instance of EmbeddedActions2.



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

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:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 14

def capture
  @capture
end

#consumer_authenticationConsumerauthentication

TODO: Write general description for this method



22
23
24
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 22

def consumer_authentication
  @consumer_authentication
end

#decisionDecision

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 18

def decision
  @decision
end

#token_createTokencreate

TODO: Write general description for this method

Returns:



34
35
36
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 34

def token_create
  @token_create
end

#token_updateTokenupdate

TODO: Write general description for this method

Returns:



38
39
40
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 38

def token_update
  @token_update
end

#validate_consumer_authenticationValidateconsumerauthentication

TODO: Write general description for this method



26
27
28
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 26

def validate_consumer_authentication
  @validate_consumer_authentication
end

#watchlist_screeningWatchlistscreening

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 30

def watchlist_screening
  @watchlist_screening
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
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
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 93

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.
  EmbeddedActions2.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.



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 41

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



68
69
70
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 68

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 55

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.



138
139
140
141
142
143
144
145
146
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 138

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.



128
129
130
131
132
133
134
135
# File 'lib/visa_acceptance_merged_spec/models/embedded_actions2.rb', line 128

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