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

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(account_id = SKIP, account_number = SKIP, usage_restriction_status = SKIP, usage_restriction_description = SKIP) ⇒ AccountRestrictionResponse

Returns a new instance of AccountRestrictionResponse.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 57

def initialize( = SKIP,  = SKIP,
               usage_restriction_status = SKIP,
               usage_restriction_description = 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
end

Instance Attribute Details

#account_idInteger

Account Id on which restriction is applied. Example: 123456

Returns:

  • (Integer)


15
16
17
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 15

def 
  @account_id
end

#account_numberString

Account Number on which restriction is applied. Example: GB000000123

Returns:

  • (String)


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

def 
  @account_number
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)


30
31
32
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 30

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)


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

def usage_restriction_status
  @usage_restriction_status
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
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

   = 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

  # Create object from extracted values.

  AccountRestrictionResponse.new(,
                                 ,
                                 usage_restriction_status,
                                 usage_restriction_description)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['usage_restriction_status'] = 'UsageRestrictionStatus'
  @_hash['usage_restriction_description'] = 'UsageRestrictionDescription'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
49
50
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 43

def self.optionals
  %w[
    account_id
    account_number
    usage_restriction_status
    usage_restriction_description
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



97
98
99
100
101
102
103
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 97

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account_number:"\
  " #{@account_number.inspect}, usage_restriction_status:"\
  " #{@usage_restriction_status.inspect}, usage_restriction_description:"\
  " #{@usage_restriction_description.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
94
# File 'lib/shell_card_management_ap_is/models/account_restriction_response.rb', line 89

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account_number: #{@account_number},"\
  " usage_restriction_status: #{@usage_restriction_status}, usage_restriction_description:"\
  " #{@usage_restriction_description}>"
end