Class: ShellCardManagementApIs::RestrictionController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/controllers/restriction_controller.rb

Overview

RestrictionController

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_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from ShellCardManagementApIs::BaseController

Instance Method Details

#apply_restriction(request_id, body: nil) ⇒ CardRestrictionRes

The Card Limit and Restriction API is REST-based and employs Basic and ApiKey authentication. The API endpoints accept JSON-encoded request bodies, return JSON-encoded responses and use standard HTTP response codes. All resources are located in the Shell Card Platform. The Shell Card Platform is the overall platform that encompasses all the internal Shell systems used to manage resources. The internal workings of the platform are not important when interacting with the API. However, it is worth noting that the platform uses to communicate with various backend systems and some API calls are processed asynchronously. All endpoints use the ‘POST` verb for retrieving, updating, creating and deleting resources in the Shell Card Platform. The endpoints that retrieve resources from the Shell Card Platform allow flexible search parameters in the API request body. **Important Note** - This operation allows setting or updating the restrictions on existing cards. (For up to 3 cards in a single call). All restrictions of the cards are submitted and executed after successful below condition. • The card exists. • Day time restriction cannot be set to restrict the use of a card on all days of the week i.e., the values for all the days in the restriction cannot be set to false. • Either of the usage, daytime, location or product restriction ‘Reset’is set to ‘True’ or applied on the card. • All the limits in the usage restriction profile for a card is not set to ‘0’/null. • If IsVelocityCeiling is ‘true’, API will validate below condition: Usage restrictions for a card are lower than Customer Card Type level limits, if there are no customer level overrides available then lower than OU card type limits. • In usage restrictions, the limits per transaction should be less than or equal to Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly, Monthly should be less than or equal to Yearly (Annually). Exception being null/blank will be skipped. i.e., Daily value should be less than equal to Monthly value if Weekly value is null/blank. Lifetime limit is not considered for usage restrictions limits validation. • Apply the card type limit to Gateway when a value is NULL in the input. However, if the card type limit is NULL for the same field, then no limit will be applied in Gateway. • If ‘SetDefaultOnVelocityUpdate’ is ‘true’ then the operation will apply customer cardtype or OU level velocity limits on existing cards when restrictions are modified without providing custom values for all fields. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CardRestrictionReq) (defaults to: nil)

    Optional parameter: Card Restriction

Returns:



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 109

def apply_restriction(request_id,
                      body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/update',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CardRestrictionRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#bundle_details(request_id, body: nil) ⇒ BundleDetails

This API allows to get the details of a specific card bundle. It returns the bundle basic details along with the cards in the bundle and restrictions applied on them. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (BudleDetailsReq) (defaults to: nil)

    Optional parameter: Bundle Details Request

Returns:



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 540

def bundle_details(request_id,
                   body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/bundledetails',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(BundleDetails.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#create_bundle(request_id, body: nil) ⇒ CreateBundleRes

This API enables clients to create a new card bundle and apply restrictions. #### Supported operations

* Create bundle and include mandatory -
  * Usage, day/time, product and location restrictions
  * List of cards to add to bundle
* Create bundle and include optional identifier of bundle in external

system #### Validation rules

The following are the key validation rules with the associated error

codes for failed validation-

* `7012` - At least one card must be added to the bundle
*  `7011` - The total number of cards passed in the input must be 500 or

less.

*  `7014` - All the cards passed in the input are part of the selected

account.

*  `7013` - At least one restriction must be applied to the bundle i.e.

either of usage, day/time, location or product restriction.

*  `7005` - Day time restriction cannot be set to restrict the use of a

card on all days of the week.

*  `7000` - Usage restriction of the bundle is not open ended i.e. all

the limits within the usage restriction must not be set to 0/null.

*  `7004` - In the usage restrictions, the limits per transaction should

be less than or equal to Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. Exception being 0/blank will be skipped, i.e. Daily value should be less than equal to Monthly value if Weekly value is 0/blank.

*  `0007` - Error returned if request parameters fail validation e.g.

mandatory check. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (CreateBundleRequest) (defaults to: nil)

    Optional parameter: CreateBundle request

Returns:



184
185
186
187
188
189
190
191
192
193
194
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
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 184

def create_bundle(request_id,
                  body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/createbundle',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CreateBundleRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#delete_bundle(request_id, body: nil) ⇒ DeleteBundleResponse

This API enables clients to delete an existing card bundle in the Shell Card Platform. Once the card bundle is deleted the usage and product restrictions of the cards that were present in the bundle will be reset based on the request. #### Supported operations

* Delete card bundle by bundle Id

#### Validation rules

The following are the key validation rules with the associated error

codes for failed validation-

*  `7019` - The given card bundle is not available in the Shell Card

Platform.

*  `0007` - Error returned if request parameters fail validation e.g.

mandatory check. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (DeleteBundleRequest) (defaults to: nil)

    Optional parameter: Update Bundle

Returns:



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
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 326

def delete_bundle(request_id,
                  body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/deletebundle',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DeleteBundleResponse.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#restriction_account(request_id, body: nil) ⇒ AccountRestrictionRes

This API allows setting or updating the usage restrictions of an existing account. Then validation rules applied for this API. • The account exists. • Day time restriction cannot be set to restrict the use of a card, under the account, on all days of the week. • Either of the usage, daytime or location is either marked for reset or new restriction values provided for the account. • In usage restrictions, the limits per transaction should be less than or equal to Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. Exception being 0/blank will be skipped, i.e., Daily value should be less than equal to Monthly value if Weekly value is 0/blank. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. Restriction request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (AccountRestrictionRequest) (defaults to: nil)

    Optional parameter: Account

Returns:



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
477
478
479
480
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 442

def (request_id,
                        body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/account',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AccountRestrictionRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#search_account_limit(request_id, body: nil) ⇒ SearchAccountLimitRes

This API will allow user to get account level limits for the given account. It returns the velocity limits if its overridden at the account else the values will be null/empty. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. Limit RequestBody

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (SearchAccountLimitRequest) (defaults to: nil)

    Optional parameter: Search Account

Returns:



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 491

def (request_id,
                         body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/searchaccountlimit',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SearchAccountLimitRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#search_card_restriction(request_id, body: nil) ⇒ SearchCardRestrictionRes1

This API will allows querying card details including the day/time and product restrictions. #### Supported operations

* Search by list of cards or bundle
* Include card bundle details (optional)

to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. search card request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (SearchCardRestrictionReq1) (defaults to: nil)

    Optional parameter: Restriction

Returns:



20
21
22
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
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 20

def search_card_restriction(request_id,
                            body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/search',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SearchCardRestrictionRes1.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#summary_of_bundles(request_id, body: nil) ⇒ SummaryofbundleRes

This API allows clients to get a summary of card bundles associated with Payer/Account. This API will return the basic bundle details including card and restriction details. Optionally the API will also include a count of cards that are not associated with the bundle but returned by the search criteria. Note - to include count of cards of an account that are not associated with any bundles, in the input parameter SearchCardBundles either pass all the bundles of the account in the list or pass only account with bundle id left blank/null. #### Supported operations

* Get summary of bundles by list of bundle Ids

to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. Bundle request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (SummaryofbundlerRequest) (defaults to: nil)

    Optional parameter: Summary of

Returns:



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 383

def summary_of_bundles(request_id,
                       body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/summaryofbundles',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SummaryofbundleRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end

#update_bundle(request_id, body: nil) ⇒ UpdateBundleRes

This API enables clients to update an existing card bundle and its associated restrictions. #### Supported operations

* Add new cards to an existing bundle
* Remove cards from existing bundle
* Update restrictions applied to existing bundle
The following are the key validation rules with the associated error

codes for failed validation- #### Validation rules

*  `9007` - The cards must exist in the cards platform for adding or

removing cards.

*  `7014` - All the cards passed in the input are part of the selected

account.

*  `7018` - All the cards passed in the input are part of the selected

bundle.

*  `7011` - The total number of cards passed in the input must be 500 or

less.

*  `7012` - The action to remove cards should not result in removing all

the cards from the bundle.

*  `7016` - At least one restriction must be modified for 

request action.

*  `7013` - All restrictions cannot be marked for 

“Update†request action.

*  `7005` - Day time restriction cannot be set to restrict the use of a

card on all days of the week. This validation is applicable for Update request action.

*  `7000` - Usage restriction of the bundle is not open ended i.e., all

the limits within the usage restriction must not be set to 0/null. This validation is applicable for Update request action.

*  `7004` - In the usage restrictions, the limits per transaction should

be less than or equal to Daily, Daily should be less than or equal to Weekly, Weekly should be less than or equal to Monthly. Exception being 0/blank will be skipped, i.e., Daily value should be less than equal to Monthly value if Weekly value is 0/blank. This validation is applicable for Update request action.

*  `0007` - Error returned if request parameters fail validation e.g. at

least one card must be provided in the input. to RFC 4122 standards) for requests and responses. This will be played back in the response from the request. request body

Parameters:

  • request_id (String)

    Required parameter: Mandatory UUID (according

  • body (UpdateBundleRequest) (defaults to: nil)

    Optional parameter: Update Bundle

Returns:



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
303
304
305
# File 'lib/shell_card_management_ap_is/controllers/restriction_controller.rb', line 267

def update_bundle(request_id,
                  body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/card-restrictions/v1/updatebundle',
                                 Server::SHELL)
               .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('BearerToken')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateBundleRes.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 error (e.g.,'\
                              ' malformed request syntax, invalid request message framing, or'\
                              ' deceptive request routing).\n",
                             ErrorObjectErrorException)
                .local_error('401',
                             "The request has not been applied because it lacks valid '\
                              ' authentication credentials for the target resource.\n",
                             ErrorObjectErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorObjectErrorException)
                .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.\n",
                             ErrorObjectErrorException)
                .local_error('500',
                             "The server encountered an unexpected condition that  prevented'\
                              ' it from fulfilling the request.\n",
                             ErrorObjectErrorException))
    .execute
end