Class: ShellCardManagementApIs::SearchAccountLimitResponse

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

Overview

SearchAccountLimitResponse 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, reference_product = SKIP, restriction_condition = SKIP, velocity_limits = SKIP, error = SKIP) ⇒ SearchAccountLimitResponse

Returns a new instance of SearchAccountLimitResponse.



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 78

def initialize(request_id = SKIP,  = SKIP,  = SKIP,
               reference_product = SKIP, restriction_condition = SKIP,
               velocity_limits = SKIP, error = SKIP)
  @request_id = request_id unless request_id == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @reference_product = reference_product unless reference_product == SKIP
  @restriction_condition = restriction_condition unless restriction_condition == SKIP
  @velocity_limits = velocity_limits unless velocity_limits == SKIP
  @error = error unless error == SKIP
end

Instance Attribute Details

#account_idInteger

Account ID of the customer.

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 18

def 
  @account_id
end

#account_numberString

Account Number Example: GB99215176

Returns:

  • (String)


23
24
25
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 23

def 
  @account_number
end

#errorErrorStatus

The restriction condition code. Example: DECLINE_ALERT

Returns:



43
44
45
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 43

def error
  @error
end

#reference_productString

3 digit Shell global fuel product code, if already set up. Example: 021

Returns:

  • (String)


28
29
30
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 28

def reference_product
  @reference_product
end

#request_idString

Request Id of the API call

Returns:

  • (String)


14
15
16
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 14

def request_id
  @request_id
end

#restriction_conditionString

The restriction condition code. Example: DECLINE_ALERT

Returns:

  • (String)


33
34
35
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 33

def restriction_condition
  @restriction_condition
end

#velocity_limitsArray[AccountVelocityLimit]

The restriction condition code. Example: DECLINE_ALERT

Returns:



38
39
40
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 38

def velocity_limits
  @velocity_limits
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 91

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
  reference_product =
    hash.key?('ReferenceProduct') ? hash['ReferenceProduct'] : SKIP
  restriction_condition =
    hash.key?('RestrictionCondition') ? hash['RestrictionCondition'] : SKIP
  # Parameter is an array, so we need to iterate through it
  velocity_limits = nil
  unless hash['VelocityLimits'].nil?
    velocity_limits = []
    hash['VelocityLimits'].each do |structure|
      velocity_limits << (AccountVelocityLimit.from_hash(structure) if structure)
    end
  end

  velocity_limits = SKIP unless hash.key?('VelocityLimits')
  error = ErrorStatus.from_hash(hash['Error']) if hash['Error']

  # Create object from extracted values.
  SearchAccountLimitResponse.new(request_id,
                                 ,
                                 ,
                                 reference_product,
                                 restriction_condition,
                                 velocity_limits,
                                 error)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'RequestId'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['reference_product'] = 'ReferenceProduct'
  @_hash['restriction_condition'] = 'RestrictionCondition'
  @_hash['velocity_limits'] = 'VelocityLimits'
  @_hash['error'] = 'Error'
  @_hash
end

.nullablesObject

An array for nullable fields



72
73
74
75
76
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 72

def self.nullables
  %w[
    request_id
  ]
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/shell_card_management_ap_is/models/search_account_limit_response.rb', line 59

def self.optionals
  %w[
    request_id
    account_id
    account_number
    reference_product
    restriction_condition
    velocity_limits
    error
  ]
end