Class: ShellCardManagementApIs::CardRestrictionResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardRestrictionResponse
- Defined in:
- lib/shell_card_management_ap_is/models/card_restriction_response.rb
Overview
CardRestrictionResponse Model.
Instance Attribute Summary collapse
-
#cards ⇒ Array[RestrictioncardsRes]
Reference number for tracking the execution of the card restriction requests.
-
#error ⇒ ErrorStatus
Reference number for tracking the execution of the card restriction requests.
-
#request_id ⇒ String
Request Id of the API call.
-
#restriction_request_reference ⇒ Float
Reference number for tracking the execution of the card restriction requests.
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, restriction_request_reference = SKIP, cards = SKIP, error = SKIP) ⇒ CardRestrictionResponse
constructor
A new instance of CardRestrictionResponse.
Methods inherited from BaseModel
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
#cards ⇒ Array[RestrictioncardsRes]
Reference number for tracking the execution of the card restriction requests.
24 25 26 |
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 24 def cards @cards end |
#error ⇒ ErrorStatus
Reference number for tracking the execution of the card restriction requests.
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/card_restriction_response.rb', line 29 def error @error end |
#request_id ⇒ String
Request Id of the API call
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_reference ⇒ Float
Reference number for tracking the execution of the card restriction requests.
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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 |