Class: ShellCardManagementApIs::SearchCardRestrictionRes

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

Overview

SearchCardRestrictionRes 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, cards = SKIP, restrictions = SKIP, error = SKIP) ⇒ SearchCardRestrictionRes

Returns a new instance of SearchCardRestrictionRes.



55
56
57
58
59
60
61
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 55

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

Instance Attribute Details

#cardsArray[RestrictionCardList]

Request Id of the API call

Returns:



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

def cards
  @cards
end

#errorErrorStatus

Request Id of the API call

Returns:



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

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/search_card_restriction_res.rb', line 14

def request_id
  @request_id
end

#restrictionsRestriction

Request Id of the API call

Returns:



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

def restrictions
  @restrictions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('RequestId') ? hash['RequestId'] : 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 << (RestrictionCardList.from_hash(structure) if structure)
    end
  end

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

  # Create object from extracted values.
  SearchCardRestrictionRes.new(request_id,
                               cards,
                               restrictions,
                               error)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 29

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

.nullablesObject

An array for nullable fields



49
50
51
52
53
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 49

def self.nullables
  %w[
    request_id
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 39

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