Class: ShellCardManagementApIs::CancelCardResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/cancel_card_response.rb

Overview

CancelCardResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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

#dataArray[SubmittedCard]

Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS

Returns:



34
35
36
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 34

def data
  @data
end

#errorsArray[ErrorDetails]

Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS

Returns:



39
40
41
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 39

def errors
  @errors
end

#main_referenceInteger

Cancel card reference number for tracking the execution of the request.

Returns:

  • (Integer)


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_referenceInteger

Order replacement reference number for tracking the execution of the order replacement cards request.

Returns:

  • (Integer)


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_idString

Unique request identifier passed from end user. This identifier helps in tracing a transaction

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/cancel_card_response.rb', line 15

def request_id
  @request_id
end

#statusString

Indicates overall status of the request. Allowed values: SUCCESS, FAILED, PARTIAL_SUCCESS

Returns:

  • (String)


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

.namesObject

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

.nullablesObject

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

.optionalsObject

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