Class: ShellCardManagementApIs::SearchCardRestrictionRes
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::SearchCardRestrictionRes
- Defined in:
- lib/shell_card_management_ap_is/models/search_card_restriction_res.rb
Overview
SearchCardRestrictionRes Model.
Instance Attribute Summary collapse
-
#cards ⇒ Array[RestrictionCardList]
Request Id of the API call.
-
#error ⇒ ErrorStatus
Request Id of the API call.
-
#request_id ⇒ String
Request Id of the API call.
-
#restrictions ⇒ Restriction
Request Id of the API call.
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, cards = SKIP, restrictions = SKIP, error = SKIP) ⇒ SearchCardRestrictionRes
constructor
A new instance of SearchCardRestrictionRes.
Methods inherited from BaseModel
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
#cards ⇒ Array[RestrictionCardList]
Request Id of the API call
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 18 def cards @cards end |
#error ⇒ ErrorStatus
Request Id of the API call
26 27 28 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 26 def error @error end |
#request_id ⇒ String
Request Id of the API call
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/search_card_restriction_res.rb', line 14 def request_id @request_id end |
#restrictions ⇒ Restriction
Request Id of the API call
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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 |