-
Notifications
You must be signed in to change notification settings - Fork 65
/
terminalManagementApi.ts
128 lines (118 loc) · 6.31 KB
/
terminalManagementApi.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
import Client from "../client";
import getJsonResponse from "../helpers/getJsonResponse";
import Service from "../service";
import { AssignTerminalsRequest } from "../typings/terminalManagement/models";
import { AssignTerminalsResponse } from "../typings/terminalManagement/models";
import { FindTerminalRequest } from "../typings/terminalManagement/models";
import { FindTerminalResponse } from "../typings/terminalManagement/models";
import { GetStoresUnderAccountRequest } from "../typings/terminalManagement/models";
import { GetStoresUnderAccountResponse } from "../typings/terminalManagement/models";
import { GetTerminalDetailsRequest } from "../typings/terminalManagement/models";
import { GetTerminalDetailsResponse } from "../typings/terminalManagement/models";
import { GetTerminalsUnderAccountRequest } from "../typings/terminalManagement/models";
import { GetTerminalsUnderAccountResponse } from "../typings/terminalManagement/models";
import { IRequest } from "../typings/requestOptions";
import Resource from "./resource";
import { ObjectSerializer } from "../typings/terminalManagement/models";
export class TerminalManagementAPI extends Service {
private readonly API_BASEPATH: string = "https://postfmapi-test.adyen.com/postfmapi/terminal/v1";
private baseUrl: string;
public constructor(client: Client) {
super(client);
this.baseUrl = this.createBaseUrl(this.API_BASEPATH);
}
/**
* @summary Assign terminals
* @param assignTerminalsRequest {@link AssignTerminalsRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link AssignTerminalsResponse }
*/
public async assignTerminals(assignTerminalsRequest: AssignTerminalsRequest, requestOptions?: IRequest.Options): Promise<AssignTerminalsResponse> {
const endpoint = `${this.baseUrl}/assignTerminals`;
const resource = new Resource(this, endpoint);
const request: AssignTerminalsRequest = ObjectSerializer.serialize(assignTerminalsRequest, "AssignTerminalsRequest");
const response = await getJsonResponse<AssignTerminalsRequest, AssignTerminalsResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "AssignTerminalsResponse");
}
/**
* @summary Get the account or store of a terminal
* @param findTerminalRequest {@link FindTerminalRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link FindTerminalResponse }
*/
public async findTerminal(findTerminalRequest: FindTerminalRequest, requestOptions?: IRequest.Options): Promise<FindTerminalResponse> {
const endpoint = `${this.baseUrl}/findTerminal`;
const resource = new Resource(this, endpoint);
const request: FindTerminalRequest = ObjectSerializer.serialize(findTerminalRequest, "FindTerminalRequest");
const response = await getJsonResponse<FindTerminalRequest, FindTerminalResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "FindTerminalResponse");
}
/**
* @summary Get the stores of an account
* @param getStoresUnderAccountRequest {@link GetStoresUnderAccountRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link GetStoresUnderAccountResponse }
*/
public async getStoresUnderAccount(getStoresUnderAccountRequest: GetStoresUnderAccountRequest, requestOptions?: IRequest.Options): Promise<GetStoresUnderAccountResponse> {
const endpoint = `${this.baseUrl}/getStoresUnderAccount`;
const resource = new Resource(this, endpoint);
const request: GetStoresUnderAccountRequest = ObjectSerializer.serialize(getStoresUnderAccountRequest, "GetStoresUnderAccountRequest");
const response = await getJsonResponse<GetStoresUnderAccountRequest, GetStoresUnderAccountResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "GetStoresUnderAccountResponse");
}
/**
* @summary Get the details of a terminal
* @param getTerminalDetailsRequest {@link GetTerminalDetailsRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link GetTerminalDetailsResponse }
*/
public async getTerminalDetails(getTerminalDetailsRequest: GetTerminalDetailsRequest, requestOptions?: IRequest.Options): Promise<GetTerminalDetailsResponse> {
const endpoint = `${this.baseUrl}/getTerminalDetails`;
const resource = new Resource(this, endpoint);
const request: GetTerminalDetailsRequest = ObjectSerializer.serialize(getTerminalDetailsRequest, "GetTerminalDetailsRequest");
const response = await getJsonResponse<GetTerminalDetailsRequest, GetTerminalDetailsResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "GetTerminalDetailsResponse");
}
/**
* @summary Get the list of terminals
* @param getTerminalsUnderAccountRequest {@link GetTerminalsUnderAccountRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link GetTerminalsUnderAccountResponse }
*/
public async getTerminalsUnderAccount(getTerminalsUnderAccountRequest: GetTerminalsUnderAccountRequest, requestOptions?: IRequest.Options): Promise<GetTerminalsUnderAccountResponse> {
const endpoint = `${this.baseUrl}/getTerminalsUnderAccount`;
const resource = new Resource(this, endpoint);
const request: GetTerminalsUnderAccountRequest = ObjectSerializer.serialize(getTerminalsUnderAccountRequest, "GetTerminalsUnderAccountRequest");
const response = await getJsonResponse<GetTerminalsUnderAccountRequest, GetTerminalsUnderAccountResponse>(
resource,
request,
{ ...requestOptions, method: "POST" }
);
return ObjectSerializer.deserialize(response, "GetTerminalsUnderAccountResponse");
}
}
export default TerminalManagementAPI;