Class: ShellCardManagementApIs::RestrictionCardsList

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

Overview

RestrictionCardsList Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_id = SKIP, card_id = SKIP, pan = SKIP, reset_usage_restrictions = SKIP, reset_day_time_restrictions = SKIP, reset_product_restrictions = SKIP, reset_location_restrictions = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP, product_restrictions = SKIP, location_restrictions = SKIP) ⇒ RestrictionCardsList

Returns a new instance of RestrictionCardsList.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 139

def initialize( = SKIP, card_id = SKIP, pan = SKIP,
               reset_usage_restrictions = SKIP,
               reset_day_time_restrictions = SKIP,
               reset_product_restrictions = SKIP,
               reset_location_restrictions = SKIP,
               usage_restrictions = SKIP, day_time_restrictions = SKIP,
               product_restrictions = SKIP, location_restrictions = SKIP)
  @account_id =  unless  == SKIP
  @card_id = card_id unless card_id == SKIP
  @pan = pan unless pan == SKIP
  @reset_usage_restrictions = reset_usage_restrictions unless reset_usage_restrictions == SKIP
  unless reset_day_time_restrictions == SKIP
    @reset_day_time_restrictions =
      reset_day_time_restrictions
  end
  unless reset_product_restrictions == SKIP
    @reset_product_restrictions =
      reset_product_restrictions
  end
  unless reset_location_restrictions == SKIP
    @reset_location_restrictions =
      reset_location_restrictions
  end
  @usage_restrictions = usage_restrictions unless usage_restrictions == SKIP
  @day_time_restrictions = day_time_restrictions unless day_time_restrictions == SKIP
  @product_restrictions = product_restrictions unless product_restrictions == SKIP
  @location_restrictions = location_restrictions unless location_restrictions == SKIP
end

Instance Attribute Details

#account_idInteger

Account ID of the customer. Optional if AccountNumber is passed, else Mandatory. This input is a search criterion, if given. Example: 123456

Returns:

  • (Integer)


17
18
19
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 17

def 
  @account_id
end

#card_idInteger

Unique Card Id

Returns:

  • (Integer)


21
22
23
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 21

def card_id
  @card_id
end

#day_time_restrictionsDayTimeRestrictions

True/False. If true, the location restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the location restrictions provided in the API.

Returns:



77
78
79
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 77

def day_time_restrictions
  @day_time_restrictions
end

#location_restrictionsLocationRestriction

True/False. If true, the location restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the location restrictions provided in the API.

Returns:



91
92
93
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 91

def location_restrictions
  @location_restrictions
end

#panString

Card PAN. Optional if CardId is given, else mandatory. Example: 7002051006629890645 Note: • PAN is ignored if CardId is given. When PAN matches with multiple cards, the restriction will be applied on the latest issued card.

Returns:

  • (String)


31
32
33
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 31

def pan
  @pan
end

#product_restrictionsObject

True/False. If true, the location restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the location restrictions provided in the API.

Returns:

  • (Object)


84
85
86
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 84

def product_restrictions
  @product_restrictions
end

#reset_day_time_restrictionsTrueClass | FalseClass

True/False. If true, the Day/Time restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the day/time restrictions provided in the API.

Returns:

  • (TrueClass | FalseClass)


49
50
51
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 49

def reset_day_time_restrictions
  @reset_day_time_restrictions
end

#reset_location_restrictionsTrueClass | FalseClass

True/False. If true, the location restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the location restrictions provided in the API.

Returns:

  • (TrueClass | FalseClass)


63
64
65
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 63

def reset_location_restrictions
  @reset_location_restrictions
end

#reset_product_restrictionsTrueClass | FalseClass

True/False. If true, Default fuel/non-fuel sets configured at the purchase category level will be applied to the card. Else, the card will be applied with product restrictions provided in the API.

Returns:

  • (TrueClass | FalseClass)


56
57
58
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 56

def reset_product_restrictions
  @reset_product_restrictions
end

#reset_usage_restrictionsTrueClass | FalseClass

True/False. If true, the usage restrictions applied on the card in Gateway will be reset to Customer Card Type level max limits, if there are no customer level overrides available then OU card type max limits. Else, the card restrictions will be updated with the usage restrictions provided in the API. This property is not dependent on IsVelocityCeiling or SetDefaultOnVelocityUpdate flags.

Returns:

  • (TrueClass | FalseClass)


42
43
44
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 42

def reset_usage_restrictions
  @reset_usage_restrictions
end

#usage_restrictionsObject

True/False. If true, the location restrictions applied on the card will be deleted. Else, the card restrictions will be updated with the location restrictions provided in the API.

Returns:

  • (Object)


70
71
72
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 70

def usage_restrictions
  @usage_restrictions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 169

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
  card_id = hash.key?('CardId') ? hash['CardId'] : SKIP
  pan = hash.key?('PAN') ? hash['PAN'] : SKIP
  reset_usage_restrictions =
    hash.key?('ResetUsageRestrictions') ? hash['ResetUsageRestrictions'] : SKIP
  reset_day_time_restrictions =
    hash.key?('ResetDayTimeRestrictions') ? hash['ResetDayTimeRestrictions'] : SKIP
  reset_product_restrictions =
    hash.key?('ResetProductRestrictions') ? hash['ResetProductRestrictions'] : SKIP
  reset_location_restrictions =
    hash.key?('ResetLocationRestrictions') ? hash['ResetLocationRestrictions'] : SKIP
  usage_restrictions =
    hash.key?('UsageRestrictions') ? hash['UsageRestrictions'] : SKIP
  day_time_restrictions = DayTimeRestrictions.from_hash(hash['DayTimeRestrictions']) if
    hash['DayTimeRestrictions']
  product_restrictions =
    hash.key?('ProductRestrictions') ? hash['ProductRestrictions'] : SKIP
  location_restrictions = LocationRestriction.from_hash(hash['LocationRestrictions']) if
    hash['LocationRestrictions']

  # Create object from extracted values.
  RestrictionCardsList.new(,
                           card_id,
                           pan,
                           reset_usage_restrictions,
                           reset_day_time_restrictions,
                           reset_product_restrictions,
                           reset_location_restrictions,
                           usage_restrictions,
                           day_time_restrictions,
                           product_restrictions,
                           location_restrictions)
end

.namesObject

A mapping from model property names to API property names.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 94

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'AccountId'
  @_hash['card_id'] = 'CardId'
  @_hash['pan'] = 'PAN'
  @_hash['reset_usage_restrictions'] = 'ResetUsageRestrictions'
  @_hash['reset_day_time_restrictions'] = 'ResetDayTimeRestrictions'
  @_hash['reset_product_restrictions'] = 'ResetProductRestrictions'
  @_hash['reset_location_restrictions'] = 'ResetLocationRestrictions'
  @_hash['usage_restrictions'] = 'UsageRestrictions'
  @_hash['day_time_restrictions'] = 'DayTimeRestrictions'
  @_hash['product_restrictions'] = 'ProductRestrictions'
  @_hash['location_restrictions'] = 'LocationRestrictions'
  @_hash
end

.nullablesObject

An array for nullable fields



128
129
130
131
132
133
134
135
136
137
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 128

def self.nullables
  %w[
    account_id
    card_id
    pan
    reset_day_time_restrictions
    reset_product_restrictions
    reset_location_restrictions
  ]
end

.optionalsObject

An array for optional fields



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/shell_card_management_ap_is/models/restriction_cards_list.rb', line 111

def self.optionals
  %w[
    account_id
    card_id
    pan
    reset_usage_restrictions
    reset_day_time_restrictions
    reset_product_restrictions
    reset_location_restrictions
    usage_restrictions
    day_time_restrictions
    product_restrictions
    location_restrictions
  ]
end