@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
45 lines • 2.15 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.APIKeyMerchantLevelApi = 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 APIKeyMerchantLevelApi
*/
class APIKeyMerchantLevelApi 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 merchantId {@link string } The unique identifier of the merchant account.
* @param apiCredentialId {@link string } Unique identifier of the API credential.
* @param requestOptions {@link IRequest.Options }
* @return {@link GenerateApiKeyResponse }
*/
async generateNewApiKey(merchantId, apiCredentialId, requestOptions) {
const endpoint = `${this.baseUrl}/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey`
.replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId)))
.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.APIKeyMerchantLevelApi = APIKeyMerchantLevelApi;
//# sourceMappingURL=aPIKeyMerchantLevelApi.js.map