-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathterminalActionsTerminalLevelApi.ts
49 lines (44 loc) · 1.9 KB
/
terminalActionsTerminalLevelApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* 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.
*/
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import {
RestServiceError,
ScheduleTerminalActionsRequest,
ScheduleTerminalActionsResponse,
ObjectSerializer
} from "../../typings/management/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
export class TerminalActionsTerminalLevelApi extends Service {
private readonly API_BASEPATH: string = "https://management-test.adyen.com/v3";
private baseUrl: string;
public constructor(client: Client){
super(client);
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}
/**
* @summary Create a terminal action
* @param scheduleTerminalActionsRequest {@link ScheduleTerminalActionsRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link ScheduleTerminalActionsResponse }
*/
public async createTerminalAction(scheduleTerminalActionsRequest: ScheduleTerminalActionsRequest, requestOptions?: IRequest.Options): Promise<ScheduleTerminalActionsResponse> {
const endpoint = `${this.baseUrl}/terminals/scheduleActions`;
const resource = new Resource(this, endpoint);
const request: ScheduleTerminalActionsRequest = ObjectSerializer.serialize(scheduleTerminalActionsRequest, "ScheduleTerminalActionsRequest");
const response = await getJsonResponse<ScheduleTerminalActionsRequest, ScheduleTerminalActionsResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "ScheduleTerminalActionsResponse");
}
}