UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

91 lines (90 loc) 4.56 kB
"use strict"; /* globals module */ /** * @module commercePaymentMethodBatchClient * @description Commerce Payment Method Batch Client provides an easy way to consume Commerce REST API end-points. In order to obtain a needed routes `commercePaymentMethodBatchClient` uses `commercePaymentMethodBatchRoute`. */ Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var inversify_1 = require("inversify"); ; var httpApi_1 = require("../../../../httpApi"); var __1 = require("../../"); var CommerceLookupsPaymentMethodBatchClient = /** @class */ (function () { function CommerceLookupsPaymentMethodBatchClient(commerceLookupsPaymentMethodBatchRoute, apiClient) { this.commerceLookupsPaymentMethodBatchRoute = commerceLookupsPaymentMethodBatchRoute; this.apiClient = apiClient; } Object.defineProperty(CommerceLookupsPaymentMethodBatchClient.prototype, "routeDefinition", { get: function () { return this.commerceLookupsPaymentMethodBatchRoute; }, enumerable: true, configurable: true }); /** * Returns a promise that is resolved once the create commerce action has been performed; this action creates a new commerce resources. * @method * @example commerceLookupsPaymentMethodBatchClient.create([{ name : '<name>', abrv: '<abbreviation>', description: '<description>', published: '<published>' }]) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsPaymentMethodBatchClient.prototype.create = function (data) { return this.apiClient.post(this.routeDefinition.create(), this.routeDefinition.createParams(data)); }; /** * Returns a promise that is resolved once the update commerce action has been performed; this action updates specified commerce resources. * @method * @example commerceLookupsPaymentMethodBatchClient.update(commercePaymentMethods) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsPaymentMethodBatchClient.prototype.update = function (data) { return this.apiClient.put(this.routeDefinition.update(), this.routeDefinition.updateParams(data)); }; /** * Returns a promise that is resolved once the remove commerce action has been performed. This action will remove commerce resources from the system if successfully completed. * @method * @example commerceLookupsPaymentMethodBatchClient.remove(commercePaymentMethodIds) .then(function (data) { // perform success action here }, function (response, status, headers, config) { // perform error handling here }); **/ CommerceLookupsPaymentMethodBatchClient.prototype.remove = function (ids) { return this.apiClient.delete(this.commerceLookupsPaymentMethodBatchRoute.delete(), undefined, ids); }; CommerceLookupsPaymentMethodBatchClient = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(__1.TYPES.CommerceLookupsPaymentMethodBatchRoute)), tslib_1.__param(1, inversify_1.inject(httpApi_1.httpTYPES.ApiClient)), tslib_1.__metadata("design:paramtypes", [__1.CommerceLookupsPaymentMethodBatchRoute, httpApi_1.ApiClient]) ], CommerceLookupsPaymentMethodBatchClient); return CommerceLookupsPaymentMethodBatchClient; }()); exports.CommerceLookupsPaymentMethodBatchClient = CommerceLookupsPaymentMethodBatchClient; /** * @copyright (c) 2017 Mono Ltd * @license MIT * @author Mono Ltd * @overview ***Notes:** - Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points. - All end-point objects are transformed by the associated route service. */