Class: ShellCardManagementApIs::CancelCardResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CancelCardResponse
- Defined in:
- lib/shell_card_management_ap_is/models/cancel_card_response.rb
Overview
CancelCardResponse Model.
Instance Attribute Summary collapse
-
#data ⇒ Array[SubmittedCard]
Indicates overall status of the request.
-
#errors ⇒ Array[ErrorDetails]
Indicates overall status of the request.
-
#main_reference ⇒ Integer
Cancel card reference number for tracking the execution of the request.
-
#order_replacement_reference ⇒ Integer
Order replacement reference number for tracking the execution of the order replacement cards request.
-
#request_id ⇒ String
Unique request identifier passed from end user.
-
#status ⇒ String
Indicates overall status of the request.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(request_id = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, status = SKIP, data = SKIP, errors = SKIP) ⇒ CancelCardResponse
constructor
A new instance of CancelCardResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(request_id = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, status = SKIP, data = SKIP, errors = SKIP) ⇒ CancelCardResponse
Returns a new instance of CancelCardResponse.
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 70 def initialize(request_id = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, status = SKIP, data = SKIP, errors = SKIP) @request_id = request_id unless request_id == SKIP @main_reference = main_reference unless main_reference == SKIP unless order_replacement_reference == SKIP @order_replacement_reference = order_replacement_reference end @status = status unless status == SKIP @data = data unless data == SKIP @errors = errors unless errors == SKIP end |
Instance Attribute Details
#data ⇒ Array[SubmittedCard]
Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS
34 35 36 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 34 def data @data end |
#errors ⇒ Array[ErrorDetails]
Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS
39 40 41 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 39 def errors @errors end |
#main_reference ⇒ Integer
Cancel card reference number for tracking the execution of the request.
19 20 21 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 19 def main_reference @main_reference end |
#order_replacement_reference ⇒ Integer
Order replacement reference number for tracking the execution of the order replacement cards request.
24 25 26 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 24 def order_replacement_reference @order_replacement_reference end |
#request_id ⇒ String
Unique request identifier passed from end user. This identifier helps in tracing a transaction
15 16 17 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 15 def request_id @request_id end |
#status ⇒ String
Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 29 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP main_reference = hash.key?('MainReference') ? hash['MainReference'] : SKIP order_replacement_reference = hash.key?('OrderReplacementReference') ? hash['OrderReplacementReference'] : SKIP status = hash.key?('Status') ? hash['Status'] : SKIP # Parameter is an array, so we need to iterate through it data = nil unless hash['Data'].nil? data = [] hash['Data'].each do |structure| data << (SubmittedCard.from_hash(structure) if structure) end end data = SKIP unless hash.key?('Data') # Parameter is an array, so we need to iterate through it errors = nil unless hash['Errors'].nil? errors = [] hash['Errors'].each do |structure| errors << (ErrorDetails.from_hash(structure) if structure) end end errors = SKIP unless hash.key?('Errors') # Create object from extracted values. CancelCardResponse.new(request_id, main_reference, order_replacement_reference, status, data, errors) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'RequestId' @_hash['main_reference'] = 'MainReference' @_hash['order_replacement_reference'] = 'OrderReplacementReference' @_hash['status'] = 'Status' @_hash['data'] = 'Data' @_hash['errors'] = 'Errors' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 54 def self.optionals %w[ request_id main_reference order_replacement_reference status data errors ] end |