Class: ShellCardManagementApIs::CardMoveResponse

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

Overview

CardMoveResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(move_card_request_reference = SKIP, successful_requests = SKIP, error_cards = SKIP, request_id = SKIP, error = SKIP) ⇒ CardMoveResponse

Returns a new instance of CardMoveResponse.



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

def initialize(move_card_request_reference = SKIP,
               successful_requests = SKIP, error_cards = SKIP,
               request_id = SKIP, error = SKIP)
  unless move_card_request_reference == SKIP
    @move_card_request_reference =
      move_card_request_reference
  end
  @successful_requests = successful_requests unless successful_requests == SKIP
  @error_cards = error_cards unless error_cards == SKIP
  @request_id = request_id unless request_id == SKIP
  @error = error unless error == SKIP
end

Instance Attribute Details

#errorErrorStatus

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 30

def error
  @error
end

#error_cardsArray[CardMoveResponseErrorCardsItems]

TODO: Write general description for this method



22
23
24
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 22

def error_cards
  @error_cards
end

#move_card_request_referenceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 14

def move_card_request_reference
  @move_card_request_reference
end

#request_idString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 26

def request_id
  @request_id
end

#successful_requestsArray[CardMoveResponseSuccessfulRequestsItems]

TODO: Write general description for this method



18
19
20
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 18

def successful_requests
  @successful_requests
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  move_card_request_reference =
    hash.key?('MoveCardRequestReference') ? hash['MoveCardRequestReference'] : SKIP
  # Parameter is an array, so we need to iterate through it
  successful_requests = nil
  unless hash['SuccessfulRequests'].nil?
    successful_requests = []
    hash['SuccessfulRequests'].each do |structure|
      successful_requests << (CardMoveResponseSuccessfulRequestsItems.from_hash(structure) if structure)
    end
  end

  successful_requests = SKIP unless hash.key?('SuccessfulRequests')
  # Parameter is an array, so we need to iterate through it
  error_cards = nil
  unless hash['ErrorCards'].nil?
    error_cards = []
    hash['ErrorCards'].each do |structure|
      error_cards << (CardMoveResponseErrorCardsItems.from_hash(structure) if structure)
    end
  end

  error_cards = SKIP unless hash.key?('ErrorCards')
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  error = ErrorStatus.from_hash(hash['Error']) if hash['Error']

  # Create object from extracted values.
  CardMoveResponse.new(move_card_request_reference,
                       successful_requests,
                       error_cards,
                       request_id,
                       error)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['move_card_request_reference'] = 'MoveCardRequestReference'
  @_hash['successful_requests'] = 'SuccessfulRequests'
  @_hash['error_cards'] = 'ErrorCards'
  @_hash['request_id'] = 'RequestId'
  @_hash['error'] = 'Error'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/shell_card_management_ap_is/models/card_move_response.rb', line 44

def self.optionals
  %w[
    move_card_request_reference
    successful_requests
    error_cards
    request_id
    error
  ]
end