@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
78 lines • 4.31 kB
JavaScript
;
/*
* The version of the OpenAPI document: v3
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TerminalActionsCompanyLevelApi = void 0;
const getJsonResponse_1 = __importDefault(require("../../helpers/getJsonResponse"));
const service_1 = __importDefault(require("../../service"));
const resource_1 = __importDefault(require("../resource"));
const objectSerializer_1 = require("../../typings/management/objectSerializer");
/**
* API handler for TerminalActionsCompanyLevelApi
*/
class TerminalActionsCompanyLevelApi extends service_1.default {
constructor(client) {
super(client);
this.API_BASEPATH = "https://management-test.adyen.com/v3";
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}
/**
* @summary Get terminal action
* @param companyId {@link string } The unique identifier of the company account.
* @param actionId {@link string } The unique identifier of the terminal action.
* @param requestOptions {@link IRequest.Options }
* @return {@link ExternalTerminalAction }
*/
async getTerminalAction(companyId, actionId, requestOptions) {
const endpoint = `${this.baseUrl}/companies/{companyId}/terminalActions/{actionId}`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)))
.replace("{" + "actionId" + "}", encodeURIComponent(String(actionId)));
const resource = new resource_1.default(this, endpoint);
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "ExternalTerminalAction");
}
/**
* @summary Get a list of terminal actions
* @param companyId {@link string } The unique identifier of the company account.
* @param requestOptions {@link IRequest.Options }
* @param pageNumber {@link number } The number of the page to fetch.
* @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page.
* @param status {@link string } Returns terminal actions with the specified status. Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**.
* @param type {@link string } Returns terminal actions of the specified type. Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**.
* @return {@link ListExternalTerminalActionsResponse }
*/
async listTerminalActions(companyId, pageNumber, pageSize, status, type, requestOptions) {
var _a, _b;
const endpoint = `${this.baseUrl}/companies/{companyId}/terminalActions`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
const resource = new resource_1.default(this, endpoint);
const hasDefinedQueryParams = (_b = (_a = pageNumber !== null && pageNumber !== void 0 ? pageNumber : pageSize) !== null && _a !== void 0 ? _a : status) !== null && _b !== void 0 ? _b : type;
if (hasDefinedQueryParams) {
if (!requestOptions)
requestOptions = {};
if (!requestOptions.params)
requestOptions.params = {};
if (pageNumber)
requestOptions.params["pageNumber"] = pageNumber;
if (pageSize)
requestOptions.params["pageSize"] = pageSize;
if (status)
requestOptions.params["status"] = status;
if (type)
requestOptions.params["type"] = type;
}
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "ListExternalTerminalActionsResponse");
}
}
exports.TerminalActionsCompanyLevelApi = TerminalActionsCompanyLevelApi;
//# sourceMappingURL=terminalActionsCompanyLevelApi.js.map