Class: ShellCardManagementApIs::AccountRestrictionResponse

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

Overview

AccountRestrictionResponse 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, 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,  = SKIP,  = SKIP,
               usage_restriction_status = SKIP,
               usage_restriction_description = SKIP, error = SKIP)
  @request_id = request_id unless request_id == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == 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_idInteger

Account Id on which restriction is applied. Example: 123456

Returns:

  • (Integer)


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

def 
  @account_id
end

#account_numberString

Account Number on which restriction is applied. Example: GB000000123

Returns:

  • (String)


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

def 
  @account_number
end

#errorErrorStatus

Response for the usage restriction in case of an error. This field will have a value only when “UsageRestrictionStatus” is “Failed”.

Returns:



39
40
41
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 39

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

def request_id
  @request_id
end

#usage_restriction_descriptionString

Response for the usage restriction in case of an error. This field will have a value only when “UsageRestrictionStatus” is “Failed”.

Returns:

  • (String)


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_statusString

Status of the card usage restriction submitted to Gateway. Based on the response from Gateway value will be set as either “Success” or “Failed”.

Returns:

  • (String)


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
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = 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,
                                 ,
                                 ,
                                 usage_restriction_status,
                                 usage_restriction_description,
                                 error)
end

.namesObject

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

.nullablesObject

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

.optionalsObject

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