@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
86 lines • 4.45 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.TerminalSettingsTerminalLevelApi = 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 TerminalSettingsTerminalLevelApi
*/
class TerminalSettingsTerminalLevelApi 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 the terminal logo
* @param terminalId {@link string } The unique identifier of the payment terminal.
* @param requestOptions {@link IRequest.Options }
* @return {@link Logo }
*/
async getTerminalLogo(terminalId, requestOptions) {
const endpoint = `${this.baseUrl}/terminals/{terminalId}/terminalLogos`
.replace("{" + "terminalId" + "}", encodeURIComponent(String(terminalId)));
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, "Logo");
}
/**
* @summary Get terminal settings
* @param terminalId {@link string } The unique identifier of the payment terminal.
* @param requestOptions {@link IRequest.Options }
* @return {@link TerminalSettings }
*/
async getTerminalSettings(terminalId, requestOptions) {
const endpoint = `${this.baseUrl}/terminals/{terminalId}/terminalSettings`
.replace("{" + "terminalId" + "}", encodeURIComponent(String(terminalId)));
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, "TerminalSettings");
}
/**
* @summary Update the logo
* @param terminalId {@link string } The unique identifier of the payment terminal.
* @param logo {@link Logo }
* @param requestOptions {@link IRequest.Options }
* @return {@link Logo }
*/
async updateLogo(terminalId, logo, requestOptions) {
const endpoint = `${this.baseUrl}/terminals/{terminalId}/terminalLogos`
.replace("{" + "terminalId" + "}", encodeURIComponent(String(terminalId)));
const resource = new resource_1.default(this, endpoint);
const request = objectSerializer_1.ObjectSerializer.serialize(logo, "Logo");
const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "PATCH" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "Logo");
}
/**
* @summary Update terminal settings
* @param terminalId {@link string } The unique identifier of the payment terminal.
* @param terminalSettings {@link TerminalSettings }
* @param requestOptions {@link IRequest.Options }
* @return {@link TerminalSettings }
*/
async updateTerminalSettings(terminalId, terminalSettings, requestOptions) {
const endpoint = `${this.baseUrl}/terminals/{terminalId}/terminalSettings`
.replace("{" + "terminalId" + "}", encodeURIComponent(String(terminalId)));
const resource = new resource_1.default(this, endpoint);
const request = objectSerializer_1.ObjectSerializer.serialize(terminalSettings, "TerminalSettings");
const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "PATCH" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "TerminalSettings");
}
}
exports.TerminalSettingsTerminalLevelApi = TerminalSettingsTerminalLevelApi;
//# sourceMappingURL=terminalSettingsTerminalLevelApi.js.map