UNPKG

@adyen/api-library

Version:

The Adyen API Library for NodeJS enables you to work with Adyen APIs.

45 lines 2.14 kB
"use strict"; /* * 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.APIKeyCompanyLevelApi = 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 APIKeyCompanyLevelApi */ class APIKeyCompanyLevelApi 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 Generate new API key * @param companyId {@link string } The unique identifier of the company account. * @param apiCredentialId {@link string } Unique identifier of the API credential. * @param requestOptions {@link IRequest.Options } * @return {@link GenerateApiKeyResponse } */ async generateNewApiKey(companyId, apiCredentialId, requestOptions) { const endpoint = `${this.baseUrl}/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey` .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))) .replace("{" + "apiCredentialId" + "}", encodeURIComponent(String(apiCredentialId))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "POST" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "GenerateApiKeyResponse"); } } exports.APIKeyCompanyLevelApi = APIKeyCompanyLevelApi; //# sourceMappingURL=aPIKeyCompanyLevelApi.js.map