card-management-sdk
Version:
The Shell Card Management API is REST-based and employs OAUTH 2.0,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 S
547 lines • 35.3 kB
JavaScript
"use strict";
/**
* Shell Card Management APIsLib
*
* This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
exports.__esModule = true;
exports.RestrictionController = void 0;
var tslib_1 = require("tslib");
var accountRestrictionRequest_1 = require("../models/accountRestrictionRequest");
var accountRestrictionResponse_1 = require("../models/accountRestrictionResponse");
var budleDetailsRequest_1 = require("../models/budleDetailsRequest");
var bundleDetailsResponse_1 = require("../models/bundleDetailsResponse");
var cardRestrictionReq_1 = require("../models/cardRestrictionReq");
var cardRestrictionResponse_1 = require("../models/cardRestrictionResponse");
var createBundleRequest_1 = require("../models/createBundleRequest");
var createBundleResponse_1 = require("../models/createBundleResponse");
var deleteBundleRequest_1 = require("../models/deleteBundleRequest");
var deleteBundleResponse_1 = require("../models/deleteBundleResponse");
var searchAccountLimitRequest_1 = require("../models/searchAccountLimitRequest");
var searchAccountLimitResponse_1 = require("../models/searchAccountLimitResponse");
var searchCardRestrictionReq_1 = require("../models/searchCardRestrictionReq");
var searchCardRestrictionRes_1 = require("../models/searchCardRestrictionRes");
var summaryofbundleResponse_1 = require("../models/summaryofbundleResponse");
var summaryofbundlerRequest_1 = require("../models/summaryofbundlerRequest");
var updateBundleRequest_1 = require("../models/updateBundleRequest");
var updateBundleResponse_1 = require("../models/updateBundleResponse");
var schema_1 = require("../schema");
var baseController_1 = require("./baseController");
var core_1 = require("@apimatic/core");
var fleetmanagementV2RestrictionSearchcard401Error_1 = require("../errors/fleetmanagementV2RestrictionSearchcard401Error");
var fleetmanagementV2RestrictionSearchcard500Error_1 = require("../errors/fleetmanagementV2RestrictionSearchcard500Error");
var RestrictionController = /** @class */ (function (_super) {
tslib_1.__extends(RestrictionController, _super);
function RestrictionController() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* 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)
*
*
*
* @param apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body Restriction search card request body
* @return Response from the API call
*/
RestrictionController.prototype.searchCardRestriction = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v2/restriction/searchcard');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(searchCardRestrictionReq_1.searchCardRestrictionReqSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, fleetmanagementV2RestrictionSearchcard401Error_1.FleetmanagementV2RestrictionSearchcard401Error, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, fleetmanagementV2RestrictionSearchcard500Error_1.FleetmanagementV2RestrictionSearchcard500Error, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(searchCardRestrictionRes_1.searchCardRestrictionResSchema, requestOptions)];
});
});
};
/**
* 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 a microservice architecture 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.
*
*
*
* @param apikey This is the API key of the specific environment which needs to
* be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests
* and responses. This will be played back in the response from the
* request.
* @param body Card Restriction request body
* @return Response from the API call
*/
RestrictionController.prototype.applyRestriction = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v2/restriction/card');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(cardRestrictionReq_1.cardRestrictionReqSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(cardRestrictionResponse_1.cardRestrictionResponseSchema, requestOptions)];
});
});
};
/**
* 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.
*
* @param apikey This is the API key of the specific environment which needs to
* be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests
* and responses. This will be played back in the response from the
* request.
* @param body CreateBundle request body
* @return Response from the API call
*/
RestrictionController.prototype.createBundle = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/createbundle');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(createBundleRequest_1.createBundleRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(createBundleResponse_1.createBundleResponseSchema, requestOptions)];
});
});
};
/**
* 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 “Update†request action.
*
* * `7013` - All restrictions cannot be marked for “Reset†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.
*
* @param apikey This is the API key of the specific environment which needs to
* be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests
* and responses. This will be played back in the response from the
* request.
* @param body Update Bundle request body
* @return Response from the API call
*/
RestrictionController.prototype.updateBundle = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/updatebundle');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(updateBundleRequest_1.updateBundleRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(updateBundleResponse_1.updateBundleResponseSchema, requestOptions)];
});
});
};
/**
* 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.
*
* @param apikey This is the API key of the specific environment which needs to
* be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests
* and responses. This will be played back in the response from the
* request.
* @param body Update Bundle request body
* @return Response from the API call
*/
RestrictionController.prototype.deleteBundle = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/deletebundle');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(deleteBundleRequest_1.deleteBundleRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(deleteBundleResponse_1.deleteBundleResponseSchema, requestOptions)];
});
});
};
/**
* 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
*
* @param apikey This is the API key of the specific environment which needs
* to be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body Summary of Bundle request body
* @return Response from the API call
*/
RestrictionController.prototype.summaryOfBundles = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/summaryofbundles');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(summaryofbundlerRequest_1.summaryofbundlerRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(summaryofbundleResponse_1.summaryofbundleResponseSchema, requestOptions)];
});
});
};
/**
* 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.
*
*
*
* @param apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body Account Restriction request body
* @return Response from the API call
*/
RestrictionController.prototype.restrictionAccount = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/account');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(accountRestrictionRequest_1.accountRestrictionRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ bearerToken: true }]);
return [2 /*return*/, req.callAsJson(accountRestrictionResponse_1.accountRestrictionResponseSchema, requestOptions)];
});
});
};
/**
* 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.
*
* @param apikey This is the API key of the specific environment which
* needs to be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for
* requests and responses. This will be played back in the
* response from the request.
* @param body Search Account Limit RequestBody
* @return Response from the API call
*/
RestrictionController.prototype.searchAccountLimit = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/searchaccountlimit');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(searchAccountLimitRequest_1.searchAccountLimitRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(searchAccountLimitResponse_1.searchAccountLimitResponseSchema, requestOptions)];
});
});
};
/**
* 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.
*
* @param apikey This is the API key of the specific environment which needs to
* be passed by the client.
* @param requestId Mandatory UUID (according to RFC 4122 standards) for requests
* and responses. This will be played back in the response from the
* request.
* @param body Bundle Details Request body
* @return Response from the API call
*/
RestrictionController.prototype.bundleDetails = function (apikey, requestId, body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/fleetmanagement/v1/restriction/bundledetails');
mapped = req.prepareArgs({
apikey: [apikey, (0, schema_1.string)()],
requestId: [requestId, (0, schema_1.string)()],
body: [body, (0, schema_1.optional)(budleDetailsRequest_1.budleDetailsRequestSchema)]
});
req.header('apikey', mapped.apikey);
req.header('RequestId', mapped.requestId);
req.header('Content-Type', 'application/json');
req.json(mapped.body);
req.throwOn(400, core_1.ApiError, '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).');
req.throwOn(401, core_1.ApiError, 'The request has not been applied because it lacks valid authentication credentials for the target resource.');
req.throwOn(403, core_1.ApiError, 'The server understood the request but refuses to authorize it.');
req.throwOn(404, core_1.ApiError, 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.');
req.throwOn(500, core_1.ApiError, 'The server encountered an unexpected condition the prevented it from fulfilling the request.');
req.authenticate([{ basicAuth: true }]);
return [2 /*return*/, req.callAsJson(bundleDetailsResponse_1.bundleDetailsResponseSchema, requestOptions)];
});
});
};
return RestrictionController;
}(baseController_1.BaseController));
exports.RestrictionController = RestrictionController;
//# sourceMappingURL=restrictionController.js.map