@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
149 lines • 8.21 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.AndroidFilesCompanyLevelApi = 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 AndroidFilesCompanyLevelApi
*/
class AndroidFilesCompanyLevelApi 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 Android app
* @param companyId {@link string } The unique identifier of the company account.
* @param id {@link string } The unique identifier of the app.
* @param requestOptions {@link IRequest.Options }
* @return {@link AndroidApp }
*/
async getAndroidApp(companyId, id, requestOptions) {
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps/{id}`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)))
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
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, "AndroidApp");
}
/**
* @summary Get a list of Android apps
* @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 packageName {@link string } The package name that uniquely identifies the Android app.
* @param versionCode {@link number } The version number of the app.
* @return {@link AndroidAppsResponse }
*/
async listAndroidApps(companyId, pageNumber, pageSize, packageName, versionCode, requestOptions) {
var _a, _b;
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps`
.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 : packageName) !== null && _b !== void 0 ? _b : versionCode;
if (hasDefinedQueryParams) {
if (!requestOptions)
requestOptions = {};
if (!requestOptions.params)
requestOptions.params = {};
if (pageNumber)
requestOptions.params["pageNumber"] = pageNumber;
if (pageSize)
requestOptions.params["pageSize"] = pageSize;
if (packageName)
requestOptions.params["packageName"] = packageName;
if (versionCode)
requestOptions.params["versionCode"] = versionCode;
}
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "AndroidAppsResponse");
}
/**
* @summary Get a list of Android certificates
* @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 certificateName {@link string } The name of the certificate.
* @return {@link AndroidCertificatesResponse }
*/
async listAndroidCertificates(companyId, pageNumber, pageSize, certificateName, requestOptions) {
var _a;
const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
const resource = new resource_1.default(this, endpoint);
const hasDefinedQueryParams = (_a = pageNumber !== null && pageNumber !== void 0 ? pageNumber : pageSize) !== null && _a !== void 0 ? _a : certificateName;
if (hasDefinedQueryParams) {
if (!requestOptions)
requestOptions = {};
if (!requestOptions.params)
requestOptions.params = {};
if (pageNumber)
requestOptions.params["pageNumber"] = pageNumber;
if (pageSize)
requestOptions.params["pageSize"] = pageSize;
if (certificateName)
requestOptions.params["certificateName"] = certificateName;
}
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "AndroidCertificatesResponse");
}
/**
* @summary Reprocess Android App
* @param companyId {@link string } The unique identifier of the company account.
* @param id {@link string } The unique identifier of the app.
* @param requestOptions {@link IRequest.Options }
* @return {@link ReprocessAndroidAppResponse }
*/
async reprocessAndroidApp(companyId, id, requestOptions) {
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps/{id}`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)))
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
const resource = new resource_1.default(this, endpoint);
const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "PATCH" });
return objectSerializer_1.ObjectSerializer.deserialize(response, "ReprocessAndroidAppResponse");
}
/**
* @summary Upload Android App
* @param companyId {@link string } The unique identifier of the company account.
* @param requestOptions {@link IRequest.Options }
* @return {@link UploadAndroidAppResponse }
*/
async uploadAndroidApp(companyId, requestOptions) {
const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
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, "UploadAndroidAppResponse");
}
/**
* @summary Upload Android Certificate
* @param companyId {@link string } The unique identifier of the company account.
* @param requestOptions {@link IRequest.Options }
* @return {@link UploadAndroidCertificateResponse }
*/
async uploadAndroidCertificate(companyId, requestOptions) {
const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates`
.replace("{" + "companyId" + "}", encodeURIComponent(String(companyId)));
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, "UploadAndroidCertificateResponse");
}
}
exports.AndroidFilesCompanyLevelApi = AndroidFilesCompanyLevelApi;
//# sourceMappingURL=androidFilesCompanyLevelApi.js.map