Class: ShellDataReportingApIs::CustomerDetailResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/customer_detail_response.rb

Overview

CustomerDetailResponse 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_name = SKIP, account_number = SKIP, account_short_name = SKIP, account_trading_name = SKIP, allow_fleet_id_input = SKIP, band = SKIP, billing_address = SKIP, card_group_position = SKIP, correspondence_address = SKIP, delivery_addresses = SKIP, fleet_pin = SKIP, full_name = SKIP, invoice_customer_id = SKIP, invoice_customer_short_name = SKIP, is_invoice_point = SKIP, marketing_segmentation = SKIP, vat_number = SKIP, payer_id = SKIP, payer_name = SKIP, payer_number = SKIP, self_selected_pin = SKIP, status = SKIP, default_pin_advice_type = SKIP, pin_advice_types = SKIP, pin_change_allowed_by_cardholder = SKIP, pin_change_allowed_from_fleet_pin = SKIP) ⇒ CustomerDetailResponse

Returns a new instance of CustomerDetailResponse.



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 252

def initialize( = SKIP,  = SKIP,
                = SKIP,  = SKIP,
                = SKIP, allow_fleet_id_input = SKIP,
               band = SKIP, billing_address = SKIP,
               card_group_position = SKIP, correspondence_address = SKIP,
               delivery_addresses = SKIP, fleet_pin = SKIP,
               full_name = SKIP, invoice_customer_id = SKIP,
               invoice_customer_short_name = SKIP, is_invoice_point = SKIP,
               marketing_segmentation = SKIP, vat_number = SKIP,
               payer_id = SKIP, payer_name = SKIP, payer_number = SKIP,
               self_selected_pin = SKIP, status = SKIP,
               default_pin_advice_type = SKIP, pin_advice_types = SKIP,
               pin_change_allowed_by_cardholder = SKIP,
               pin_change_allowed_from_fleet_pin = SKIP)
  @account_id =  unless  == SKIP
  @account_name =  unless  == SKIP
  @account_number =  unless  == SKIP
  @account_short_name =  unless  == SKIP
  @account_trading_name =  unless  == SKIP
  @allow_fleet_id_input = allow_fleet_id_input unless allow_fleet_id_input == SKIP
  @band = band unless band == SKIP
  @billing_address = billing_address unless billing_address == SKIP
  @card_group_position = card_group_position unless card_group_position == SKIP
  @correspondence_address = correspondence_address unless correspondence_address == SKIP
  @delivery_addresses = delivery_addresses unless delivery_addresses == SKIP
  @fleet_pin = fleet_pin unless fleet_pin == SKIP
  @full_name = full_name unless full_name == SKIP
  @invoice_customer_id = invoice_customer_id unless invoice_customer_id == SKIP
  unless invoice_customer_short_name == SKIP
    @invoice_customer_short_name =
      invoice_customer_short_name
  end
  @is_invoice_point = is_invoice_point unless is_invoice_point == SKIP
  @marketing_segmentation = marketing_segmentation unless marketing_segmentation == SKIP
  @vat_number = vat_number unless vat_number == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_name = payer_name unless payer_name == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @self_selected_pin = self_selected_pin unless self_selected_pin == SKIP
  @status = status unless status == SKIP
  @default_pin_advice_type = default_pin_advice_type unless default_pin_advice_type == SKIP
  @pin_advice_types = pin_advice_types unless pin_advice_types == SKIP
  unless pin_change_allowed_by_cardholder == SKIP
    @pin_change_allowed_by_cardholder =
      pin_change_allowed_by_cardholder
  end
  unless pin_change_allowed_from_fleet_pin == SKIP
    @pin_change_allowed_from_fleet_pin =
      pin_change_allowed_from_fleet_pin
  end
end

Instance Attribute Details

#account_idInteger

Account Id of the selected account.

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 14

def 
  @account_id
end

#account_nameString

Account Name of the selected account.

Returns:

  • (String)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 18

def 
  @account_name
end

#account_numberString

Account Number of the selected account.

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 22

def 
  @account_number
end

#account_short_nameString

Short name of the customer.

Returns:

  • (String)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 26

def 
  @account_short_name
end

#account_trading_nameString

Trading name of the customer

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 30

def 
  @account_trading_name
end

#allow_fleet_id_inputTrueClass | FalseClass

True/False. When false, users should not be allowed to enable Fleet Id prompt option while ordering cards under this account.

Returns:

  • (TrueClass | FalseClass)


36
37
38
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 36

def allow_fleet_id_input
  @allow_fleet_id_input
end

#bandString

Band Id and Description of the Payer in Card Platform e.g. (Id – Description): 1-Platinum 2-Gold 3-Silver 4-Bronze

Returns:

  • (String)


45
46
47
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 45

def band
  @band
end

#billing_addressAddress

Band Id and Description of the Payer in Card Platform e.g. (Id – Description): 1-Platinum 2-Gold 3-Silver 4-Bronze

Returns:



54
55
56
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 54

def billing_address
  @billing_address
end

#card_group_positionString

Card group position at –• Payer – Payer level • Account – Account level

Returns:

  • (String)


60
61
62
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 60

def card_group_position
  @card_group_position
end

#correspondence_addressAddress

Card group position at –• Payer – Payer level • Account – Account level

Returns:



66
67
68
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 66

def correspondence_address
  @correspondence_address
end

#default_pin_advice_typeInteger

Default PIN AdviceType of the customer. Possible Values:

  1. Paper

  2. Email

  3. SMS

  4. None

Returns:

  • (Integer)


140
141
142
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 140

def default_pin_advice_type
  @default_pin_advice_type
end

#delivery_addressesArray[DeliveryAddresses]

Card group position at –• Payer – Payer level • Account – Account level

Returns:



72
73
74
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 72

def delivery_addresses
  @delivery_addresses
end

#fleet_pinTrueClass | FalseClass

Is Fleet Pin optional enabled for the selected account

Returns:

  • (TrueClass | FalseClass)


76
77
78
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 76

def fleet_pin
  @fleet_pin
end

#full_nameString

Full Name of the customer

Returns:

  • (String)


80
81
82
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 80

def full_name
  @full_name
end

#invoice_customer_idInteger

Customer Id of the Invoice Point of the account

Returns:

  • (Integer)


84
85
86
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 84

def invoice_customer_id
  @invoice_customer_id
end

#invoice_customer_short_nameString

Short Name of the Invoice Point of the account

Returns:

  • (String)


88
89
90
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 88

def invoice_customer_short_name
  @invoice_customer_short_name
end

#is_invoice_pointTrueClass | FalseClass

Whether the account is an invoice point.

Returns:

  • (TrueClass | FalseClass)


92
93
94
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 92

def is_invoice_point
  @is_invoice_point
end

#marketing_segmentationString

Marketing Segmentation id and description e.g. (Id – Description): 1-National CRT 2-International CRT & IKAs 3-Small Customers 4-National/International Fleet/IKA

Returns:

  • (String)


101
102
103
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 101

def marketing_segmentation
  @marketing_segmentation
end

#payer_idInteger

Payer Id of the selected account.

Returns:

  • (Integer)


109
110
111
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 109

def payer_id
  @payer_id
end

#payer_nameString

Payer Name of the selected account.

Returns:

  • (String)


113
114
115
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 113

def payer_name
  @payer_name
end

#payer_numberString

Payer Number of the selected account.

Returns:

  • (String)


117
118
119
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 117

def payer_number
  @payer_number
end

#pin_advice_typesArray[PINAdviceTypes]

Default PIN AdviceType of the customer. Possible Values:

  1. Paper

  2. Email

  3. SMS

  4. None

Returns:



149
150
151
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 149

def pin_advice_types
  @pin_advice_types
end

#pin_change_allowed_by_cardholderTrueClass | FalseClass

PIN change allowed for card holder or not.

Returns:

  • (TrueClass | FalseClass)


153
154
155
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 153

def pin_change_allowed_by_cardholder
  @pin_change_allowed_by_cardholder
end

#pin_change_allowed_from_fleet_pinTrueClass | FalseClass

PIN change allowed from fleetpin or not.

Returns:

  • (TrueClass | FalseClass)


157
158
159
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 157

def pin_change_allowed_from_fleet_pin
  @pin_change_allowed_from_fleet_pin
end

#self_selected_pinTrueClass | FalseClass

Is Self-selected Pin enabled for the account

Returns:

  • (TrueClass | FalseClass)


121
122
123
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 121

def self_selected_pin
  @self_selected_pin
end

#statusString

Payer current status id and description e.g. (Id – Description): 1-Active 2-Requested from UTA 3-Awaiting embossing 4-Manufactured 5-Awaiting despatch

Returns:

  • (String)


131
132
133
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 131

def status
  @status
end

#vat_numberString

VAT Registration Number of Customer

Returns:

  • (String)


105
106
107
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 105

def vat_number
  @vat_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 305

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountName') ? hash['AccountName'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
   =
    hash.key?('AccountShortName') ? hash['AccountShortName'] : SKIP
   =
    hash.key?('AccountTradingName') ? hash['AccountTradingName'] : SKIP
  allow_fleet_id_input =
    hash.key?('AllowFleetIdInput') ? hash['AllowFleetIdInput'] : SKIP
  band = hash.key?('Band') ? hash['Band'] : SKIP
  billing_address = Address.from_hash(hash['BillingAddress']) if hash['BillingAddress']
  card_group_position =
    hash.key?('CardGroupPosition') ? hash['CardGroupPosition'] : SKIP
  correspondence_address = Address.from_hash(hash['CorrespondenceAddress']) if
    hash['CorrespondenceAddress']
  # Parameter is an array, so we need to iterate through it
  delivery_addresses = nil
  unless hash['DeliveryAddresses'].nil?
    delivery_addresses = []
    hash['DeliveryAddresses'].each do |structure|
      delivery_addresses << (DeliveryAddresses.from_hash(structure) if structure)
    end
  end

  delivery_addresses = SKIP unless hash.key?('DeliveryAddresses')
  fleet_pin = hash.key?('FleetPin') ? hash['FleetPin'] : SKIP
  full_name = hash.key?('FullName') ? hash['FullName'] : SKIP
  invoice_customer_id =
    hash.key?('InvoiceCustomerId') ? hash['InvoiceCustomerId'] : SKIP
  invoice_customer_short_name =
    hash.key?('InvoiceCustomerShortName') ? hash['InvoiceCustomerShortName'] : SKIP
  is_invoice_point =
    hash.key?('IsInvoicePoint') ? hash['IsInvoicePoint'] : SKIP
  marketing_segmentation =
    hash.key?('MarketingSegmentation') ? hash['MarketingSegmentation'] : SKIP
  vat_number = hash.key?('VATNumber') ? hash['VATNumber'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_name = hash.key?('PayerName') ? hash['PayerName'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
  self_selected_pin =
    hash.key?('SelfSelectedPin') ? hash['SelfSelectedPin'] : SKIP
  status = hash.key?('Status') ? hash['Status'] : SKIP
  default_pin_advice_type =
    hash.key?('DefaultPINAdviceType') ? hash['DefaultPINAdviceType'] : SKIP
  # Parameter is an array, so we need to iterate through it
  pin_advice_types = nil
  unless hash['PINAdviceTypes'].nil?
    pin_advice_types = []
    hash['PINAdviceTypes'].each do |structure|
      pin_advice_types << (PINAdviceTypes.from_hash(structure) if structure)
    end
  end

  pin_advice_types = SKIP unless hash.key?('PINAdviceTypes')
  pin_change_allowed_by_cardholder =
    hash.key?('PINChangeAllowedByCardholder') ? hash['PINChangeAllowedByCardholder'] : SKIP
  pin_change_allowed_from_fleet_pin =
    hash.key?('PINChangeAllowedFromFleetPIN') ? hash['PINChangeAllowedFromFleetPIN'] : SKIP

  # Create object from extracted values.
  CustomerDetailResponse.new(,
                             ,
                             ,
                             ,
                             ,
                             allow_fleet_id_input,
                             band,
                             billing_address,
                             card_group_position,
                             correspondence_address,
                             delivery_addresses,
                             fleet_pin,
                             full_name,
                             invoice_customer_id,
                             invoice_customer_short_name,
                             is_invoice_point,
                             marketing_segmentation,
                             vat_number,
                             payer_id,
                             payer_name,
                             payer_number,
                             self_selected_pin,
                             status,
                             default_pin_advice_type,
                             pin_advice_types,
                             pin_change_allowed_by_cardholder,
                             pin_change_allowed_from_fleet_pin)
end

.namesObject

A mapping from model property names to API property names.



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 160

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'AccountId'
  @_hash['account_name'] = 'AccountName'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['account_short_name'] = 'AccountShortName'
  @_hash['account_trading_name'] = 'AccountTradingName'
  @_hash['allow_fleet_id_input'] = 'AllowFleetIdInput'
  @_hash['band'] = 'Band'
  @_hash['billing_address'] = 'BillingAddress'
  @_hash['card_group_position'] = 'CardGroupPosition'
  @_hash['correspondence_address'] = 'CorrespondenceAddress'
  @_hash['delivery_addresses'] = 'DeliveryAddresses'
  @_hash['fleet_pin'] = 'FleetPin'
  @_hash['full_name'] = 'FullName'
  @_hash['invoice_customer_id'] = 'InvoiceCustomerId'
  @_hash['invoice_customer_short_name'] = 'InvoiceCustomerShortName'
  @_hash['is_invoice_point'] = 'IsInvoicePoint'
  @_hash['marketing_segmentation'] = 'MarketingSegmentation'
  @_hash['vat_number'] = 'VATNumber'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_name'] = 'PayerName'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['self_selected_pin'] = 'SelfSelectedPin'
  @_hash['status'] = 'Status'
  @_hash['default_pin_advice_type'] = 'DefaultPINAdviceType'
  @_hash['pin_advice_types'] = 'PINAdviceTypes'
  @_hash['pin_change_allowed_by_cardholder'] =
    'PINChangeAllowedByCardholder'
  @_hash['pin_change_allowed_from_fleet_pin'] =
    'PINChangeAllowedFromFleetPIN'
  @_hash
end

.nullablesObject

An array for nullable fields



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 228

def self.nullables
  %w[
    account_id
    account_name
    account_number
    account_short_name
    account_trading_name
    band
    card_group_position
    full_name
    invoice_customer_id
    invoice_customer_short_name
    is_invoice_point
    marketing_segmentation
    vat_number
    payer_id
    payer_name
    payer_number
    self_selected_pin
    status
    default_pin_advice_type
  ]
end

.optionalsObject

An array for optional fields



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 195

def self.optionals
  %w[
    account_id
    account_name
    account_number
    account_short_name
    account_trading_name
    allow_fleet_id_input
    band
    billing_address
    card_group_position
    correspondence_address
    delivery_addresses
    fleet_pin
    full_name
    invoice_customer_id
    invoice_customer_short_name
    is_invoice_point
    marketing_segmentation
    vat_number
    payer_id
    payer_name
    payer_number
    self_selected_pin
    status
    default_pin_advice_type
    pin_advice_types
    pin_change_allowed_by_cardholder
    pin_change_allowed_from_fleet_pin
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 418

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account_name: #{@account_name.inspect},"\
  " account_number: #{@account_number.inspect}, account_short_name:"\
  " #{@account_short_name.inspect}, account_trading_name: #{@account_trading_name.inspect},"\
  " allow_fleet_id_input: #{@allow_fleet_id_input.inspect}, band: #{@band.inspect},"\
  " billing_address: #{@billing_address.inspect}, card_group_position:"\
  " #{@card_group_position.inspect}, correspondence_address:"\
  " #{@correspondence_address.inspect}, delivery_addresses: #{@delivery_addresses.inspect},"\
  " fleet_pin: #{@fleet_pin.inspect}, full_name: #{@full_name.inspect}, invoice_customer_id:"\
  " #{@invoice_customer_id.inspect}, invoice_customer_short_name:"\
  " #{@invoice_customer_short_name.inspect}, is_invoice_point: #{@is_invoice_point.inspect},"\
  " marketing_segmentation: #{@marketing_segmentation.inspect}, vat_number:"\
  " #{@vat_number.inspect}, payer_id: #{@payer_id.inspect}, payer_name:"\
  " #{@payer_name.inspect}, payer_number: #{@payer_number.inspect}, self_selected_pin:"\
  " #{@self_selected_pin.inspect}, status: #{@status.inspect}, default_pin_advice_type:"\
  " #{@default_pin_advice_type.inspect}, pin_advice_types: #{@pin_advice_types.inspect},"\
  " pin_change_allowed_by_cardholder: #{@pin_change_allowed_by_cardholder.inspect},"\
  " pin_change_allowed_from_fleet_pin: #{@pin_change_allowed_from_fleet_pin.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/shell_data_reporting_ap_is/models/customer_detail_response.rb', line 399

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account_name: #{@account_name}, account_number:"\
  " #{@account_number}, account_short_name: #{@account_short_name}, account_trading_name:"\
  " #{@account_trading_name}, allow_fleet_id_input: #{@allow_fleet_id_input}, band: #{@band},"\
  " billing_address: #{@billing_address}, card_group_position: #{@card_group_position},"\
  " correspondence_address: #{@correspondence_address}, delivery_addresses:"\
  " #{@delivery_addresses}, fleet_pin: #{@fleet_pin}, full_name: #{@full_name},"\
  " invoice_customer_id: #{@invoice_customer_id}, invoice_customer_short_name:"\
  " #{@invoice_customer_short_name}, is_invoice_point: #{@is_invoice_point},"\
  " marketing_segmentation: #{@marketing_segmentation}, vat_number: #{@vat_number}, payer_id:"\
  " #{@payer_id}, payer_name: #{@payer_name}, payer_number: #{@payer_number},"\
  " self_selected_pin: #{@self_selected_pin}, status: #{@status}, default_pin_advice_type:"\
  " #{@default_pin_advice_type}, pin_advice_types: #{@pin_advice_types},"\
  " pin_change_allowed_by_cardholder: #{@pin_change_allowed_by_cardholder},"\
  " pin_change_allowed_from_fleet_pin: #{@pin_change_allowed_from_fleet_pin}>"
end