Class: ShellCardManagementApIs::AccountRestrictionResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::AccountRestrictionResponse
- Defined in:
- lib/shell_card_management_ap_is/models/account_restriction_response.rb
Overview
AccountRestrictionResponse Model.
Instance Attribute Summary collapse
-
#account_id ⇒ Integer
Account Id on which restriction is applied.
-
#account_number ⇒ String
Account Number on which restriction is applied.
-
#error ⇒ ErrorStatus
Response for the usage restriction in case of an error.
-
#request_id ⇒ String
Request Id of the API call.
-
#usage_restriction_description ⇒ String
Response for the usage restriction in case of an error.
-
#usage_restriction_status ⇒ String
Status of the card usage restriction submitted to Gateway.
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, account_id = SKIP, account_number = SKIP, usage_restriction_status = SKIP, usage_restriction_description = SKIP, error = SKIP) ⇒ AccountRestrictionResponse
constructor
A new instance of AccountRestrictionResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(request_id = SKIP, account_id = SKIP, account_number = SKIP, usage_restriction_status = SKIP, usage_restriction_description = SKIP, error = SKIP) ⇒ AccountRestrictionResponse
Returns a new instance of AccountRestrictionResponse.
72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 72 def initialize(request_id = SKIP, account_id = SKIP, account_number = SKIP, usage_restriction_status = SKIP, usage_restriction_description = SKIP, error = SKIP) @request_id = request_id unless request_id == SKIP @account_id = account_id unless account_id == SKIP @account_number = account_number unless account_number == SKIP @usage_restriction_status = usage_restriction_status unless usage_restriction_status == SKIP unless usage_restriction_description == SKIP @usage_restriction_description = usage_restriction_description end @error = error unless error == SKIP end |
Instance Attribute Details
#account_id ⇒ Integer
Account Id on which restriction is applied. Example: 123456
19 20 21 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 19 def account_id @account_id end |
#account_number ⇒ String
Account Number on which restriction is applied. Example: GB000000123
24 25 26 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 24 def account_number @account_number end |
#error ⇒ ErrorStatus
Response for the usage restriction in case of an error. This field will have a value only when “UsageRestrictionStatus” is “Failed”.
39 40 41 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 39 def error @error end |
#request_id ⇒ String
Request Id of the API call
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 14 def request_id @request_id end |
#usage_restriction_description ⇒ String
Response for the usage restriction in case of an error. This field will have a value only when “UsageRestrictionStatus” is “Failed”.
34 35 36 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 34 def usage_restriction_description @usage_restriction_description end |
#usage_restriction_status ⇒ String
Status of the card usage restriction submitted to Gateway. Based on the response from Gateway value will be set as either “Success” or “Failed”.
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 29 def usage_restriction_status @usage_restriction_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP account_id = hash.key?('AccountId') ? hash['AccountId'] : SKIP account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP usage_restriction_status = hash.key?('UsageRestrictionStatus') ? hash['UsageRestrictionStatus'] : SKIP usage_restriction_description = hash.key?('UsageRestrictionDescription') ? hash['UsageRestrictionDescription'] : SKIP error = ErrorStatus.from_hash(hash['Error']) if hash['Error'] # Create object from extracted values. AccountRestrictionResponse.new(request_id, account_id, account_number, usage_restriction_status, usage_restriction_description, error) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'RequestId' @_hash['account_id'] = 'AccountId' @_hash['account_number'] = 'AccountNumber' @_hash['usage_restriction_status'] = 'UsageRestrictionStatus' @_hash['usage_restriction_description'] = 'UsageRestrictionDescription' @_hash['error'] = 'Error' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 69 70 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 66 def self.nullables %w[ request_id ] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 54 def self.optionals %w[ request_id account_id account_number usage_restriction_status usage_restriction_description error ] end |