@gpuai/sdk 0.2.4 → 0.3.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 +6 -6
- package/README.md +15 -10
- package/dist/apis/BillingApi.d.ts +51 -0
- package/dist/apis/BillingApi.js +144 -0
- package/dist/apis/CommunityApi.d.ts +0 -55
- package/dist/apis/CommunityApi.js +0 -151
- package/dist/apis/InstancesApi.d.ts +8 -0
- package/dist/apis/InstancesApi.js +10 -1
- package/dist/esm/apis/BillingApi.d.ts +51 -0
- package/dist/esm/apis/BillingApi.js +144 -0
- package/dist/esm/apis/CommunityApi.d.ts +0 -55
- package/dist/esm/apis/CommunityApi.js +0 -151
- package/dist/esm/apis/InstancesApi.d.ts +8 -0
- package/dist/esm/apis/InstancesApi.js +9 -0
- package/dist/esm/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/esm/models/CreateCryptoDepositRequest.js +68 -0
- package/dist/esm/models/CryptoDeposit.d.ts +114 -0
- package/dist/esm/models/CryptoDeposit.js +90 -0
- package/dist/esm/models/InstanceConnection.d.ts +1 -1
- package/dist/esm/models/ListDeposits200Response.d.ts +39 -0
- package/dist/esm/models/ListDeposits200Response.js +48 -0
- package/dist/esm/models/OperationResult.d.ts +1 -7
- package/dist/esm/models/OperationResult.js +0 -2
- package/dist/esm/models/index.d.ts +3 -3
- package/dist/esm/models/index.js +3 -3
- package/dist/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/models/CreateCryptoDepositRequest.js +76 -0
- package/dist/models/CryptoDeposit.d.ts +114 -0
- package/dist/models/CryptoDeposit.js +98 -0
- package/dist/models/InstanceConnection.d.ts +1 -1
- package/dist/models/ListDeposits200Response.d.ts +39 -0
- package/dist/models/ListDeposits200Response.js +55 -0
- package/dist/models/OperationResult.d.ts +1 -7
- package/dist/models/OperationResult.js +0 -2
- package/dist/models/index.d.ts +3 -3
- package/dist/models/index.js +3 -3
- package/docs/BillingApi.md +220 -0
- package/docs/CommunityApi.md +0 -230
- package/docs/CreateCryptoDepositRequest.md +38 -0
- package/docs/CryptoDeposit.md +55 -0
- package/docs/InstancesApi.md +4 -1
- package/docs/ListDeposits200Response.md +36 -0
- package/docs/OperationResult.md +1 -3
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +182 -0
- package/src/apis/CommunityApi.ts +0 -199
- package/src/apis/InstancesApi.ts +12 -0
- package/src/models/CreateCryptoDepositRequest.ts +108 -0
- package/src/models/CryptoDeposit.ts +177 -0
- package/src/models/InstanceConnection.ts +1 -1
- package/src/models/ListDeposits200Response.ts +83 -0
- package/src/models/OperationResult.ts +1 -9
- package/src/models/index.ts +3 -3
package/src/apis/BillingApi.ts
CHANGED
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type CreateCryptoDepositRequest,
|
|
18
|
+
CreateCryptoDepositRequestFromJSON,
|
|
19
|
+
CreateCryptoDepositRequestToJSON,
|
|
20
|
+
} from '../models/CreateCryptoDepositRequest';
|
|
21
|
+
import {
|
|
22
|
+
type CryptoDeposit,
|
|
23
|
+
CryptoDepositFromJSON,
|
|
24
|
+
CryptoDepositToJSON,
|
|
25
|
+
} from '../models/CryptoDeposit';
|
|
26
|
+
import {
|
|
27
|
+
type ListDeposits200Response,
|
|
28
|
+
ListDeposits200ResponseFromJSON,
|
|
29
|
+
ListDeposits200ResponseToJSON,
|
|
30
|
+
} from '../models/ListDeposits200Response';
|
|
16
31
|
import {
|
|
17
32
|
type Problem,
|
|
18
33
|
ProblemFromJSON,
|
|
@@ -29,6 +44,14 @@ import {
|
|
|
29
44
|
UpdateSpendingLimitRequestToJSON,
|
|
30
45
|
} from '../models/UpdateSpendingLimitRequest';
|
|
31
46
|
|
|
47
|
+
export interface CreateCryptoDepositOperationRequest {
|
|
48
|
+
createCryptoDepositRequest: CreateCryptoDepositRequest;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface GetDepositRequest {
|
|
52
|
+
id: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
export interface UpdateSpendingLimitOperationRequest {
|
|
33
56
|
updateSpendingLimitRequest: UpdateSpendingLimitRequest;
|
|
34
57
|
}
|
|
@@ -38,6 +61,118 @@ export interface UpdateSpendingLimitOperationRequest {
|
|
|
38
61
|
*/
|
|
39
62
|
export class BillingApi extends runtime.BaseAPI {
|
|
40
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Creates request options for createCryptoDeposit without sending the request
|
|
66
|
+
*/
|
|
67
|
+
async createCryptoDepositRequestOpts(requestParameters: CreateCryptoDepositOperationRequest): Promise<runtime.RequestOpts> {
|
|
68
|
+
if (requestParameters['createCryptoDepositRequest'] == null) {
|
|
69
|
+
throw new runtime.RequiredError(
|
|
70
|
+
'createCryptoDepositRequest',
|
|
71
|
+
'Required parameter "createCryptoDepositRequest" was null or undefined when calling createCryptoDeposit().'
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const queryParameters: any = {};
|
|
76
|
+
|
|
77
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
78
|
+
|
|
79
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
80
|
+
|
|
81
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
82
|
+
const token = this.configuration.accessToken;
|
|
83
|
+
const tokenString = await token("bearerAuth", []);
|
|
84
|
+
|
|
85
|
+
if (tokenString) {
|
|
86
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let urlPath = `/billing/deposits/crypto`;
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
path: urlPath,
|
|
94
|
+
method: 'POST',
|
|
95
|
+
headers: headerParameters,
|
|
96
|
+
query: queryParameters,
|
|
97
|
+
body: CreateCryptoDepositRequestToJSON(requestParameters['createCryptoDepositRequest']),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
103
|
+
* Create a stablecoin deposit
|
|
104
|
+
*/
|
|
105
|
+
async createCryptoDepositRaw(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>> {
|
|
106
|
+
const requestOptions = await this.createCryptoDepositRequestOpts(requestParameters);
|
|
107
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
108
|
+
|
|
109
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CryptoDepositFromJSON(jsonValue));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
114
|
+
* Create a stablecoin deposit
|
|
115
|
+
*/
|
|
116
|
+
async createCryptoDeposit(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit> {
|
|
117
|
+
const response = await this.createCryptoDepositRaw(requestParameters, initOverrides);
|
|
118
|
+
return await response.value();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates request options for getDeposit without sending the request
|
|
123
|
+
*/
|
|
124
|
+
async getDepositRequestOpts(requestParameters: GetDepositRequest): Promise<runtime.RequestOpts> {
|
|
125
|
+
if (requestParameters['id'] == null) {
|
|
126
|
+
throw new runtime.RequiredError(
|
|
127
|
+
'id',
|
|
128
|
+
'Required parameter "id" was null or undefined when calling getDeposit().'
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const queryParameters: any = {};
|
|
133
|
+
|
|
134
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
135
|
+
|
|
136
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
137
|
+
const token = this.configuration.accessToken;
|
|
138
|
+
const tokenString = await token("bearerAuth", []);
|
|
139
|
+
|
|
140
|
+
if (tokenString) {
|
|
141
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let urlPath = `/billing/deposits/{id}`;
|
|
146
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
path: urlPath,
|
|
150
|
+
method: 'GET',
|
|
151
|
+
headers: headerParameters,
|
|
152
|
+
query: queryParameters,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
|
|
158
|
+
* Get one stablecoin deposit
|
|
159
|
+
*/
|
|
160
|
+
async getDepositRaw(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>> {
|
|
161
|
+
const requestOptions = await this.getDepositRequestOpts(requestParameters);
|
|
162
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
163
|
+
|
|
164
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CryptoDepositFromJSON(jsonValue));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
|
|
169
|
+
* Get one stablecoin deposit
|
|
170
|
+
*/
|
|
171
|
+
async getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit> {
|
|
172
|
+
const response = await this.getDepositRaw(requestParameters, initOverrides);
|
|
173
|
+
return await response.value();
|
|
174
|
+
}
|
|
175
|
+
|
|
41
176
|
/**
|
|
42
177
|
* Creates request options for getSpendingLimit without sending the request
|
|
43
178
|
*/
|
|
@@ -85,6 +220,53 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
85
220
|
return await response.value();
|
|
86
221
|
}
|
|
87
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Creates request options for listDeposits without sending the request
|
|
225
|
+
*/
|
|
226
|
+
async listDepositsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
227
|
+
const queryParameters: any = {};
|
|
228
|
+
|
|
229
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
230
|
+
|
|
231
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
232
|
+
const token = this.configuration.accessToken;
|
|
233
|
+
const tokenString = await token("bearerAuth", []);
|
|
234
|
+
|
|
235
|
+
if (tokenString) {
|
|
236
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
let urlPath = `/billing/deposits`;
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
path: urlPath,
|
|
244
|
+
method: 'GET',
|
|
245
|
+
headers: headerParameters,
|
|
246
|
+
query: queryParameters,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
252
|
+
* List stablecoin deposits
|
|
253
|
+
*/
|
|
254
|
+
async listDepositsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDeposits200Response>> {
|
|
255
|
+
const requestOptions = await this.listDepositsRequestOpts();
|
|
256
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
257
|
+
|
|
258
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListDeposits200ResponseFromJSON(jsonValue));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
263
|
+
* List stablecoin deposits
|
|
264
|
+
*/
|
|
265
|
+
async listDeposits(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDeposits200Response> {
|
|
266
|
+
const response = await this.listDepositsRaw(initOverrides);
|
|
267
|
+
return await response.value();
|
|
268
|
+
}
|
|
269
|
+
|
|
88
270
|
/**
|
|
89
271
|
* Creates request options for updateSpendingLimit without sending the request
|
|
90
272
|
*/
|
package/src/apis/CommunityApi.ts
CHANGED
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import * as runtime from '../runtime';
|
|
16
|
-
import {
|
|
17
|
-
type CommunityEarnings,
|
|
18
|
-
CommunityEarningsFromJSON,
|
|
19
|
-
CommunityEarningsToJSON,
|
|
20
|
-
} from '../models/CommunityEarnings';
|
|
21
16
|
import {
|
|
22
17
|
type CommunityMachineDelistResult,
|
|
23
18
|
CommunityMachineDelistResultFromJSON,
|
|
@@ -48,16 +43,6 @@ import {
|
|
|
48
43
|
RegisterCommunityMachineRequestFromJSON,
|
|
49
44
|
RegisterCommunityMachineRequestToJSON,
|
|
50
45
|
} from '../models/RegisterCommunityMachineRequest';
|
|
51
|
-
import {
|
|
52
|
-
type SupplierMachineView,
|
|
53
|
-
SupplierMachineViewFromJSON,
|
|
54
|
-
SupplierMachineViewToJSON,
|
|
55
|
-
} from '../models/SupplierMachineView';
|
|
56
|
-
import {
|
|
57
|
-
type UpdateCommunityMachineRequest,
|
|
58
|
-
UpdateCommunityMachineRequestFromJSON,
|
|
59
|
-
UpdateCommunityMachineRequestToJSON,
|
|
60
|
-
} from '../models/UpdateCommunityMachineRequest';
|
|
61
46
|
|
|
62
47
|
export interface DelistCommunityMachineRequest {
|
|
63
48
|
id: string;
|
|
@@ -67,14 +52,6 @@ export interface EnableCommunitySupplierRequest {
|
|
|
67
52
|
idempotencyKey?: string;
|
|
68
53
|
}
|
|
69
54
|
|
|
70
|
-
export interface GetCommunityEarningsRequest {
|
|
71
|
-
limit?: number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface GetCommunityMachineRequest {
|
|
75
|
-
id: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
55
|
export interface ReclaimCommunityMachineRequest {
|
|
79
56
|
id: string;
|
|
80
57
|
}
|
|
@@ -84,11 +61,6 @@ export interface RegisterCommunityMachineOperationRequest {
|
|
|
84
61
|
registerCommunityMachineRequest?: RegisterCommunityMachineRequest;
|
|
85
62
|
}
|
|
86
63
|
|
|
87
|
-
export interface UpdateCommunityMachineOperationRequest {
|
|
88
|
-
id: string;
|
|
89
|
-
updateCommunityMachineRequest: UpdateCommunityMachineRequest;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
64
|
/**
|
|
93
65
|
*
|
|
94
66
|
*/
|
|
@@ -200,112 +172,6 @@ export class CommunityApi extends runtime.BaseAPI {
|
|
|
200
172
|
return await response.value();
|
|
201
173
|
}
|
|
202
174
|
|
|
203
|
-
/**
|
|
204
|
-
* Creates request options for getCommunityEarnings without sending the request
|
|
205
|
-
*/
|
|
206
|
-
async getCommunityEarningsRequestOpts(requestParameters: GetCommunityEarningsRequest): Promise<runtime.RequestOpts> {
|
|
207
|
-
const queryParameters: any = {};
|
|
208
|
-
|
|
209
|
-
if (requestParameters['limit'] != null) {
|
|
210
|
-
queryParameters['limit'] = requestParameters['limit'];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
214
|
-
|
|
215
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
216
|
-
const token = this.configuration.accessToken;
|
|
217
|
-
const tokenString = await token("bearerAuth", []);
|
|
218
|
-
|
|
219
|
-
if (tokenString) {
|
|
220
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
let urlPath = `/community/earnings`;
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
path: urlPath,
|
|
228
|
-
method: 'GET',
|
|
229
|
-
headers: headerParameters,
|
|
230
|
-
query: queryParameters,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Returns the caller org\'s supplier earnings — lifetime accrued and unpaid totals in cents plus recent ledger entries, newest first. An optional `limit` caps the ledger rows (server-clamped). Requires the `community` scope (read).
|
|
236
|
-
* Get your Community Cloud earnings
|
|
237
|
-
*/
|
|
238
|
-
async getCommunityEarningsRaw(requestParameters: GetCommunityEarningsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommunityEarnings>> {
|
|
239
|
-
const requestOptions = await this.getCommunityEarningsRequestOpts(requestParameters);
|
|
240
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
241
|
-
|
|
242
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CommunityEarningsFromJSON(jsonValue));
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Returns the caller org\'s supplier earnings — lifetime accrued and unpaid totals in cents plus recent ledger entries, newest first. An optional `limit` caps the ledger rows (server-clamped). Requires the `community` scope (read).
|
|
247
|
-
* Get your Community Cloud earnings
|
|
248
|
-
*/
|
|
249
|
-
async getCommunityEarnings(requestParameters: GetCommunityEarningsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommunityEarnings> {
|
|
250
|
-
const response = await this.getCommunityEarningsRaw(requestParameters, initOverrides);
|
|
251
|
-
return await response.value();
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Creates request options for getCommunityMachine without sending the request
|
|
256
|
-
*/
|
|
257
|
-
async getCommunityMachineRequestOpts(requestParameters: GetCommunityMachineRequest): Promise<runtime.RequestOpts> {
|
|
258
|
-
if (requestParameters['id'] == null) {
|
|
259
|
-
throw new runtime.RequiredError(
|
|
260
|
-
'id',
|
|
261
|
-
'Required parameter "id" was null or undefined when calling getCommunityMachine().'
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const queryParameters: any = {};
|
|
266
|
-
|
|
267
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
268
|
-
|
|
269
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
270
|
-
const token = this.configuration.accessToken;
|
|
271
|
-
const tokenString = await token("bearerAuth", []);
|
|
272
|
-
|
|
273
|
-
if (tokenString) {
|
|
274
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
let urlPath = `/community/machines/{id}`;
|
|
279
|
-
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
280
|
-
|
|
281
|
-
return {
|
|
282
|
-
path: urlPath,
|
|
283
|
-
method: 'GET',
|
|
284
|
-
headers: headerParameters,
|
|
285
|
-
query: queryParameters,
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Returns one machine the caller\'s org owns, as a supplier-facing view (`occupied`/`online` projections — the renting customer\'s instance id is never exposed). A missing or cross-org machine returns 404 with an indistinguishable body. Requires the `community` scope (read).
|
|
291
|
-
* Get one of your Community Cloud machines
|
|
292
|
-
*/
|
|
293
|
-
async getCommunityMachineRaw(requestParameters: GetCommunityMachineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SupplierMachineView>> {
|
|
294
|
-
const requestOptions = await this.getCommunityMachineRequestOpts(requestParameters);
|
|
295
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
296
|
-
|
|
297
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SupplierMachineViewFromJSON(jsonValue));
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Returns one machine the caller\'s org owns, as a supplier-facing view (`occupied`/`online` projections — the renting customer\'s instance id is never exposed). A missing or cross-org machine returns 404 with an indistinguishable body. Requires the `community` scope (read).
|
|
302
|
-
* Get one of your Community Cloud machines
|
|
303
|
-
*/
|
|
304
|
-
async getCommunityMachine(requestParameters: GetCommunityMachineRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SupplierMachineView> {
|
|
305
|
-
const response = await this.getCommunityMachineRaw(requestParameters, initOverrides);
|
|
306
|
-
return await response.value();
|
|
307
|
-
}
|
|
308
|
-
|
|
309
175
|
/**
|
|
310
176
|
* Creates request options for getCommunitySupplierMe without sending the request
|
|
311
177
|
*/
|
|
@@ -509,69 +375,4 @@ export class CommunityApi extends runtime.BaseAPI {
|
|
|
509
375
|
return await response.value();
|
|
510
376
|
}
|
|
511
377
|
|
|
512
|
-
/**
|
|
513
|
-
* Creates request options for updateCommunityMachine without sending the request
|
|
514
|
-
*/
|
|
515
|
-
async updateCommunityMachineRequestOpts(requestParameters: UpdateCommunityMachineOperationRequest): Promise<runtime.RequestOpts> {
|
|
516
|
-
if (requestParameters['id'] == null) {
|
|
517
|
-
throw new runtime.RequiredError(
|
|
518
|
-
'id',
|
|
519
|
-
'Required parameter "id" was null or undefined when calling updateCommunityMachine().'
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
if (requestParameters['updateCommunityMachineRequest'] == null) {
|
|
524
|
-
throw new runtime.RequiredError(
|
|
525
|
-
'updateCommunityMachineRequest',
|
|
526
|
-
'Required parameter "updateCommunityMachineRequest" was null or undefined when calling updateCommunityMachine().'
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
const queryParameters: any = {};
|
|
531
|
-
|
|
532
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
533
|
-
|
|
534
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
535
|
-
|
|
536
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
537
|
-
const token = this.configuration.accessToken;
|
|
538
|
-
const tokenString = await token("bearerAuth", []);
|
|
539
|
-
|
|
540
|
-
if (tokenString) {
|
|
541
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
let urlPath = `/community/machines/{id}`;
|
|
546
|
-
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
547
|
-
|
|
548
|
-
return {
|
|
549
|
-
path: urlPath,
|
|
550
|
-
method: 'PATCH',
|
|
551
|
-
headers: headerParameters,
|
|
552
|
-
query: queryParameters,
|
|
553
|
-
body: UpdateCommunityMachineRequestToJSON(requestParameters['updateCommunityMachineRequest']),
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Sets the machine\'s hourly price. `price_per_hour` is the WHOLE-MACHINE rate (never per-GPU). Prices below the platform floor are rejected with a `price-below-floor` problem carrying the concrete `floor_per_hour` extension member. A price change never affects an in-flight rental (its rate was snapshotted at provision); the catalog reprices on the next poll. Requires the `community` scope (or `full_access`).
|
|
559
|
-
* Update a Community Cloud machine\'s price
|
|
560
|
-
*/
|
|
561
|
-
async updateCommunityMachineRaw(requestParameters: UpdateCommunityMachineOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SupplierMachineView>> {
|
|
562
|
-
const requestOptions = await this.updateCommunityMachineRequestOpts(requestParameters);
|
|
563
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
564
|
-
|
|
565
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SupplierMachineViewFromJSON(jsonValue));
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Sets the machine\'s hourly price. `price_per_hour` is the WHOLE-MACHINE rate (never per-GPU). Prices below the platform floor are rejected with a `price-below-floor` problem carrying the concrete `floor_per_hour` extension member. A price change never affects an in-flight rental (its rate was snapshotted at provision); the catalog reprices on the next poll. Requires the `community` scope (or `full_access`).
|
|
570
|
-
* Update a Community Cloud machine\'s price
|
|
571
|
-
*/
|
|
572
|
-
async updateCommunityMachine(requestParameters: UpdateCommunityMachineOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SupplierMachineView> {
|
|
573
|
-
const response = await this.updateCommunityMachineRaw(requestParameters, initOverrides);
|
|
574
|
-
return await response.value();
|
|
575
|
-
}
|
|
576
|
-
|
|
577
378
|
}
|
package/src/apis/InstancesApi.ts
CHANGED
|
@@ -56,6 +56,7 @@ export interface DeleteInstanceRequest {
|
|
|
56
56
|
|
|
57
57
|
export interface GetInstanceRequest {
|
|
58
58
|
id: string;
|
|
59
|
+
include?: GetInstanceIncludeEnum;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
export interface ListInstancesRequest {
|
|
@@ -206,6 +207,10 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
206
207
|
|
|
207
208
|
const queryParameters: any = {};
|
|
208
209
|
|
|
210
|
+
if (requestParameters['include'] != null) {
|
|
211
|
+
queryParameters['include'] = requestParameters['include'];
|
|
212
|
+
}
|
|
213
|
+
|
|
209
214
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
210
215
|
|
|
211
216
|
if (this.configuration && this.configuration.accessToken) {
|
|
@@ -374,6 +379,13 @@ export class InstancesApi extends runtime.BaseAPI {
|
|
|
374
379
|
|
|
375
380
|
}
|
|
376
381
|
|
|
382
|
+
/**
|
|
383
|
+
* @export
|
|
384
|
+
*/
|
|
385
|
+
export const GetInstanceIncludeEnum = {
|
|
386
|
+
Credentials: 'credentials'
|
|
387
|
+
} as const;
|
|
388
|
+
export type GetInstanceIncludeEnum = typeof GetInstanceIncludeEnum[keyof typeof GetInstanceIncludeEnum];
|
|
377
389
|
/**
|
|
378
390
|
* @export
|
|
379
391
|
*/
|
|
@@ -0,0 +1,108 @@
|
|
|
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 { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CreateCryptoDepositRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CreateCryptoDepositRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Amount to deposit in USD cents. Must be at least the configured minimum (500 = $5.00 by default).
|
|
24
|
+
*
|
|
25
|
+
* @type {number}
|
|
26
|
+
* @memberof CreateCryptoDepositRequest
|
|
27
|
+
*/
|
|
28
|
+
amountCents: number;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {CreateCryptoDepositRequestChainEnum}
|
|
32
|
+
* @memberof CreateCryptoDepositRequest
|
|
33
|
+
*/
|
|
34
|
+
chain: CreateCryptoDepositRequestChainEnum;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {CreateCryptoDepositRequestAssetEnum}
|
|
38
|
+
* @memberof CreateCryptoDepositRequest
|
|
39
|
+
*/
|
|
40
|
+
asset: CreateCryptoDepositRequestAssetEnum;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
export const CreateCryptoDepositRequestChainEnum = {
|
|
48
|
+
Ethereum: 'ethereum',
|
|
49
|
+
Base: 'base',
|
|
50
|
+
Arbitrum: 'arbitrum',
|
|
51
|
+
Polygon: 'polygon',
|
|
52
|
+
Solana: 'solana'
|
|
53
|
+
} as const;
|
|
54
|
+
export type CreateCryptoDepositRequestChainEnum = typeof CreateCryptoDepositRequestChainEnum[keyof typeof CreateCryptoDepositRequestChainEnum];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @export
|
|
58
|
+
*/
|
|
59
|
+
export const CreateCryptoDepositRequestAssetEnum = {
|
|
60
|
+
Usdc: 'usdc',
|
|
61
|
+
Usdt: 'usdt'
|
|
62
|
+
} as const;
|
|
63
|
+
export type CreateCryptoDepositRequestAssetEnum = typeof CreateCryptoDepositRequestAssetEnum[keyof typeof CreateCryptoDepositRequestAssetEnum];
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Check if a given object implements the CreateCryptoDepositRequest interface.
|
|
68
|
+
*/
|
|
69
|
+
export function instanceOfCreateCryptoDepositRequest(value: object): value is CreateCryptoDepositRequest {
|
|
70
|
+
if ((!('amountCents' in (value as Record<string, any>)) && !('amount_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['amountCents'] === undefined && (value as Record<string, any>)['amount_cents'] === undefined)) return false;
|
|
71
|
+
if (!('chain' in value) || value['chain'] === undefined) return false;
|
|
72
|
+
if (!('asset' in value) || value['asset'] === undefined) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function CreateCryptoDepositRequestFromJSON(json: any): CreateCryptoDepositRequest {
|
|
77
|
+
return CreateCryptoDepositRequestFromJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function CreateCryptoDepositRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCryptoDepositRequest {
|
|
81
|
+
if (json == null) {
|
|
82
|
+
return json;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'amountCents': json['amount_cents'],
|
|
87
|
+
'chain': json['chain'],
|
|
88
|
+
'asset': json['asset'],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function CreateCryptoDepositRequestToJSON(json: any): CreateCryptoDepositRequest {
|
|
93
|
+
return CreateCryptoDepositRequestToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function CreateCryptoDepositRequestToJSONTyped(value?: CreateCryptoDepositRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'amount_cents': value['amountCents'],
|
|
104
|
+
'chain': value['chain'],
|
|
105
|
+
'asset': value['asset'],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|