Class: ShellCardManagementApIs::CardRestrictionResponse

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

Overview

CardRestrictionResponse 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, restriction_request_reference = SKIP, cards = SKIP, error = SKIP) ⇒ CardRestrictionResponse

Returns a new instance of CardRestrictionResponse.



58
59
60
61
62
63
64
65
66
67
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 58

def initialize(request_id = SKIP, restriction_request_reference = SKIP,
               cards = SKIP, error = SKIP)
  @request_id = request_id unless request_id == SKIP
  unless restriction_request_reference == SKIP
    @restriction_request_reference =
      restriction_request_reference
  end
  @cards = cards unless cards == SKIP
  @error = error unless error == SKIP
end

Instance Attribute Details

#cardsArray[RestrictioncardsRes]

Reference number for tracking the execution of the card restriction requests.

Returns:



24
25
26
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 24

def cards
  @cards
end

#errorErrorStatus

Reference number for tracking the execution of the card restriction requests.

Returns:



29
30
31
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 29

def error
  @error
end

#request_idString

Request Id of the API call

Returns:

  • (String)


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

def request_id
  @request_id
end

#restriction_request_referenceFloat

Reference number for tracking the execution of the card restriction requests.

Returns:

  • (Float)


19
20
21
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 19

def restriction_request_reference
  @restriction_request_reference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  restriction_request_reference =
    hash.key?('RestrictionRequestReference') ? hash['RestrictionRequestReference'] : SKIP
  # Parameter is an array, so we need to iterate through it
  cards = nil
  unless hash['Cards'].nil?
    cards = []
    hash['Cards'].each do |structure|
      cards << (RestrictioncardsRes.from_hash(structure) if structure)
    end
  end

  cards = SKIP unless hash.key?('Cards')
  error = ErrorStatus.from_hash(hash['Error']) if hash['Error']

  # Create object from extracted values.
  CardRestrictionResponse.new(request_id,
                              restriction_request_reference,
                              cards,
                              error)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
39
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 32

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'RequestId'
  @_hash['restriction_request_reference'] = 'RestrictionRequestReference'
  @_hash['cards'] = 'Cards'
  @_hash['error'] = 'Error'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
55
56
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 52

def self.nullables
  %w[
    request_id
  ]
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
48
49
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 42

def self.optionals
  %w[
    request_id
    restriction_request_reference
    cards
    error
  ]
end