Class: ShellCardManagementApIs::UpdateCardStatusResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::UpdateCardStatusResponse
- Defined in:
- lib/shell_card_management_ap_is/models/update_card_status_response.rb
Overview
UpdateCardStatusResponse Model.
Instance Attribute Summary collapse
-
#data ⇒ Array[SubmittedCard]
Indicates overall status of the request.
-
#errors ⇒ Array[ErrorDetails]
Order replacement reference number for tracking the execution of the order replacement cards request.
-
#main_reference ⇒ Integer
Update status 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, status = SKIP, data = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, errors = SKIP) ⇒ UpdateCardStatusResponse
constructor
A new instance of UpdateCardStatusResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(request_id = SKIP, status = SKIP, data = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, errors = SKIP) ⇒ UpdateCardStatusResponse
Returns a new instance of UpdateCardStatusResponse.
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 76 def initialize(request_id = SKIP, status = SKIP, data = SKIP, main_reference = SKIP, order_replacement_reference = SKIP, errors = SKIP) @request_id = request_id unless request_id == SKIP @status = status unless status == SKIP @data = data unless data == SKIP @main_reference = main_reference unless main_reference == SKIP unless order_replacement_reference == SKIP @order_replacement_reference = order_replacement_reference end @errors = errors unless errors == SKIP end |
Instance Attribute Details
#data ⇒ Array[SubmittedCard]
Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS
25 26 27 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 25 def data @data end |
#errors ⇒ Array[ErrorDetails]
Order replacement reference number for tracking the execution of the order replacement cards request. <br/>Note: Reference will be empty for status 9006 and 9012 i.e., request for all the cards failed or if there were no order replacement requested in the input.
45 46 47 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 45 def errors @errors end |
#main_reference ⇒ Integer
Update status reference number for tracking the execution of the request.
Note: Reference will be empty for status 9006 and 9012 i.e., request for all the cards failed.
31 32 33 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 31 def main_reference @main_reference end |
#order_replacement_reference ⇒ Integer
Order replacement reference number for tracking the execution of the order replacement cards request. <br/>Note: Reference will be empty for status 9006 and 9012 i.e., request for all the cards failed or if there were no order replacement requested in the input.
38 39 40 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 38 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/update_card_status_response.rb', line 15 def request_id @request_id end |
#status ⇒ String
Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS
20 21 22 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 20 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 123 124 125 126 127 128 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('RequestId') ? hash['RequestId'] : 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') main_reference = hash.key?('MainReference') ? hash['MainReference'] : SKIP order_replacement_reference = hash.key?('OrderReplacementReference') ? hash['OrderReplacementReference'] : SKIP # 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. UpdateCardStatusResponse.new(request_id, status, data, main_reference, order_replacement_reference, errors) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'RequestId' @_hash['status'] = 'Status' @_hash['data'] = 'Data' @_hash['main_reference'] = 'MainReference' @_hash['order_replacement_reference'] = 'OrderReplacementReference' @_hash['errors'] = 'Errors' @_hash end |
.nullables ⇒ Object
An array for nullable fields
72 73 74 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 72 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/shell_card_management_ap_is/models/update_card_status_response.rb', line 60 def self.optionals %w[ request_id status data main_reference order_replacement_reference errors ] end |