/*
 * The version of the OpenAPI document: v1
 * Contact: developer-experience@adyen.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit this class manually.
 */


import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
/* tslint:disable:no-unused-locals */
import { AndroidAppsResponse } from '../../typings/management/models';
import { AndroidCertificatesResponse } from '../../typings/management/models';
import { ExternalTerminalAction } from '../../typings/management/models';
import { ListExternalTerminalActionsResponse } from '../../typings/management/models';
import { IRequest } from "../../typings/requestOptions";
import ManagementResource from "../resource/management/managementResource";
import { ObjectSerializer } from "../../typings/management/models";


export default class TerminalActionsCompanyLevelApi extends Service {
    /**
     * @summary Get a list of Android apps
     * @param companyId The unique identifier of the company account.
     * @param pageNumber The number of the page to fetch.
     * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page.
     */
    public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidAppsResponse> {
        const localVarPath = "/companies/{companyId}/androidApps"
            .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId)));
        const resource = new ManagementResource(this, localVarPath);
        const response = await getJsonResponse<string, AndroidAppsResponse>(
            resource,
            "",
            { ...requestOptions, method: "GET" }
        );
        return ObjectSerializer.deserialize(response, "AndroidAppsResponse");
    }
    /**
     * @summary Get a list of Android certificates
     * @param companyId The unique identifier of the company account.
     * @param pageNumber The number of the page to fetch.
     * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page.
     */
    public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise<AndroidCertificatesResponse> {
        const localVarPath = "/companies/{companyId}/androidCertificates"
            .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId)));
        const resource = new ManagementResource(this, localVarPath);
        const response = await getJsonResponse<string, AndroidCertificatesResponse>(
            resource,
            "",
            { ...requestOptions, method: "GET" }
        );
        return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse");
    }
    /**
     * @summary Get a list of terminal actions
     * @param companyId The unique identifier of the company account.
     * @param pageNumber The number of the page to fetch.
     * @param pageSize The number of items to have on a page, maximum 100. The default is 20 items on a page.
     * @param status Returns terminal actions with the specified status.  Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**.
     * @param type Returns terminal actions of the specified type.  Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**.
     */
    public async listTerminalActions(companyId: string, requestOptions?: IRequest.Options): Promise<ListExternalTerminalActionsResponse> {
        const localVarPath = "/companies/{companyId}/terminalActions"
            .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId)));
        const resource = new ManagementResource(this, localVarPath);
        const response = await getJsonResponse<string, ListExternalTerminalActionsResponse>(
            resource,
            "",
            { ...requestOptions, method: "GET" }
        );
        return ObjectSerializer.deserialize(response, "ListExternalTerminalActionsResponse");
    }
    /**
     * @summary Get terminal action
     * @param companyId The unique identifier of the company account.
     * @param actionId The unique identifier of the terminal action.
     */
    public async getTerminalAction(companyId: string, actionId: string, requestOptions?: IRequest.Options): Promise<ExternalTerminalAction> {
        const localVarPath = "/companies/{companyId}/terminalActions/{actionId}"
            .replace('{' + 'companyId' + '}', encodeURIComponent(String(companyId)))
            .replace('{' + 'actionId' + '}', encodeURIComponent(String(actionId)));
        const resource = new ManagementResource(this, localVarPath);
        const response = await getJsonResponse<string, ExternalTerminalAction>(
            resource,
            "",
            { ...requestOptions, method: "GET" }
        );
        return ObjectSerializer.deserialize(response, "ExternalTerminalAction");
    }
}
