@gpuai/sdk 0.3.18 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +40 -0
- package/README.md +36 -2
- package/dist/apis/BillingApi.d.ts +70 -0
- package/dist/apis/BillingApi.js +197 -0
- package/dist/apis/FunctionsApi.d.ts +228 -0
- package/dist/apis/FunctionsApi.js +627 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/BillingApi.d.ts +70 -0
- package/dist/esm/apis/BillingApi.js +197 -0
- package/dist/esm/apis/FunctionsApi.d.ts +228 -0
- package/dist/esm/apis/FunctionsApi.js +623 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AutolaunchRule.d.ts +2 -1
- package/dist/esm/models/BillingDetails.d.ts +98 -0
- package/dist/esm/models/BillingDetails.js +85 -0
- package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
- package/dist/esm/models/CreateFunctionRequest.js +43 -0
- package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
- package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
- package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
- package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
- package/dist/esm/models/Function.d.ts +163 -0
- package/dist/esm/models/Function.js +109 -0
- package/dist/esm/models/FunctionList.d.ts +33 -0
- package/dist/esm/models/FunctionList.js +44 -0
- package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
- package/dist/esm/models/FunctionReplicaCounts.js +51 -0
- package/dist/esm/models/FunctionRun.d.ts +130 -0
- package/dist/esm/models/FunctionRun.js +94 -0
- package/dist/esm/models/FunctionRunError.d.ts +44 -0
- package/dist/esm/models/FunctionRunError.js +49 -0
- package/dist/esm/models/FunctionRunList.d.ts +39 -0
- package/dist/esm/models/FunctionRunList.js +48 -0
- package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
- package/dist/esm/models/FunctionRunLogChunk.js +63 -0
- package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
- package/dist/esm/models/FunctionRunLogs.js +52 -0
- package/dist/esm/models/FunctionUpload.d.ts +51 -0
- package/dist/esm/models/FunctionUpload.js +59 -0
- package/dist/esm/models/FunctionVersion.d.ts +137 -0
- package/dist/esm/models/FunctionVersion.js +109 -0
- package/dist/esm/models/Invoice.d.ts +68 -0
- package/dist/esm/models/Invoice.js +67 -0
- package/dist/esm/models/InvoiceList.d.ts +45 -0
- package/dist/esm/models/InvoiceList.js +50 -0
- package/dist/esm/models/ModelPricing.d.ts +46 -0
- package/dist/esm/models/ModelPricing.js +21 -0
- package/dist/esm/models/ModelRate.d.ts +62 -0
- package/dist/esm/models/ModelRate.js +51 -0
- package/dist/esm/models/PeakWindow.d.ts +38 -0
- package/dist/esm/models/PeakWindow.js +47 -0
- package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
- package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
- package/dist/esm/models/index.d.ts +19 -0
- package/dist/esm/models/index.js +19 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/AutolaunchRule.d.ts +2 -1
- package/dist/models/BillingDetails.d.ts +98 -0
- package/dist/models/BillingDetails.js +92 -0
- package/dist/models/CreateFunctionRequest.d.ts +32 -0
- package/dist/models/CreateFunctionRequest.js +50 -0
- package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
- package/dist/models/CreateFunctionRunRequest.js +52 -0
- package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
- package/dist/models/CreateFunctionVersionRequest.js +86 -0
- package/dist/models/Function.d.ts +163 -0
- package/dist/models/Function.js +117 -0
- package/dist/models/FunctionList.d.ts +33 -0
- package/dist/models/FunctionList.js +51 -0
- package/dist/models/FunctionReplicaCounts.d.ts +44 -0
- package/dist/models/FunctionReplicaCounts.js +58 -0
- package/dist/models/FunctionRun.d.ts +130 -0
- package/dist/models/FunctionRun.js +102 -0
- package/dist/models/FunctionRunError.d.ts +44 -0
- package/dist/models/FunctionRunError.js +56 -0
- package/dist/models/FunctionRunList.d.ts +39 -0
- package/dist/models/FunctionRunList.js +55 -0
- package/dist/models/FunctionRunLogChunk.d.ts +59 -0
- package/dist/models/FunctionRunLogChunk.js +71 -0
- package/dist/models/FunctionRunLogs.d.ts +45 -0
- package/dist/models/FunctionRunLogs.js +59 -0
- package/dist/models/FunctionUpload.d.ts +51 -0
- package/dist/models/FunctionUpload.js +67 -0
- package/dist/models/FunctionVersion.d.ts +137 -0
- package/dist/models/FunctionVersion.js +117 -0
- package/dist/models/Invoice.d.ts +68 -0
- package/dist/models/Invoice.js +74 -0
- package/dist/models/InvoiceList.d.ts +45 -0
- package/dist/models/InvoiceList.js +57 -0
- package/dist/models/ModelPricing.d.ts +46 -0
- package/dist/models/ModelPricing.js +22 -0
- package/dist/models/ModelRate.d.ts +62 -0
- package/dist/models/ModelRate.js +58 -0
- package/dist/models/PeakWindow.d.ts +38 -0
- package/dist/models/PeakWindow.js +54 -0
- package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
- package/dist/models/UpdateBillingDetailsRequest.js +64 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.js +19 -0
- package/dist/runtime.js +1 -1
- package/docs/BillingApi.md +299 -0
- package/docs/BillingDetails.md +56 -0
- package/docs/CreateFunctionRequest.md +34 -0
- package/docs/CreateFunctionRunRequest.md +36 -0
- package/docs/CreateFunctionVersionRequest.md +60 -0
- package/docs/Function.md +75 -0
- package/docs/FunctionList.md +34 -0
- package/docs/FunctionReplicaCounts.md +39 -0
- package/docs/FunctionRun.md +63 -0
- package/docs/FunctionRunError.md +38 -0
- package/docs/FunctionRunList.md +36 -0
- package/docs/FunctionRunLogChunk.md +40 -0
- package/docs/FunctionRunLogs.md +38 -0
- package/docs/FunctionUpload.md +38 -0
- package/docs/FunctionVersion.md +66 -0
- package/docs/FunctionsApi.md +880 -0
- package/docs/Invoice.md +46 -0
- package/docs/InvoiceList.md +38 -0
- package/docs/ModelPricing.md +12 -0
- package/docs/ModelRate.md +45 -0
- package/docs/PeakWindow.md +37 -0
- package/docs/UpdateBillingDetailsRequest.md +50 -0
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +247 -0
- package/src/apis/FunctionsApi.ts +828 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AutolaunchRule.ts +2 -1
- package/src/models/BillingDetails.ts +164 -0
- package/src/models/CreateFunctionRequest.ts +66 -0
- package/src/models/CreateFunctionRunRequest.ts +74 -0
- package/src/models/CreateFunctionVersionRequest.ts +175 -0
- package/src/models/Function.ts +255 -0
- package/src/models/FunctionList.ts +74 -0
- package/src/models/FunctionReplicaCounts.ts +84 -0
- package/src/models/FunctionRun.ts +207 -0
- package/src/models/FunctionRunError.ts +83 -0
- package/src/models/FunctionRunList.ts +83 -0
- package/src/models/FunctionRunLogChunk.ts +105 -0
- package/src/models/FunctionRunLogs.ts +92 -0
- package/src/models/FunctionUpload.ts +96 -0
- package/src/models/FunctionVersion.ts +226 -0
- package/src/models/Invoice.ts +120 -0
- package/src/models/InvoiceList.ts +91 -0
- package/src/models/ModelPricing.ts +74 -0
- package/src/models/ModelRate.ts +105 -0
- package/src/models/PeakWindow.ts +75 -0
- package/src/models/UpdateBillingDetailsRequest.ts +129 -0
- package/src/models/index.ts +19 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* GPU.ai Public Developer API
|
|
5
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@gpu.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type CreateFunctionRequest,
|
|
18
|
+
CreateFunctionRequestFromJSON,
|
|
19
|
+
CreateFunctionRequestToJSON,
|
|
20
|
+
} from '../models/CreateFunctionRequest';
|
|
21
|
+
import {
|
|
22
|
+
type CreateFunctionRunRequest,
|
|
23
|
+
CreateFunctionRunRequestFromJSON,
|
|
24
|
+
CreateFunctionRunRequestToJSON,
|
|
25
|
+
} from '../models/CreateFunctionRunRequest';
|
|
26
|
+
import {
|
|
27
|
+
type CreateFunctionVersionRequest,
|
|
28
|
+
CreateFunctionVersionRequestFromJSON,
|
|
29
|
+
CreateFunctionVersionRequestToJSON,
|
|
30
|
+
} from '../models/CreateFunctionVersionRequest';
|
|
31
|
+
import {
|
|
32
|
+
type Function,
|
|
33
|
+
FunctionFromJSON,
|
|
34
|
+
FunctionToJSON,
|
|
35
|
+
} from '../models/Function';
|
|
36
|
+
import {
|
|
37
|
+
type FunctionList,
|
|
38
|
+
FunctionListFromJSON,
|
|
39
|
+
FunctionListToJSON,
|
|
40
|
+
} from '../models/FunctionList';
|
|
41
|
+
import {
|
|
42
|
+
type FunctionRun,
|
|
43
|
+
FunctionRunFromJSON,
|
|
44
|
+
FunctionRunToJSON,
|
|
45
|
+
} from '../models/FunctionRun';
|
|
46
|
+
import {
|
|
47
|
+
type FunctionRunList,
|
|
48
|
+
FunctionRunListFromJSON,
|
|
49
|
+
FunctionRunListToJSON,
|
|
50
|
+
} from '../models/FunctionRunList';
|
|
51
|
+
import {
|
|
52
|
+
type FunctionRunLogs,
|
|
53
|
+
FunctionRunLogsFromJSON,
|
|
54
|
+
FunctionRunLogsToJSON,
|
|
55
|
+
} from '../models/FunctionRunLogs';
|
|
56
|
+
import {
|
|
57
|
+
type FunctionVersion,
|
|
58
|
+
FunctionVersionFromJSON,
|
|
59
|
+
FunctionVersionToJSON,
|
|
60
|
+
} from '../models/FunctionVersion';
|
|
61
|
+
import {
|
|
62
|
+
type Problem,
|
|
63
|
+
ProblemFromJSON,
|
|
64
|
+
ProblemToJSON,
|
|
65
|
+
} from '../models/Problem';
|
|
66
|
+
|
|
67
|
+
export interface ActivateFunctionVersionRequest {
|
|
68
|
+
id: string;
|
|
69
|
+
versionId: string;
|
|
70
|
+
idempotencyKey?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface CancelFunctionRunRequest {
|
|
74
|
+
id: string;
|
|
75
|
+
runId: string;
|
|
76
|
+
idempotencyKey?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface CreateFunctionOperationRequest {
|
|
80
|
+
createFunctionRequest: CreateFunctionRequest;
|
|
81
|
+
idempotencyKey?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface CreateFunctionRunOperationRequest {
|
|
85
|
+
id: string;
|
|
86
|
+
createFunctionRunRequest: CreateFunctionRunRequest;
|
|
87
|
+
idempotencyKey?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface CreateFunctionVersionOperationRequest {
|
|
91
|
+
id: string;
|
|
92
|
+
createFunctionVersionRequest: CreateFunctionVersionRequest;
|
|
93
|
+
idempotencyKey?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface DeleteFunctionRequest {
|
|
97
|
+
id: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface GetFunctionRequest {
|
|
101
|
+
id: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface GetFunctionRunRequest {
|
|
105
|
+
id: string;
|
|
106
|
+
runId: string;
|
|
107
|
+
wait?: number;
|
|
108
|
+
includeResult?: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface GetFunctionRunLogsRequest {
|
|
112
|
+
id: string;
|
|
113
|
+
runId: string;
|
|
114
|
+
after?: number;
|
|
115
|
+
limit?: number;
|
|
116
|
+
wait?: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ListFunctionRunsRequest {
|
|
120
|
+
id: string;
|
|
121
|
+
cursor?: string;
|
|
122
|
+
limit?: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
export class FunctionsApi extends runtime.BaseAPI {
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Creates request options for activateFunctionVersion without sending the request
|
|
132
|
+
*/
|
|
133
|
+
async activateFunctionVersionRequestOpts(requestParameters: ActivateFunctionVersionRequest): Promise<runtime.RequestOpts> {
|
|
134
|
+
if (requestParameters['id'] == null) {
|
|
135
|
+
throw new runtime.RequiredError(
|
|
136
|
+
'id',
|
|
137
|
+
'Required parameter "id" was null or undefined when calling activateFunctionVersion().'
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (requestParameters['versionId'] == null) {
|
|
142
|
+
throw new runtime.RequiredError(
|
|
143
|
+
'versionId',
|
|
144
|
+
'Required parameter "versionId" was null or undefined when calling activateFunctionVersion().'
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const queryParameters: any = {};
|
|
149
|
+
|
|
150
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
151
|
+
|
|
152
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
153
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
157
|
+
const token = this.configuration.accessToken;
|
|
158
|
+
const tokenString = await token("bearerAuth", []);
|
|
159
|
+
|
|
160
|
+
if (tokenString) {
|
|
161
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let urlPath = `/functions/{id}/versions/{version_id}/activate`;
|
|
166
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
167
|
+
urlPath = urlPath.replace('{version_id}', encodeURIComponent(String(requestParameters['versionId'])));
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
path: urlPath,
|
|
171
|
+
method: 'POST',
|
|
172
|
+
headers: headerParameters,
|
|
173
|
+
query: queryParameters,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Reads the uploaded bundle back, checks it against the declared size and SHA-256 (422 on a mismatch or a missing upload), and makes the version the one the function\'s next call runs. Safe to repeat. Requires the `functions:write` scope.
|
|
179
|
+
* Confirm a version\'s upload and make it current
|
|
180
|
+
*/
|
|
181
|
+
async activateFunctionVersionRaw(requestParameters: ActivateFunctionVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionVersion>> {
|
|
182
|
+
const requestOptions = await this.activateFunctionVersionRequestOpts(requestParameters);
|
|
183
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
184
|
+
|
|
185
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionVersionFromJSON(jsonValue));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Reads the uploaded bundle back, checks it against the declared size and SHA-256 (422 on a mismatch or a missing upload), and makes the version the one the function\'s next call runs. Safe to repeat. Requires the `functions:write` scope.
|
|
190
|
+
* Confirm a version\'s upload and make it current
|
|
191
|
+
*/
|
|
192
|
+
async activateFunctionVersion(requestParameters: ActivateFunctionVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionVersion> {
|
|
193
|
+
const response = await this.activateFunctionVersionRaw(requestParameters, initOverrides);
|
|
194
|
+
return await response.value();
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Creates request options for cancelFunctionRun without sending the request
|
|
199
|
+
*/
|
|
200
|
+
async cancelFunctionRunRequestOpts(requestParameters: CancelFunctionRunRequest): Promise<runtime.RequestOpts> {
|
|
201
|
+
if (requestParameters['id'] == null) {
|
|
202
|
+
throw new runtime.RequiredError(
|
|
203
|
+
'id',
|
|
204
|
+
'Required parameter "id" was null or undefined when calling cancelFunctionRun().'
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (requestParameters['runId'] == null) {
|
|
209
|
+
throw new runtime.RequiredError(
|
|
210
|
+
'runId',
|
|
211
|
+
'Required parameter "runId" was null or undefined when calling cancelFunctionRun().'
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const queryParameters: any = {};
|
|
216
|
+
|
|
217
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
218
|
+
|
|
219
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
220
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
224
|
+
const token = this.configuration.accessToken;
|
|
225
|
+
const tokenString = await token("bearerAuth", []);
|
|
226
|
+
|
|
227
|
+
if (tokenString) {
|
|
228
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
let urlPath = `/functions/{id}/runs/{run_id}/cancel`;
|
|
233
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
234
|
+
urlPath = urlPath.replace('{run_id}', encodeURIComponent(String(requestParameters['runId'])));
|
|
235
|
+
|
|
236
|
+
return {
|
|
237
|
+
path: urlPath,
|
|
238
|
+
method: 'POST',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* A queued run is cancelled at once; a running one is stopped on its machine within seconds, and the machine stays ready for the next call. Cancelling a finished run changes nothing and returns it, so the request is safe to repeat. Requires the `functions:write` scope.
|
|
246
|
+
* Cancel a run
|
|
247
|
+
*/
|
|
248
|
+
async cancelFunctionRunRaw(requestParameters: CancelFunctionRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionRun>> {
|
|
249
|
+
const requestOptions = await this.cancelFunctionRunRequestOpts(requestParameters);
|
|
250
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
251
|
+
|
|
252
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionRunFromJSON(jsonValue));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A queued run is cancelled at once; a running one is stopped on its machine within seconds, and the machine stays ready for the next call. Cancelling a finished run changes nothing and returns it, so the request is safe to repeat. Requires the `functions:write` scope.
|
|
257
|
+
* Cancel a run
|
|
258
|
+
*/
|
|
259
|
+
async cancelFunctionRun(requestParameters: CancelFunctionRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionRun> {
|
|
260
|
+
const response = await this.cancelFunctionRunRaw(requestParameters, initOverrides);
|
|
261
|
+
return await response.value();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Creates request options for createFunction without sending the request
|
|
266
|
+
*/
|
|
267
|
+
async createFunctionRequestOpts(requestParameters: CreateFunctionOperationRequest): Promise<runtime.RequestOpts> {
|
|
268
|
+
if (requestParameters['createFunctionRequest'] == null) {
|
|
269
|
+
throw new runtime.RequiredError(
|
|
270
|
+
'createFunctionRequest',
|
|
271
|
+
'Required parameter "createFunctionRequest" was null or undefined when calling createFunction().'
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const queryParameters: any = {};
|
|
276
|
+
|
|
277
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
278
|
+
|
|
279
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
280
|
+
|
|
281
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
282
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
286
|
+
const token = this.configuration.accessToken;
|
|
287
|
+
const tokenString = await token("bearerAuth", []);
|
|
288
|
+
|
|
289
|
+
if (tokenString) {
|
|
290
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
let urlPath = `/functions`;
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
path: urlPath,
|
|
298
|
+
method: 'POST',
|
|
299
|
+
headers: headerParameters,
|
|
300
|
+
query: queryParameters,
|
|
301
|
+
body: CreateFunctionRequestToJSON(requestParameters['createFunctionRequest']),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Returns the organization\'s function with this name, creating it on first use (201) or returning the existing one (200). Creating a function starts no machine and costs nothing. Requires the `functions:write` scope. The key must belong to a user, because the function\'s machines are launched as that user.
|
|
307
|
+
* Get or create a function by name
|
|
308
|
+
*/
|
|
309
|
+
async createFunctionRaw(requestParameters: CreateFunctionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Function>> {
|
|
310
|
+
const requestOptions = await this.createFunctionRequestOpts(requestParameters);
|
|
311
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
312
|
+
|
|
313
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionFromJSON(jsonValue));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Returns the organization\'s function with this name, creating it on first use (201) or returning the existing one (200). Creating a function starts no machine and costs nothing. Requires the `functions:write` scope. The key must belong to a user, because the function\'s machines are launched as that user.
|
|
318
|
+
* Get or create a function by name
|
|
319
|
+
*/
|
|
320
|
+
async createFunction(requestParameters: CreateFunctionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Function> {
|
|
321
|
+
const response = await this.createFunctionRaw(requestParameters, initOverrides);
|
|
322
|
+
return await response.value();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Creates request options for createFunctionRun without sending the request
|
|
327
|
+
*/
|
|
328
|
+
async createFunctionRunRequestOpts(requestParameters: CreateFunctionRunOperationRequest): Promise<runtime.RequestOpts> {
|
|
329
|
+
if (requestParameters['id'] == null) {
|
|
330
|
+
throw new runtime.RequiredError(
|
|
331
|
+
'id',
|
|
332
|
+
'Required parameter "id" was null or undefined when calling createFunctionRun().'
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (requestParameters['createFunctionRunRequest'] == null) {
|
|
337
|
+
throw new runtime.RequiredError(
|
|
338
|
+
'createFunctionRunRequest',
|
|
339
|
+
'Required parameter "createFunctionRunRequest" was null or undefined when calling createFunctionRun().'
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const queryParameters: any = {};
|
|
344
|
+
|
|
345
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
346
|
+
|
|
347
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
348
|
+
|
|
349
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
350
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
354
|
+
const token = this.configuration.accessToken;
|
|
355
|
+
const tokenString = await token("bearerAuth", []);
|
|
356
|
+
|
|
357
|
+
if (tokenString) {
|
|
358
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
let urlPath = `/functions/{id}/runs`;
|
|
363
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
path: urlPath,
|
|
367
|
+
method: 'POST',
|
|
368
|
+
headers: headerParameters,
|
|
369
|
+
query: queryParameters,
|
|
370
|
+
body: CreateFunctionRunRequestToJSON(requestParameters['createFunctionRunRequest']),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Queues one call and returns at once (202). A warm machine takes it within moments; otherwise a machine is started for it, up to the function\'s `max_concurrency`, beyond which calls wait in the queue. Read the run with `wait` for the outcome. Send an `Idempotency-Key` so a retried request does not run the function twice. Calling a function can start a billed machine: an organization with no balance is refused with 402, and the organization\'s spending limits apply when the machine is requested. Requires the `functions:write` scope.
|
|
376
|
+
* Call a function
|
|
377
|
+
*/
|
|
378
|
+
async createFunctionRunRaw(requestParameters: CreateFunctionRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionRun>> {
|
|
379
|
+
const requestOptions = await this.createFunctionRunRequestOpts(requestParameters);
|
|
380
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
381
|
+
|
|
382
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionRunFromJSON(jsonValue));
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Queues one call and returns at once (202). A warm machine takes it within moments; otherwise a machine is started for it, up to the function\'s `max_concurrency`, beyond which calls wait in the queue. Read the run with `wait` for the outcome. Send an `Idempotency-Key` so a retried request does not run the function twice. Calling a function can start a billed machine: an organization with no balance is refused with 402, and the organization\'s spending limits apply when the machine is requested. Requires the `functions:write` scope.
|
|
387
|
+
* Call a function
|
|
388
|
+
*/
|
|
389
|
+
async createFunctionRun(requestParameters: CreateFunctionRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionRun> {
|
|
390
|
+
const response = await this.createFunctionRunRaw(requestParameters, initOverrides);
|
|
391
|
+
return await response.value();
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Creates request options for createFunctionVersion without sending the request
|
|
396
|
+
*/
|
|
397
|
+
async createFunctionVersionRequestOpts(requestParameters: CreateFunctionVersionOperationRequest): Promise<runtime.RequestOpts> {
|
|
398
|
+
if (requestParameters['id'] == null) {
|
|
399
|
+
throw new runtime.RequiredError(
|
|
400
|
+
'id',
|
|
401
|
+
'Required parameter "id" was null or undefined when calling createFunctionVersion().'
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (requestParameters['createFunctionVersionRequest'] == null) {
|
|
406
|
+
throw new runtime.RequiredError(
|
|
407
|
+
'createFunctionVersionRequest',
|
|
408
|
+
'Required parameter "createFunctionVersionRequest" was null or undefined when calling createFunctionVersion().'
|
|
409
|
+
);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const queryParameters: any = {};
|
|
413
|
+
|
|
414
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
415
|
+
|
|
416
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
417
|
+
|
|
418
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
419
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
423
|
+
const token = this.configuration.accessToken;
|
|
424
|
+
const tokenString = await token("bearerAuth", []);
|
|
425
|
+
|
|
426
|
+
if (tokenString) {
|
|
427
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
let urlPath = `/functions/{id}/versions`;
|
|
432
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
433
|
+
|
|
434
|
+
return {
|
|
435
|
+
path: urlPath,
|
|
436
|
+
method: 'POST',
|
|
437
|
+
headers: headerParameters,
|
|
438
|
+
query: queryParameters,
|
|
439
|
+
body: CreateFunctionVersionRequestToJSON(requestParameters['createFunctionVersionRequest']),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Declares one version of the function: the digest of its pickled code, its Python dependencies and its settings. Idempotent on `content_hash`: the same hash returns the existing version (200) instead of a new one (201). A version whose code is not uploaded yet carries an `upload` URL; PUT the bundle there, then activate the version. Requires the `functions:write` scope.
|
|
445
|
+
* Register a version of a function
|
|
446
|
+
*/
|
|
447
|
+
async createFunctionVersionRaw(requestParameters: CreateFunctionVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionVersion>> {
|
|
448
|
+
const requestOptions = await this.createFunctionVersionRequestOpts(requestParameters);
|
|
449
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
450
|
+
|
|
451
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionVersionFromJSON(jsonValue));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Declares one version of the function: the digest of its pickled code, its Python dependencies and its settings. Idempotent on `content_hash`: the same hash returns the existing version (200) instead of a new one (201). A version whose code is not uploaded yet carries an `upload` URL; PUT the bundle there, then activate the version. Requires the `functions:write` scope.
|
|
456
|
+
* Register a version of a function
|
|
457
|
+
*/
|
|
458
|
+
async createFunctionVersion(requestParameters: CreateFunctionVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionVersion> {
|
|
459
|
+
const response = await this.createFunctionVersionRaw(requestParameters, initOverrides);
|
|
460
|
+
return await response.value();
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Creates request options for deleteFunction without sending the request
|
|
465
|
+
*/
|
|
466
|
+
async deleteFunctionRequestOpts(requestParameters: DeleteFunctionRequest): Promise<runtime.RequestOpts> {
|
|
467
|
+
if (requestParameters['id'] == null) {
|
|
468
|
+
throw new runtime.RequiredError(
|
|
469
|
+
'id',
|
|
470
|
+
'Required parameter "id" was null or undefined when calling deleteFunction().'
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const queryParameters: any = {};
|
|
475
|
+
|
|
476
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
477
|
+
|
|
478
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
479
|
+
const token = this.configuration.accessToken;
|
|
480
|
+
const tokenString = await token("bearerAuth", []);
|
|
481
|
+
|
|
482
|
+
if (tokenString) {
|
|
483
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
let urlPath = `/functions/{id}`;
|
|
488
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
489
|
+
|
|
490
|
+
return {
|
|
491
|
+
path: urlPath,
|
|
492
|
+
method: 'DELETE',
|
|
493
|
+
headers: headerParameters,
|
|
494
|
+
query: queryParameters,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* The function stops taking calls, its queued calls are cancelled, a call that is executing is stopped, and its machines are released, which ends their billing. The name can be reused afterwards. Requires the `functions:write` scope.
|
|
500
|
+
* Delete a function
|
|
501
|
+
*/
|
|
502
|
+
async deleteFunctionRaw(requestParameters: DeleteFunctionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
503
|
+
const requestOptions = await this.deleteFunctionRequestOpts(requestParameters);
|
|
504
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
505
|
+
|
|
506
|
+
return new runtime.VoidApiResponse(response);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* The function stops taking calls, its queued calls are cancelled, a call that is executing is stopped, and its machines are released, which ends their billing. The name can be reused afterwards. Requires the `functions:write` scope.
|
|
511
|
+
* Delete a function
|
|
512
|
+
*/
|
|
513
|
+
async deleteFunction(requestParameters: DeleteFunctionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
514
|
+
await this.deleteFunctionRaw(requestParameters, initOverrides);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Creates request options for getFunction without sending the request
|
|
519
|
+
*/
|
|
520
|
+
async getFunctionRequestOpts(requestParameters: GetFunctionRequest): Promise<runtime.RequestOpts> {
|
|
521
|
+
if (requestParameters['id'] == null) {
|
|
522
|
+
throw new runtime.RequiredError(
|
|
523
|
+
'id',
|
|
524
|
+
'Required parameter "id" was null or undefined when calling getFunction().'
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const queryParameters: any = {};
|
|
529
|
+
|
|
530
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
531
|
+
|
|
532
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
533
|
+
const token = this.configuration.accessToken;
|
|
534
|
+
const tokenString = await token("bearerAuth", []);
|
|
535
|
+
|
|
536
|
+
if (tokenString) {
|
|
537
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
let urlPath = `/functions/{id}`;
|
|
542
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
543
|
+
|
|
544
|
+
return {
|
|
545
|
+
path: urlPath,
|
|
546
|
+
method: 'GET',
|
|
547
|
+
headers: headerParameters,
|
|
548
|
+
query: queryParameters,
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Requires the `functions:read` scope.
|
|
554
|
+
* Get a function
|
|
555
|
+
*/
|
|
556
|
+
async getFunctionRaw(requestParameters: GetFunctionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Function>> {
|
|
557
|
+
const requestOptions = await this.getFunctionRequestOpts(requestParameters);
|
|
558
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
559
|
+
|
|
560
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionFromJSON(jsonValue));
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Requires the `functions:read` scope.
|
|
565
|
+
* Get a function
|
|
566
|
+
*/
|
|
567
|
+
async getFunction(requestParameters: GetFunctionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Function> {
|
|
568
|
+
const response = await this.getFunctionRaw(requestParameters, initOverrides);
|
|
569
|
+
return await response.value();
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Creates request options for getFunctionRun without sending the request
|
|
574
|
+
*/
|
|
575
|
+
async getFunctionRunRequestOpts(requestParameters: GetFunctionRunRequest): Promise<runtime.RequestOpts> {
|
|
576
|
+
if (requestParameters['id'] == null) {
|
|
577
|
+
throw new runtime.RequiredError(
|
|
578
|
+
'id',
|
|
579
|
+
'Required parameter "id" was null or undefined when calling getFunctionRun().'
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if (requestParameters['runId'] == null) {
|
|
584
|
+
throw new runtime.RequiredError(
|
|
585
|
+
'runId',
|
|
586
|
+
'Required parameter "runId" was null or undefined when calling getFunctionRun().'
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
const queryParameters: any = {};
|
|
591
|
+
|
|
592
|
+
if (requestParameters['wait'] != null) {
|
|
593
|
+
queryParameters['wait'] = requestParameters['wait'];
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
if (requestParameters['includeResult'] != null) {
|
|
597
|
+
queryParameters['include_result'] = requestParameters['includeResult'];
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
601
|
+
|
|
602
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
603
|
+
const token = this.configuration.accessToken;
|
|
604
|
+
const tokenString = await token("bearerAuth", []);
|
|
605
|
+
|
|
606
|
+
if (tokenString) {
|
|
607
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
let urlPath = `/functions/{id}/runs/{run_id}`;
|
|
612
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
613
|
+
urlPath = urlPath.replace('{run_id}', encodeURIComponent(String(requestParameters['runId'])));
|
|
614
|
+
|
|
615
|
+
return {
|
|
616
|
+
path: urlPath,
|
|
617
|
+
method: 'GET',
|
|
618
|
+
headers: headerParameters,
|
|
619
|
+
query: queryParameters,
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Returns one call. With `wait`, the request is held until the run finishes or the wait elapses, so a caller blocks on one request instead of polling. Requires the `functions:read` scope.
|
|
625
|
+
* Get a run
|
|
626
|
+
*/
|
|
627
|
+
async getFunctionRunRaw(requestParameters: GetFunctionRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionRun>> {
|
|
628
|
+
const requestOptions = await this.getFunctionRunRequestOpts(requestParameters);
|
|
629
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
630
|
+
|
|
631
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionRunFromJSON(jsonValue));
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Returns one call. With `wait`, the request is held until the run finishes or the wait elapses, so a caller blocks on one request instead of polling. Requires the `functions:read` scope.
|
|
636
|
+
* Get a run
|
|
637
|
+
*/
|
|
638
|
+
async getFunctionRun(requestParameters: GetFunctionRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionRun> {
|
|
639
|
+
const response = await this.getFunctionRunRaw(requestParameters, initOverrides);
|
|
640
|
+
return await response.value();
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Creates request options for getFunctionRunLogs without sending the request
|
|
645
|
+
*/
|
|
646
|
+
async getFunctionRunLogsRequestOpts(requestParameters: GetFunctionRunLogsRequest): Promise<runtime.RequestOpts> {
|
|
647
|
+
if (requestParameters['id'] == null) {
|
|
648
|
+
throw new runtime.RequiredError(
|
|
649
|
+
'id',
|
|
650
|
+
'Required parameter "id" was null or undefined when calling getFunctionRunLogs().'
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
if (requestParameters['runId'] == null) {
|
|
655
|
+
throw new runtime.RequiredError(
|
|
656
|
+
'runId',
|
|
657
|
+
'Required parameter "runId" was null or undefined when calling getFunctionRunLogs().'
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
const queryParameters: any = {};
|
|
662
|
+
|
|
663
|
+
if (requestParameters['after'] != null) {
|
|
664
|
+
queryParameters['after'] = requestParameters['after'];
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (requestParameters['limit'] != null) {
|
|
668
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
if (requestParameters['wait'] != null) {
|
|
672
|
+
queryParameters['wait'] = requestParameters['wait'];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
676
|
+
|
|
677
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
678
|
+
const token = this.configuration.accessToken;
|
|
679
|
+
const tokenString = await token("bearerAuth", []);
|
|
680
|
+
|
|
681
|
+
if (tokenString) {
|
|
682
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
let urlPath = `/functions/{id}/runs/{run_id}/logs`;
|
|
687
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
688
|
+
urlPath = urlPath.replace('{run_id}', encodeURIComponent(String(requestParameters['runId'])));
|
|
689
|
+
|
|
690
|
+
return {
|
|
691
|
+
path: urlPath,
|
|
692
|
+
method: 'GET',
|
|
693
|
+
headers: headerParameters,
|
|
694
|
+
query: queryParameters,
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Returns the run\'s stdout and stderr after `after`, oldest first. With `wait`, the request is held until there is new output or the run finishes, which is how a client follows a live run. Up to 4 MB of output is kept per run. Requires the `functions:read` scope.
|
|
700
|
+
* Read a run\'s output
|
|
701
|
+
*/
|
|
702
|
+
async getFunctionRunLogsRaw(requestParameters: GetFunctionRunLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionRunLogs>> {
|
|
703
|
+
const requestOptions = await this.getFunctionRunLogsRequestOpts(requestParameters);
|
|
704
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
705
|
+
|
|
706
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionRunLogsFromJSON(jsonValue));
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Returns the run\'s stdout and stderr after `after`, oldest first. With `wait`, the request is held until there is new output or the run finishes, which is how a client follows a live run. Up to 4 MB of output is kept per run. Requires the `functions:read` scope.
|
|
711
|
+
* Read a run\'s output
|
|
712
|
+
*/
|
|
713
|
+
async getFunctionRunLogs(requestParameters: GetFunctionRunLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionRunLogs> {
|
|
714
|
+
const response = await this.getFunctionRunLogsRaw(requestParameters, initOverrides);
|
|
715
|
+
return await response.value();
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Creates request options for listFunctionRuns without sending the request
|
|
720
|
+
*/
|
|
721
|
+
async listFunctionRunsRequestOpts(requestParameters: ListFunctionRunsRequest): Promise<runtime.RequestOpts> {
|
|
722
|
+
if (requestParameters['id'] == null) {
|
|
723
|
+
throw new runtime.RequiredError(
|
|
724
|
+
'id',
|
|
725
|
+
'Required parameter "id" was null or undefined when calling listFunctionRuns().'
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
const queryParameters: any = {};
|
|
730
|
+
|
|
731
|
+
if (requestParameters['cursor'] != null) {
|
|
732
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (requestParameters['limit'] != null) {
|
|
736
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
740
|
+
|
|
741
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
742
|
+
const token = this.configuration.accessToken;
|
|
743
|
+
const tokenString = await token("bearerAuth", []);
|
|
744
|
+
|
|
745
|
+
if (tokenString) {
|
|
746
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
let urlPath = `/functions/{id}/runs`;
|
|
751
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
752
|
+
|
|
753
|
+
return {
|
|
754
|
+
path: urlPath,
|
|
755
|
+
method: 'GET',
|
|
756
|
+
headers: headerParameters,
|
|
757
|
+
query: queryParameters,
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Newest first. Requires the `functions:read` scope.
|
|
763
|
+
* List a function\'s runs
|
|
764
|
+
*/
|
|
765
|
+
async listFunctionRunsRaw(requestParameters: ListFunctionRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionRunList>> {
|
|
766
|
+
const requestOptions = await this.listFunctionRunsRequestOpts(requestParameters);
|
|
767
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
768
|
+
|
|
769
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionRunListFromJSON(jsonValue));
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Newest first. Requires the `functions:read` scope.
|
|
774
|
+
* List a function\'s runs
|
|
775
|
+
*/
|
|
776
|
+
async listFunctionRuns(requestParameters: ListFunctionRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionRunList> {
|
|
777
|
+
const response = await this.listFunctionRunsRaw(requestParameters, initOverrides);
|
|
778
|
+
return await response.value();
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Creates request options for listFunctions without sending the request
|
|
783
|
+
*/
|
|
784
|
+
async listFunctionsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
785
|
+
const queryParameters: any = {};
|
|
786
|
+
|
|
787
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
788
|
+
|
|
789
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
790
|
+
const token = this.configuration.accessToken;
|
|
791
|
+
const tokenString = await token("bearerAuth", []);
|
|
792
|
+
|
|
793
|
+
if (tokenString) {
|
|
794
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
let urlPath = `/functions`;
|
|
799
|
+
|
|
800
|
+
return {
|
|
801
|
+
path: urlPath,
|
|
802
|
+
method: 'GET',
|
|
803
|
+
headers: headerParameters,
|
|
804
|
+
query: queryParameters,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Returns the organization\'s functions, newest first, each with the settings of its current version, what its machines are doing and what it cost in the last 24 hours. Requires the `functions:read` scope.
|
|
810
|
+
* List functions
|
|
811
|
+
*/
|
|
812
|
+
async listFunctionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FunctionList>> {
|
|
813
|
+
const requestOptions = await this.listFunctionsRequestOpts();
|
|
814
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
815
|
+
|
|
816
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FunctionListFromJSON(jsonValue));
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Returns the organization\'s functions, newest first, each with the settings of its current version, what its machines are doing and what it cost in the last 24 hours. Requires the `functions:read` scope.
|
|
821
|
+
* List functions
|
|
822
|
+
*/
|
|
823
|
+
async listFunctions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FunctionList> {
|
|
824
|
+
const response = await this.listFunctionsRaw(initOverrides);
|
|
825
|
+
return await response.value();
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
}
|