Class: ShellDataReportingApIs::CustomerController

Inherits:
BaseController show all
Defined in:
lib/shell_data_reporting_ap_is/controllers/customer_controller.rb

Overview

CustomerController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from ShellDataReportingApIs::BaseController

Instance Method Details

#accounts(apikey, request_id, body: nil) ⇒ AccountResponse

This API allows querying the customer account details from the Shell Cards Platform. It provides a flexible search criterion and supports paging“. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request.

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (AccountRequest) (defaults to: nil)

    Optional parameter: Example:

Returns:



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
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 252

def accounts(apikey,
             request_id,
             body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/customer/accounts',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AccountResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1CustomerAccounts400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1CustomerAccounts401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1CustomerAccounts403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1CustomerAccounts404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1CustomerAccounts500ErrorException))
    .execute
end

#audit_report(apikey, request_id, body: nil) ⇒ AuditResponse

This operation allows users to fetch audit data of account or card operations performed by users of a given customer The audit data includes details of below API operations

  • Order Card

  • Create Card Group

  • PIN reminder

  • Move Cards

  • Update Card Status

  • Update Card Group

  • Auto renew

  • Bulk card order

  • Bulk card block

  • Bulk Card Order (Multi Account)

  • BCOSummary

  • BCOMultiAccountSummary

  • BCBSummary

  • Mobile Payment

  • Registration

  • Fund Transfer (Scheduled & Realtime)

  • Delivery Address Update.

specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request.

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (AuditRequest) (defaults to: nil)

    Optional parameter: request body

Returns:



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 435

def audit_report(apikey,
                 request_id,
                 body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/customer/auditreport',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AuditResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1CustomerAuditreport400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1CustomerAuditreport401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1CustomerAuditreport403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1CustomerAuditreport404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1CustomerAuditreport500ErrorException))
    .execute
end

#card_groups(apikey, request_id, body: nil) ⇒ CardGroupResponse

This operation allows querying the card group details . It provides flexible search criteria and supports paging.\ When the card group type is configured as ‘Vertical’ in cards platform, this operation will return all card groups from the given account or if no account is passed in the input, then will return card groups from all the accounts under the payer. When the card group type is configured as ‘Horizontal’ in cards platform, this API will return all card groups configured directly under the payer. Accounts with cancelled status will not be considered for cardgroups search for the configured (E.g., SFH) set of client apps. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request.

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CardGroupRequest) (defaults to: nil)

    Optional parameter: Request Body

Returns:



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
397
398
399
400
401
402
403
404
405
406
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 365

def card_groups(apikey,
                request_id,
                body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/customer/cardgroups',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CardGroupResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1CustomerCardgroups400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1CustomerCardgroups401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1CustomerCardgroups403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1CustomerCardgroups404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1CustomerCardgroups500ErrorException))
    .execute
end

#card_type(apikey, request_id, body: nil) ⇒ CardTypeResponse

This operation allows querying card types that are associated to the given account and are allowed to be shown to users. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. Body

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CardTypeRequest) (defaults to: nil)

    Optional parameter: Get CardType Request

Returns:



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
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 305

def card_type(apikey,
              request_id,
              body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v2/customer/cardtype',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CardTypeResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV2CustomerCardtype400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV2CustomerCardtype401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV2CustomerCardtype403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV2CustomerCardtype404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV2CustomerCardtype500ErrorException))
    .execute
end

#customer(apikey, request_id, body: nil) ⇒ CustomerDetailResponse

This API allows querying the card delivery addresses of a given account from the Shell Cards Platform. Only active delivery addresses will be returned. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. request body

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CustomerDetailRequest) (defaults to: nil)

    Optional parameter: Customerdetails

Returns:



137
138
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
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 137

def customer(apikey,
             request_id,
             body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/customer/customer',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CustomerDetailResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1CustomerCustomer400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1CustomerCustomer401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1CustomerCustomer403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1CustomerCustomer404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1CustomerCustomer500ErrorException))
    .execute
end

#customer_price_list(apikey, request_id, body: nil) ⇒ CustomerPriceListResponse

  • This operation fetches the International and National Price List and

discount values set on pump prices & List Prices

  • It allows searching price list and discount values set on pump prices

that are applicable for a given customer Note: Accounts with cancelled status will not be considered for this operation for the configured

  • When the search is based on customer specific price list then the

customer price list is returned based on the associated pricing customer.

  • The discount values set on pump prices, which are returned by the

operation are always customer specific values based on the customer associated price rules. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. request body

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CustomerPriceListRequest) (defaults to: nil)

    Optional parameter: Customerdetails

Returns:



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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 199

def customer_price_list(apikey,
                        request_id,
                        body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v2/customer/pricelist',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CustomerPriceListResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV2CustomerPricelist400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV2CustomerPricelist401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV2CustomerPricelist403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV2CustomerPricelist404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV2CustomerPricelist500ErrorException))
    .execute
end

#loggedin_user(apikey, request_id, body: nil) ⇒ LoggedInUserResponse

This API allows querying the user data of the logged in user.</br> This API will return the user access details such as payers and/or accounts. </br> This API will also validate that logged in user has access to the requested API, on failure it will return HasAPIAccess flag as false in response.</br> specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. Logged in user request body

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (FleetmanagementV1UserLoggedinuserRequest) (defaults to: nil)

    Optional parameter:

Returns:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 23

def loggedin_user(apikey,
                  request_id,
                  body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/user/loggedinuser',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(LoggedInUserResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1UserLoggedinuser400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1UserLoggedinuser401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1UserLoggedinuser403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1UserLoggedinuser404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1UserLoggedinuser500ErrorException))
    .execute
end

#payers(apikey, request_id, body: nil) ⇒ PayerResponse

This API allows querying the payer accounts details from the Shell Cards Platform. It provides flexible search criteria for searching payer information and supports paging. Paging is applicable only when all the payers passed in the input are from the same ColCo. However, paging will be ignored and the API will return all the matching data by merging the data queried from each ColCo when payers passed in the input are from multiple ColCos. specific environment which needs to be passed by the client. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. body

Parameters:

  • apikey (String)

    Required parameter: This is the API key of the

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (PayerRequest) (defaults to: nil)

    Optional parameter: Serach payers request

Returns:



83
84
85
86
87
88
89
90
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
123
124
# File 'lib/shell_data_reporting_ap_is/controllers/customer_controller.rb', line 83

def payers(apikey,
           request_id,
           body: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/fleetmanagement/v1/customer/payers',
                                 Server::SHELL)
               .header_param(new_parameter(apikey, key: 'apikey'))
               .header_param(new_parameter(request_id, key: 'RequestId'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('BasicAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(PayerResponse.method(:from_hash))
                .local_error('400',
                             "The server cannot or will not process the request  due to'\
                              ' something that is perceived to be a client\r\n error (e.g.,'\
                              ' malformed request syntax, invalid \r\n request message'\
                              ' framing, or deceptive request routing).",
                             FleetmanagementV1CustomerPayers400ErrorException)
                .local_error('401',
                             'The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.',
                             FleetmanagementV1CustomerPayers401ErrorException)
                .local_error('403',
                             'The server understood the request but refuses to authorize it'\
                              '.',
                             FleetmanagementV1CustomerPayers403ErrorException)
                .local_error('404',
                             'The origin server did not find a current representation  for'\
                              ' the target resource or is not willing to disclose  that one'\
                              ' exists.',
                             FleetmanagementV1CustomerPayers404ErrorException)
                .local_error('500',
                             'The server encountered an unexpected condition the prevented'\
                              ' it from fulfilling the request.',
                             FleetmanagementV1CustomerPayers500ErrorException))
    .execute
end