Class: VisaAcceptanceMergedSpec::Ivr

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

Overview

Ivr 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(enabled_message: SKIP, encryption_key: SKIP, encryption_mandatory: SKIP, encryption_type: SKIP, label: SKIP, prompt: SKIP, status_message: SKIP, additional_properties: nil) ⇒ Ivr

Returns a new instance of Ivr.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 76

def initialize(enabled_message: SKIP, encryption_key: SKIP,
               encryption_mandatory: SKIP, encryption_type: SKIP,
               label: SKIP, prompt: SKIP, status_message: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @enabled_message = enabled_message unless enabled_message == SKIP
  @encryption_key = encryption_key unless encryption_key == SKIP
  @encryption_mandatory = encryption_mandatory unless encryption_mandatory == SKIP
  @encryption_type = encryption_type unless encryption_type == SKIP
  @label = label unless label == SKIP
  @prompt = prompt unless prompt == SKIP
  @status_message = status_message unless status_message == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#enabled_messageTrueClass | FalseClass

Flag to indicate if a valid IVR transaction was detected.

Returns:

  • (TrueClass | FalseClass)


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

def enabled_message
  @enabled_message
end

#encryption_keyString

Encryption key to be used in the event the ACS requires encryption of the credential field.

Returns:

  • (String)


19
20
21
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 19

def encryption_key
  @encryption_key
end

#encryption_mandatoryTrueClass | FalseClass

Flag to indicate if the ACS requires the credential to be encrypted.

Returns:

  • (TrueClass | FalseClass)


23
24
25
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 23

def encryption_mandatory
  @encryption_mandatory
end

#encryption_typeString

An indicator from the ACS to inform the type of encryption that should be used in the event the ACS requires encryption of the credential field.

Returns:

  • (String)


28
29
30
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 28

def encryption_type
  @encryption_type
end

#labelString

An ACS Provided label that can be presented to the Consumer. Recommended use with an application.

Returns:

  • (String)


33
34
35
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 33

def label
  @label
end

#promptString

An ACS provided string that can be presented to the Consumer. Recommended use with an application.

Returns:

  • (String)


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

def prompt
  @prompt
end

#status_messageString

An ACS provided message that can provide additional information or details.

Returns:

  • (String)


43
44
45
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 43

def status_message
  @status_message
end

Class Method Details

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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enabled_message =
    hash.key?('enabledMessage') ? hash['enabledMessage'] : SKIP
  encryption_key = hash.key?('encryptionKey') ? hash['encryptionKey'] : SKIP
  encryption_mandatory =
    hash.key?('encryptionMandatory') ? hash['encryptionMandatory'] : SKIP
  encryption_type =
    hash.key?('encryptionType') ? hash['encryptionType'] : SKIP
  label = hash.key?('label') ? hash['label'] : SKIP
  prompt = hash.key?('prompt') ? hash['prompt'] : SKIP
  status_message = hash.key?('statusMessage') ? hash['statusMessage'] : SKIP

  # 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.
  Ivr.new(enabled_message: enabled_message,
          encryption_key: encryption_key,
          encryption_mandatory: encryption_mandatory,
          encryption_type: encryption_type,
          label: label,
          prompt: prompt,
          status_message: status_message,
          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enabled_message'] = 'enabledMessage'
  @_hash['encryption_key'] = 'encryptionKey'
  @_hash['encryption_mandatory'] = 'encryptionMandatory'
  @_hash['encryption_type'] = 'encryptionType'
  @_hash['label'] = 'label'
  @_hash['prompt'] = 'prompt'
  @_hash['status_message'] = 'statusMessage'
  @_hash
end

.nullablesObject

An array for nullable fields



72
73
74
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 72

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 59

def self.optionals
  %w[
    enabled_message
    encryption_key
    encryption_mandatory
    encryption_type
    label
    prompt
    status_message
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



137
138
139
140
141
142
143
144
# File 'lib/visa_acceptance_merged_spec/models/ivr.rb', line 137

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled_message: #{@enabled_message.inspect}, encryption_key:"\
  " #{@encryption_key.inspect}, encryption_mandatory: #{@encryption_mandatory.inspect},"\
  " encryption_type: #{@encryption_type.inspect}, label: #{@label.inspect}, prompt:"\
  " #{@prompt.inspect}, status_message: #{@status_message.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled_message: #{@enabled_message}, encryption_key: #{@encryption_key},"\
  " encryption_mandatory: #{@encryption_mandatory}, encryption_type: #{@encryption_type},"\
  " label: #{@label}, prompt: #{@prompt}, status_message: #{@status_message},"\
  " additional_properties: #{@additional_properties}>"
end